Bibcard Save

Library Linked Data for building knowledge cards.

Project README


BibCard is a Ruby library for retrieving and assembling knowledge card information about the authors found in bibliographic data. It takes identifiers like Library of Congress Name Authority File (LCNAF) or VIAF URIs as input and crawls Linked Open Data sources on the web to assemble a Ruby objects or RDF serializations. This library will fetch data from:

The VIAF URI lies at the core of the BibCard::Person object because it acts as a hub to many other data sources on the Web. With the VIAF data in hand the other three sources listed above are "crawled" for more information about a given identity. Technically the data is requested by making one or more HTTP requests to each of the data sources' public SPARQL endpoints.

BibCard makes extensive use of the Spira library for RDF-to-object mapping. The result is that after assembling a micrograph of knowledge card data the client can work with simple code objects.


This gem is now in rubygems.

$ gem install bib_card

Alternatively, command line install:

$ git clone
$ cd bibcard
$ bundle install
$ gem build bib_card.gemspec
$ gem install bib_card-<VERSION-NUMBER>.gem


Instantiate a BibCard::Person

Given a Library of Congress Name Authority File or VIAF URI, instantiate a BibCard::Person and inspect the data.

Note: Every call to to BibCard.person() will make many calls to the public SPARQL endpoints for the sources cited above.

require 'bib_card'

lcnaf_uri = ""
person = BibCard.person(lcnaf_uri)["en", "en-US"]) # => "Pablo Picasso"
person.birth_date   # => "1881-10-25"
person.death_date   # => "1973-04-09"

person.dbpedia_resource          # => <BibCard::DBPedia::Resource:70307318111440 @subject:>
person.dbpedia_resource.abstract # => "Pablo Ruiz y Picasso, also known as Pablo Picasso (/pɪˈkɑːsoʊ, -ˈkæsoʊ/; Spanish: [ˈpaβlo piˈkaso]; 25 October 1881 – 8 April 1973), was a Spanish painter..."

person.getty_subject                                                      # => <BibCard::Getty::Subject:70307331508400 @subject:>
person.getty_subject.scope_note                                           # => <BibCard::Getty::ScopeNote:70307331409520 @subject:>
person.getty_subject.scope_note.value                                     # => "Long-lived and very influential Spanish artist, active in France. He dominated 20th-century European art. With Georges Braque, he is credited with inventing Cubism."
person.getty_subject.scope_note.sources                                   # => [<BibCard::Getty::Source:70307327167300 @subject:>, <BibCard::Getty::Source:70307327106100 @subject:>] {|source| source.short_title} # => ["LCNAF Library of Congress Name Authority File  [n.d.]", "Grove Dictionary of Art online (1999-2002)"]

Fetch Raw Data for a BibCard::Person

A BibCard knowledge/info card is generated from many different sources, which is inherently slow. You can also retrieve person data as a serialized string of RDF n-triples. The raw data is available so that it can be cached locally. Once the data is cached you can load a Spira repository and instantiate a BibCard::Person object.

require 'bib_card'

lcnaf_uri = ""
data = BibCard.person_data(lcnaf_uri)
puts data

# <> <> <> .
# <> <> "1973-04-09" .
# <> <> <> .
# ...

#### cache the serialized data ####

Spira.repository =
viaf_uri         = Spira.repository.query(predicate: BibCard::SCHEMA_SAME_AS, object:
person           =

person              # => <BibCard::Person:70307327106900 @subject:>["en", "en-US"]) # => "Pablo Picasso"


Bug reports and pull requests are welcome on GitHub at This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.


The gem is available as open source under the terms of the MIT License.

Open Source Agenda is not affiliated with "Bibcard" Project. README Source: UW-Madison-Library/bibcard
Open Issues
Last Commit
7 months ago

Open Source Agenda Badge

Open Source Agenda Rating