In this codelab, you're going to link your catalogue record to other descriptions on the web. You will use the schema.org vocabulary and express it via RDFa attributes.
Audience: Beginner
Prerequisites: To
complete this codelab, you will need a basic familiarity with HTML. The
exercises can be found in codelab.zip,
with the solutions found in the rdfa_exercises
subdirectory. There are
frequent checkpoints through the code lab, so if you get stuck at any point,
you can use the checkpoint file to resume and work through this codelab
at your own pace.
Continue working with the HTML file that you have been editing so far, or for a fresh start, copy ../1_book/step4/check_f.html into a new file.
We have already seen that entities such as authors and subject headings often have other representations on the web to which we can connect our own
OCLC recently announced that it had published 197 million open bibliographic work descriptions.
exampleOfWork
has been proposed as a
schema.org extension, but has not yet been accepted.
sameAs
property
to link your book to the OCLC Work Description.
<!DOCTYPE html>
...
<body vocab="http://schema.org/" typeof="Book" resource="#book">
<link property="sameAs" href="http://worldcat.org/entity/work/id/291035169">
...
Freebase is a source of linked open data that uses its own schema to represent entities, including books to which specific editions are attached in a quasi-FRBR fashion.
m/01069fkb
) and appending it to
https://www.googleapis.com/freebase/v1/rdf/
.
sameAs
property
to link your book to the Freebase edition.
<!DOCTYPE html>
...
<body vocab="http://schema.org/" typeof="Book" resource="#book">
<link property="sameAs" href="http://worldcat.org/entity/work/id/291035169">
<link property="sameAs" href="https://www.googleapis.com/freebase/v1/rdf/m/01069fkb">
...
OpenLibrary, effectively a wiki page for every book, offers RDF data for all of the books and authors in its collection, and offers over 1,000,000 free ebook titles in its classic collection.
https://openlibrary.org/books/OL12811177M/Data
.
Following the documentation for the OpenLibrary Restful
API, use a sameAs
property
to link your book to the machine-readable OpenLibrary URL of
https://openlibrary.org/books/OL12811177M
.
<!DOCTYPE html>
...
<body vocab="http://schema.org/" typeof="Book" resource="#book">
<link property="sameAs" href="http://worldcat.org/entity/work/id/291035169">
<link property="sameAs" href="https://www.googleapis.com/freebase/v1/rdf/m/01069fkb">
<link property="sameAs" href="https://openlibrary.org/books/OL12811177M">
...
You can also link to the publisher's description. Even though the publisher might not offer any linked data themselves, it might serve as a useful identifier for the machines.
Once again, you can use the sameAs
property to link your book to the publisher's description.
<!DOCTYPE html>
...
<body vocab="http://schema.org/" typeof="Book" resource="#book">
<link property="sameAs" href="http://worldcat.org/entity/work/id/291035169">
<link property="sameAs" href="https://www.googleapis.com/freebase/v1/rdf/m/01069fkb">
<link property="sameAs" href="https://openlibrary.org/books/OL12811177M">
<link property="sameAs" href="http://www.springer.com/statistics/book/978-1-4612-9563-1">
...
Checkpoint: Your original HTML page should now look like ../1_book/step4/check_g.html.
In this exercise, you learned how to link your bibliographic description to the bibliographic descriptions available from Freebase, OCLC, and publishers, as a means of giving machines more entry points into linked open data.
Next codelab: Library holdings
Dan Scott is a systems librarian at Laurentian University.
This work
is licensed under a Creative
Commons Attribution-ShareAlike 4.0 International License.