1 / 23

Practical RDF Chapter 4. Specialized RDF Relationships: Reification, Containers, and Collections

Practical RDF Chapter 4. Specialized RDF Relationships: Reification, Containers, and Collections. Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Lim. Outline. Containers Collections Reification. Containers. RDF Containers

haracha
Download Presentation

Practical RDF Chapter 4. Specialized RDF Relationships: Reification, Containers, and Collections

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Practical RDFChapter 4. Specialized RDF Relationships:Reification, Containers, and Collections Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Lim

  2. Outline • Containers • Collections • Reification

  3. Containers • RDF Containers • Specifically for handling multiple resources, or for handling multiple literals (properties) • If you want to refer to the collection of items as a singular unit, you would use the Container • E.g., A book created by several authors, a list of students in a course • RDF Container vocabulary • Bags • Sequences • Alternative and some associated properties

  4. ContainersBag • rdf:Bag • Contains unordered lists of resources or literals • Duplicate data allowed • E.g., inventory of photographs <?xml version=“1.0” ?> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:pstcn=http://burningbird.net/postcon/elements/1.0/> <rdf:Description rdf:about=http://burningbird.net/earthstars/contest.htm> <pstcn:photos> <rdf:Bag> <rdf:li rdf:resource=“http://burningbird.net/earthstars/capo.jpg” /> <rdf:li rdf:resource=“http://burningbird.net/earthstars/baritea.jpg” /> <rdf:li rdf:resource=“http://burningbird.net/earthstars/cfluorite.jpg” /> <rdf:li rdf:resource=“http://burningbird.net/earthstars/ccinnibar.jpg” /> <rdf:li rdf:resource=“http://burningbird.net/earthstars/baryto.jpg” /> <rdf:li rdf:resource=“http://burningbird.net/earthstars/cbarite2a.jpg” /> </rdf:Bag> </pstcn:photos> </rdf:Description> </rdf:RDF> If the container contained literals instead of resources as items: <rdf:li>Barite Photo</rdf:li>

  5. ContainersSequence • rdf:Seq • Contains ordered list of resources or literals • Ordering of the elements is indicated by the ordering of the rdf:_n • Duplicate resources or literals are allowed • E.g., web pages within a menu on the main web page <?xml version=“1.0” ?> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:pstcn=http://burningbird.net/postcon/elements/1.0/> <rdf:Descriptionrdf:about=http://burningbird.net/earthstars/contest.htm> <pstcn:menu> <rdf:Seq> <rdf:lirdf:resource=“http://burningbird.net/articles.htm” /> <rdf:lirdf:resource=“http://burningbird.net/dynatech.htm” /> <rdf:lirdf:resource=“http://burningbird.net/interact.htm” /> </rdf:Seq> </pstcn:menu> </rdf:Description> </rdf:RDF>

  6. ContainersAlternative • rdf:Alt • Provides alternatives for a specific value • Must be at least one item to act as the default value for the resource • The first item being the default if no other is specified • Other than rdf:_1, the order of the remaining elements is not significant. • The user can select only one of the values <?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd#"><rdf:Description rdf:about="http://www.recshop.fake/cd/Beatles"> <cd:format><rdf:Alt> <rdf:li>CD</rdf:li> <rdf:li>Record</rdf:li> <rdf:li>Tape</rdf:li> </rdf:Alt> </cd:format></rdf:Description></rdf:RDF>

  7. ContainersContainers as Typed Nodes • Can also specify the numbered elements directly or mix elements <?xml version=“1.0” ?> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:pstcn=http://burningbird.net/postcon/elements/1.0/> <rdf:Descriptionrdf:about=http://burningbird.net/earthstars/contest.htm> <pstcn:menu> <rdf:Seq> <rdf:_1 rdf:resource=“http://burningbird.net/articles.htm” /> <rdf:lirdf:resource=“http://burningbird.net/dynatech.htm” /> <rdf:lirdf:resource=“http://burningbird.net/interact.htm” /> </rdf:Seq> </pstcn:menu> </rdf:Description> </rdf:RDF>

  8. ContainersContainers Today • rdf:li • used and still documented within the RDF specifications • The numbered properties rdf:_1, rdf:_2, etc. are generated from the lielements in forming the corresponding graph • Its use is discouraged within RDF/XML documents <?xml version=“1.0” ?> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:pstcn=http://burningbird.net/postcon/elements/1.0/> <rdf:Descriptionrdf:about=http://burningbird.net/earthstars/contest.htm> <pstcn:menu> <rdf:Seq> <rdf:_1rdf:resource=“http://burningbird.net/articles.htm” /> <rdf:_2rdf:resource=“http://burningbird.net/dynatech.htm” /> <rdf:_3rdf:resource=“http://burningbird.net/interact.htm” /> </rdf:Seq> </pstcn:menu> </rdf:Description> </rdf:RDF>  Valid use of containers

  9. Outline • Containers • Collections • Reification

  10. Collections (1/2) • rdf:parseType=“Collection” • A finite grouping of items, with a given terminator • A collection is a list (rdf:List) • Each node on the list has an associated predicate of type (List) as well as the first value in the list, given by the predicate rdf:first • A relationship between the nodes with rdf:rest • Terminated with a node, whose value is rdf:nil <?xml version=“1.0” ?> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:pstcn=http://burningbird.net/postcon/elements/1.0/> <rdf:Descriptionrdf:about=http://burningbird.net/earthstars/contest.htm> <pstcn:menurdf:parseType=“Collection”> <rdf:Descriptionrdf:resource=“http://burningbird.net/articles.htm” /> <rdf:Descriptionrdf:resource=“http://burningbird.net/dynatech.htm” /> <rdf:Descriptionrdf:resource=“http://burningbird.net/interact.htm” /> </pstcn:menu> </rdf:Description> </rdf:RDF>

  11. Collections (2/2) http://dynamicearth.com/earthstars/contest.htm pstcn:menu http://www.w3.org/1999/02/22-rdf-syntax-ns#List rdf:type rdf:first http://burningbird.net/articles.htm rdf:rest http://www.w3.org/1999/02/22-rdf-syntax-ns#List rdf:type rdf:first http://burningbird.net/dynatech.htm rdf:rest http://www.w3.org/1999/02/22-rdf-syntax-ns#List rdf:type rdf:first http://burningbird.net/interact.htm rdf:rest http://www.w3.org/1999/02/22-rdf-syntax#nil

  12. Outline • Containers • Collections • Reification

  13. Reification • Reification • A statement is modeled as a resource referenced by another statement “Jonathon says those cherries are sweet.” “Jonathon says…,” + “Those cherries are sweet.” Jonathon says are Those cherries sweet

  14. ReificationReified Statements (1/3) • The bases of reification in RDF • Model the original statement so that it can be referenced as the subject of the newer statement To. Alice I recommend you an useful link. http://www.webreference.com/dhtml/hiermenus is a source containing tutorials and source code about creating hierarchical menus in DHTML. …… <rdf:Descriptionrdf:about="http://www.webreference.com/dhtml/hiermenus/"> <pstcn:Contains>Tutorials and source code about creating hierarchical menus in DHTML</pstcn:Contains> </rdf:Description>  It is missing one thing: an assertion about who is making the recommendation

  15. ReificationReified Statements (2/3) • An example <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:pstcn="http://burningbird.net/postcon/elements/1.0/" xml:base="http://burningbird.net/"> <rdf:Descriptionrdf:about="#s1"> <rdf:subjectrdf:resource="http://www.webreference.com/dhtml/hiermenus" /> <rdf:predicaterdf:resource="http://burningbird.net/schema/Contains" /> <rdf:object>Tutorials and source code about creating hierarchical menus in DHTML</rdf:object> <rdf:typerdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" /> </rdf:Description> <rdf:Descriptionrdf:about="http://burningbird.net/person/001"> <pstcn:recommendsrdf:resource="#s1" /> </rdf:Description> </rdf:RDF>

  16. ReificationReified Statements (3/3) • Subject: contains the identifier for the resource referenced within the statement • Predicate: contains the property that forms the original context of the resource (the property) • Object: contains the value of the property that forms the original context of the resource (the value) • Type: contains the type of the resource http://www.w3.org/1999/ 02/22-rdf-syntax-ns#subject http://www.webreference.com/dhtml/heirmenus http://www.w3.org/1999/ 02/22-rdf-syntax-ns#predicate http://burningbird.net/ schema/Contains http://burningbird.net/postcon/ elements/1.0/recommends http://burningbird.net/#s1 http://burningbird.net/person/001 • Tutorials and source code about creating hierarchical menus in DHTML http://www.w3.org/1999/ 02/22-rdf-syntax-ns#object http://www.w3.org/1999/02/22-rdf-syntax-ns#List http://www.w3.org/1999/ 02/22-rdf-syntax-ns#type

  17. ReificationThe Necessity of Reification and Metastatements(1/2) • Why is reification necessary? • One could model the example in serialized RDF syntax and not lose the information about who recommends the resource  “Shelley Powers recommends…,” is not the actual web resource  Web resource is actually an ancillary component of the recommendation <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:pstcn="http://burningbird.net/postcon/elements/1.0/"> <rdf:Descriptionrdf:about="http://www.webreference.com/dhtml/hiermenus/"> <pstcn:Contains>Tuturials and source code about creating hierarchichal menus in DHTML</pstcn:Contains> <pstcn:recommendedBy>Shelley Powers</pstcn:recommendedBy> </rdf:Description> </rdf:RDF>

  18. ReificationThe Necessity of Reification and Metastatements(2/2) • By being able to model the statement about the web resource • you can treat it as a property of another statement • You can be able to distinguish without confusion and without ambiguity what “fact” you’re describing in an RDF statement • The importance of the distinction between the thing describedand the object making the description is both the key and the confusion of reification recommend The object making the description The thing described

  19. ReificationA Shorthand Reification Syntax (1/5) • A shorthand technique is particularly helpful in circumstances other than just wanting a cleaner syntax <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:pstcn="http://burningbird.net/postcon/elements/1.0/"> <!--The statement--> <rdf:Descriptionrdf:about="http://www.webreference.com/dhtml/hiermenus"> <pstcn:Containsrdf:ID='s1'> Tutorials and source code about creating hierarchical menus in DHTML</pstcn:Contains> </rdf:Description> <!--The statement about the statement--> <rdf:Descriptionrdf:about="http://burningbird.net/person/001"> <pstcn:recommendedByrdf:resource="#s1" /> </rdf:Description> </rdf:RDF>

  20. ReificationA Shorthand Reification Syntax (2/5) • Recommend what – the web site or the author? • Shelley Power recommends http://www.webreference.com/dhtml/ahiermenus, as a source of tutorials and source code for hierarchical menus created in DHTML • Shelley Power recommends http://www.webreference.com/dhtml/ahiermenus, which is written by Peter Belesis Shelley Power recommends http://www.webreference.com/dhtml/ahiermenus, written by Peter Belesis, as a source of tutorials and source code for hierarchical menus created in DHTML

  21. ReificationA Shorthand Reification Syntax (3/5) <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:pstcn="http://burningbird.net/postcon/elements/1.0/"> <rdf:Description> <rdf:subjectrdf:resource="http://www.webreference.com/dhtml/hiermenus" /> <rdf:predicaterdf:resource="http://burningbird.net/schema/Contains" /> <rdf:object>Tutorials and source code about creating hierarchical menus in DHTML</rdf:object> <rdf:predicaterdf:resource="http://burningbird.net/schema/WrittenBy" /> <rdf:object>Peter Belesis</rdf:object> <rdf:typerdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" /> <pstcn:recommendedBy>Shelley Powers</pstcn:recommendedBy> </rdf:Description> </rdf:RDF> <rdf:Descriptionrdf:about=“http://www.webreference.com/dhtml/hiermenus/”> <pstcn:Contains>Tutorials and source code about creating hierarchical menus in DHTML</pstcn:Contains> <pstcn:writtenBy>Peter Belesis</pstcn:writtenBy> </rdf:Description>

  22. ReificationA Shorthand Reification Syntax (4/5) • An rdf:Bag acts as a container for all statements about a specific resource • rdf:bagID is used to identify the implicit Bag <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:pstcn="http://burningbird.net/postcon/elements/1.0/"> <rdf:Descriptionrdf:about="http://www.webreference.com/dhtml/hiermenus" rdf:bagID="R01"> <pstcn:contains> Tutorials and source code about creating hierarchical menus in DHTML</pstcn:contains> <pstcn:author>Peter Belesis</pstcn:author> </rdf:Description> <rdf:Descriptionrdf:about="http://burningbird.net/person/001"> <pstcn:recommendedsrdf:resource="#R01" /> </rdf:Description> </rdf:RDF>

  23. ReificationA Shorthand Reification Syntax (5/5) http://www.w3.org/1999/ 02/22-rdf-syntax-ns#type http://www.w3.org/1999/02/22-rdf-syntzx-ns#Bag http://www.w3.org/1999/ 02/22-rdf-syntax-ns#predicate http://www.burningbird.net/postcon/elements/1.0/author http://www.w3.org/1999/ 02/22-rdf-syntax-ns#object • Peter Belesis http://burningbird.net/postcon/ elements/1.0/recommends http://www.w3.org/1999/ 02/22-rdf-syntax-ns#_2 http://unknown.org/#R01 http://burningbird.net/person/001 http://burningbird.net/postcon/elements/1.0/contains • Tutorials and source code about creating hierarchical menus in DHTML • genid:ARP10834 http://www.w3.org/1999/ 02/22-rdf-syntax-ns#subject http://www.webreference.com/dhtml/heirmenus http://www.w3.org/1999/ 02/22-rdf-syntax-ns#type http://burningbird.net/postcon/elements/1.0/author • Peter Belesis http://www.w3.org/1999/ 02/22-rdf-syntax-ns#subject http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement http://www.w3.org/1999/ 02/22-rdf-syntax-ns#type • genid:ARP10833 http://www.w3.org/1999/ 02/22-rdf-syntax-ns#_1 http://burningbird.net/postcon/elements/1.0/contains http://www.w3.org/1999/ 02/22-rdf-syntax-ns#predicate http://www.w3.org/1999/ 02/22-rdf-syntax-ns#object • Tutorials and source code about creating hierarchical menus in DHTML

More Related