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

E462bb245db1502ffa3015e847cda35e?s=128

Emily Singley

May 17, 2016
Tweet

Transcript

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

    N-Triples Emily Singley Boston College Library May, 2016
  2. Resource Description Framework

  3. RDF Statement = “Triple” Subject Predicate Object

  4. RDF Statement = “Triple” Emily lives in Massachusetts (Subject) (Object)

    (Predicate)
  5. 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)
  6. RDF Statements make up a Graph Bob New England Emily

    MA Boston College
  7. Name Address Employer Emily MA Boston College Bob MA Boston

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

    JSON-LD  Turtle  N-Triples  etc
  9. Let’s create an RDF statement using N-Triples…

  10. Here is an RDF statement: N-Triples website has title “N-Triples”

    (Subject) (Object) (Predicate)
  11. Here is the statement expressed using N-Triples: <http://www.w3.org/2001/sw/RDFCore/ntriples/> <http://purl.org/dc/terms/title> "N-Triples"

    .
  12. 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 <>
  13. 2. Add a space, then Predicate: <http://www.w3.org/2001/sw/RDFCore/ntriples/> <http://purl.org/dc/terms/title> Rule: 

    Predicates must be URIs
  14. 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 .
  15. Here is the complete statement again: <http://www.w3.org/2001/sw/RDFCore/ntriples/> <http://purl.org/dc/terms/title> "N-Triples" .

  16. 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
  17. _:bob <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . Example with a blank node: “Bob

    is a person”
  18. Let’s create an RDF record for a book using N-Triples:

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

    has a title “The Story of King Arthur and his Knights”
  20. Sources for URIs: http://www.worldcat.org/ http://purl.org/dc/elements/1.1/ http://id.loc.gov/ https://viaf.org/ https://schema.org/Book http://bibliograph.net/ http://dbpedia.org/

  21. Here is our statement in N-Triples: <http://www.worldcat.org/oclc/1004592> <http://purl.org/dc/terms/title> “The Story

    of King Arthur and His Knights” . Now it’s your turn.....
  22. 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
  23. 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> .
  24. The End