Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to Create an RDF record for a book using N-Triples

How to Create an RDF record for a book using N-Triples

Linked Data Workshop given at Boston College Library on May 18, 2016 by Emily Singley

Covers:
Introduction to RDF data model
Introduction to N-Triples
Hands-on tutorial to create a book record in N-Triples

Emily Singley

May 17, 2016
Tweet

More Decks by Emily Singley

Other Decks in Education

Transcript

  1. How to create an RDF record for a book using

    N-Triples Emily Singley Boston College Library May, 2016
  2. more statements: Emily (subject) – lives in (predicate) – Massachusetts

    (object) Massachusetts (subject) – is in (predicate) – New England (object) Emily (subject) – works at (predicate) – Boston College (object) Boston College (subject) – is in (predicate) – Massachusetts (object) Bob (subject) – works at (predicate) – Boston College (object)
  3. Name Address Employer Emily MA Boston College Bob MA Boston

    College NOT the traditional relational database model:
  4. RDF can be serialized in different ways…  RDF/XML 

    JSON-LD  Turtle  N-Triples  etc
  5. Let’s break it down…. 1. Start with Subject : <http://www.w3.org/2001/sw/RDFCore/ntriples/>

    Rule:  Subjects can be either URI’s or “blank nodes”  URIs are bracketed by <>
  6. 3. Add a space, then Object: <http://www.w3.org/2001/sw/RDFCore/ntriples/> <http://purl.org/dc/terms/title> "N-Triples" .

    Rule:  Objects can be either URIs or literals  Literals are enclosed in “ “  Statement ends with a space followed by a .
  7. Summary of rules for N-Triples:  One statement per line

     Statement consists of subject, predicate, object separated by spaces  Statement ends with a space and period  URIs bracketed by <>  Blank nodes expressed as _:  Literals enclosed in “ “  Subjects can be URIs or blank nodes  Predicates have to be URIs  Objects can be URIs, blank nodes, or literals
  8. Let’s create an RDF record for a book using N-Triples:

    The Story of King Arthur and His Knights by Howard Pyle
  9. Let’s create the following statement about this book: The book

    has a title “The Story of King Arthur and his Knights”
  10. Let’s create more statements about this book: The book has

    a title “The Story of King Arthur and his Knights” The book has an author Howard Pyle The book has an illustrator Howard Pyle The book was published in 1965 The book is published by Dover Publications Dover Publications is in New York City The book has the format of a print book The book has 312 pages The book is in English The book has a subject of King Arthur
  11. Completed N-Triples record: <http://www.worldcat.org/oclc/1004592> <http://purl.org/dc/elements/1.1/title> “The Story of King Arthur

    and his Knights” . <http://www.worldcat.org/oclc/1004592> <https://schema.org/author> <http://viaf.org/viaf/12428253> . <http://www.worldcat.org/oclc/1004592> <https://schema.org/illustrator> <http://viaf.org/viaf/12428253> . <http://www.worldcat.org/oclc/1004592> <http://schema.org/datePublished> "1965" . <http://www.worldcat.org/oclc/1004592> <http://purl.org/dc/elements/1.1/publisher> <http://dbpedia.org/page/Dover_Publications> . <http://dbpedia.org/page/Dover_Publications> <http://purl.org/dc/terms/Location> <http://dbpedia.org/resource/New_York_City> . <http://www.worldcat.org/oclc/1004592> <http://schema.org/bookFormat> <http://bibliograph.net/PrintBook> . <http://www.worldcat.org/oclc/1004592> <https://schema.org/numberOfPages> “312” . <http://www.worldcat.org/oclc/1004592> <http://purl.org/dc/elements/1.1/language> "en" . <http://www.worldcat.org/oclc/1004592> <http://purl.org/dc/elements/1.1/subject> <http://id.loc.gov/authorities/childrensSubjects/sj96006035> .