The Semantic Web #5 - RDF (2)


Published on

This is a lecture note #5 for my class of Graduate School of Yonsei University, Korea.
It describes Resource Description Framework (RDF).

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

The Semantic Web #5 - RDF (2)

  1. 1. Linked Data & Semantic Web Technology The Semantic WebPart 5. Resource Description Framework (2) Dr. Myungjin Lee
  2. 2. Typed Node • Typed Node – the resources described as instances of specific types or classes – being classified into different kinds or categories – by providing a predefined property, rdf:type 1. <rdf:Description rdf:ID="item10245"> 2. <rdf:type rdf:resource=""/> 3. </rdf:Description> rdf:type an instance of that a resource that represents a category or class category or class of things 2Linked Data & Semantic Web Technology
  3. 3. Abbreviation for Describing Typed Nodes • How to describe abbreviation for typed nodes – the rdf:type property and its value are removed – the rdf:Description element is replaced by an element whose name is the QName corresponding to the value of the removed rdf:type property 1. <rdf:Description rdf:ID="item10245"> 2. <rdf:type rdf:resource=""/> 3. </rdf:Description> replaced 1. <exterms:Tent rdf:ID="item10245" /> rdf:type 3Linked Data & Semantic Web Technology
  4. 4. How to Describe Groups • a need to describe groups of things – such as, • a book was created by several authors • to list the students in a course • Vocabularies for groups – RDF Containers • groups containing the members • open list – RDF Collections • groups containing only the specified members • closed list 4Linked Data & Semantic Web Technology
  5. 5. RDF Containers • RDF Containers – to describe groups containing the members • Terms – Container • a resource that contains things – Member • the contained things • resources (including blank nodes) or literals • Three types of RDf Containers – rdf:Bag – rdf:Seq – rdf:Alt 5Linked Data & Semantic Web Technology
  6. 6. RDF Containers • Bag – a resource having type rdf:Bag – a group of resources or literals, possibly including duplicate members – no significance in the order of the members • Sequence – a resource having type rdf:Seq – a group of resources or literals, possibly including duplicate members – the order of the members is significant • Alternative – a resource having type rdf:Alt – a group of resources or literals that are alternatives (typically for a single value of a property) 6Linked Data & Semantic Web Technology
  7. 7. How to Describe a Resource of Containers • to give an rdf:type property whose value is one of the predefined resources rdf:Bag, rdf:Seq, or rdf:Alt • to describe each member (item) with the container resource: – in RDF Graph • using a container membership property rdf:_n, where n is a decimal integer greater than one – in RDF/XML • using the rdf:li property 7Linked Data & Semantic Web Technology
  8. 8. Bag Container Description “Course 6.001 has the students Amy, Mohamed, Johann, Maria, and Phuong” <?xml version="1.0"?> <rdf:RDF xmlns:rdf="" xmlns:s=""> <rdf:Description rdf:about=""> <s:students> <rdf:Bag> <rdf:li rdf:resource=""/> <rdf:li rdf:resource=""/> <rdf:li rdf:resource=""/> <rdf:li rdf:resource=""/> <rdf:li rdf:resource=""/> </rdf:Bag> </s:students> </rdf:Description> </rdf:RDF> 8Linked Data & Semantic Web Technology
  9. 9. Alt Container Description “The source code for X11 may be found at,, or” <?xml version="1.0"?> <rdf:RDF xmlns:rdf="" xmlns:s=""> <rdf:Description rdf:about=""> <s:DistributionSite> <rdf:Alt> <rdf:li rdf:resource=""/> <rdf:li rdf:resource=""/> <rdf:li rdf:resource=""/> </rdf:Alt> </s:DistributionSite> </rdf:Description> </rdf:RDF> 9Linked Data & Semantic Web Technology
  10. 10. Seq Container Description “Schedules of Monday” <?xml version="1.0"?> <rdf:RDF xmlns:rdf="" xmlns:s=""> <rdf:Description rdf:about=""> <s:activities> <rdf:Seq> <rdf:li>Meet with CEO at 10am</rdf:li> <rdf:li>Luncheon at The Eatery</rdf:li> <rdf:li>Flight at 3pm</rdf:li> </rdf:Seq> </s:activities> </rdf:Description> </rdf:RDF> 10Linked Data & Semantic Web Technology
  11. 11. RDF Collections • A limitation of the containers – no way to close resources • such as, "these are all the members of the container“ – no way to exclude the possibility that there is another graph somewhere that describes additional members • RDF Collections – for describing groups containing only the specified members – a group of things represented as a list structure in the RDF graph 11Linked Data & Semantic Web Technology
  12. 12. How to Describe a RDF Collection • to be constructed using a predefined collection vocabulary – the predefined type rdf:List – the predefined properties rdf:first and rdf:rest – and the predefined resource rdf:nil "The students in course 6.001 are Amy, Mohamed, and Johann" 12Linked Data & Semantic Web Technology
  13. 13. How to Describe RDF/XML for a Collection • rdf:parseType attribute – to indicate that the contents of an element are to be interpreted in a special way • rdf:parseType="Collection" attribute – a group of nested elements representing the members of the collection <?xml version="1.0"?> <rdf:RDF xmlns:rdf="" xmlns:s=""> <rdf:Description rdf:about=""> <s:students rdf:parseType="Collection"> <rdf:Description rdf:about=""/> <rdf:Description rdf:about=""/> <rdf:Description rdf:about=""/> </s:students> </rdf:Description> </rdf:RDF> 13Linked Data & Semantic Web Technology
  14. 14. RDF Reification • What is RDF Reifications? – to describe other RDF statements using RDF – such as, • to record information about when statements were made, who made them, or other similar information Obama says Northern Ireland requires urgent work. 14Linked Data & Semantic Web Technology
  15. 15. Reification Quad • description of a statement, reification – the type rdf:Statement – the properties rdf:subject, rdf:predicate, and rdf:object “Obama says Northern Ireland requires urgent work.” ex:triple12345 rdf:type rdf:Statement . ex:triple12345 rdf:subject ex:NorthernIreland . ex:triple12345 rdf:predicate ex:require . ex:triple12345 rdf:object ex:UrgentWork . 15Linked Data & Semantic Web Technology
  16. 16. RDF/XML for RDF Reification • “Obama says Northern Ireland requires urgent work.” <?xml version="1.0"?> <rdf:RDF xmlns:rdf="" xmlns:ex=""> <rdf:Description rdf:about=""> <ex:say> <rdf:Statement> <rdf:subject rdf:resource=""/> <rdf:predicate rdf:resource=""/> <rdf:object rdf:resource=""/> </rdf:Statement> </ex:say> </rdf:Description> </rdf:RDF> 16Linked Data & Semantic Web Technology
  17. 17. Notes for RDF Reification • Why we need RDF Reification? – Modeling Data Provenance – Formalizing Statements about Reliability (Trust) – Definition of Metadata about Statements • the conventional use of reification – do not imagine that the vocabulary defines some things that are not actually defined 17Linked Data & Semantic Web Technology
  18. 18. Structured Values This is the decimal value of weight property using typed literal. exproduct:item10245 exterms:weight "2.4"^^xsd:decimal . • rdf:value Property – to describe the main value (if there is one) of a structured value • How to add an indication of the unit of measure (kilograms) exproduct:item10245 exterms:weight _:weight10245 . _:weight10245 rdf:value "2.4"^^xsd:decimal . _:weight10245 exterms:units exunits:kilograms . 18Linked Data & Semantic Web Technology
  19. 19. RDF/XML for Structured Value exproduct:item10245 exterms:weight _:weight10245 . _:weight10245 rdf:value "2.4"^^xsd:decimal . _:weight10245 exterms:units exunits:kilograms . <?xml version="1.0"?> <!DOCTYPE rdf:RDF [<!ENTITY xsd "">]> <rdf:RDF xmlns:rdf="" xmlns:exterms=""> <rdf:Description rdf:about=""> <exterms:weight rdf:parseType="Resource"> <rdf:value rdf:datatype="&xsd;decimal">2.4</rdf:value> <exterms:units rdf:resource=""/> </exterms:weight> </rdf:Description> </rdf:RDF> • rdf:parseType=“Resource” attribute – to indicate that the contents of an element are to be interpreted as the description of a new (blank node) resource, without a nested rdf:Description element 19Linked Data & Semantic Web Technology
  20. 20. XML Literal • rdf:parseType=“Literal” attribute – to indicate that the contents of the element are to be interpreted as an XML fragment <?xml version="1.0"?> <rdf:RDF xmlns:rdf="" xmlns:dc="" xml:base=""> <rdf:Description rdf:ID="book12345"> <dc:title rdf:parseType="Literal"> <span xml:lang="en"> The <em>&lt;br /&gt;</em> Element Considered Harmful. </span> </dc:title> </rdf:Description> </rdf:RDF> 20Linked Data & Semantic Web Technology
  21. 21. RDF Serialization • N-Triples – RDF Test Cases, W3C Recommendation, 10 February 2004 – a line-based, plain text serialization format for storing and transmitting RDF data • Notation 3 (N3) – a shorthand non-XML serialization of RDF models, designed with human- readability in mind – much more compact and readable than XML RDF notation • Turtle (Terse RDF Triple Language) – W3C Candidate Recommendation, 19 February 2013 – a format for expressing data in the Resource Description Framework (RDF) data model – a subset of Notation3 (N3) language, and a superset of the minimal N-Triples format • RDF/XML – W3C Recommendation, 10 February 2004 – an XML syntax for writing down and exchanging RDF graphs 21Linked Data & Semantic Web Technology
  22. 22. N-Triple <> <> "Tony Benn" . <> <> "Wikipedia" . N3 @prefix dc: <>. <> dc:title "Tony Benn"; dc:publisher "Wikipedia". RDF/XML <rdf:RDF xmlns:rdf="" xmlns:dc=""> <rdf:Description rdf:about=""> <dc:title>Tony Benn</dc:title> <dc:publisher>Wikipedia</dc:publisher> </rdf:Description> </rdf:RDF> Turtle @prefix rdf: <> . @prefix dc: <> . @prefix ex: <> . <> dc:title "RDF/XML Syntax Specification (Revised)" ; ex:editor [ ex:fullname "Dave Beckett", "Dave R. Beckett"; ex:homePage <> ] . 22Linked Data & Semantic Web Technology
  23. 23. References • • • • • • • 23Linked Data & Semantic Web Technology
  24. 24. Dr. Myungjin Lee e-Mail : Twitter : Facebook : SlideShare : 24 24Linked Data & Semantic Web Technology