Presentation is loading. Please wait.

Presentation is loading. Please wait.

Practical RDF Chapter 3. The Basic Elements Within the RDF/XML Syntax Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Kim.

Similar presentations


Presentation on theme: "Practical RDF Chapter 3. The Basic Elements Within the RDF/XML Syntax Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Kim."— Presentation transcript:

1 Practical RDF Chapter 3. The Basic Elements Within the RDF/XML Syntax Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Kim

2 Outline  Serializing RDF to XML  RDF Blank Nodes  URI References  Representing Structured Data with rdf:value  The rdf:type Property  RDF/XML Shortcuts  More on RDF Data Types

3 Introduction  Serialization converts an RDF model in a text-based format using XML Serialization RDF model <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> Shelly Powers Text-based format using XML http://burningbird.net/articles/monsters3.htm Shelly Powers http://burningbird.net/postcon/elements/1.0/author

4 Serializing RDF to XML Example (1/5) The article on giant squids, titled “Architeuthis Dux,” at http://burningbird.net/articles/monsters3.htm, written by Shelly Powers, explores the giant’s squid’s mythological representation as the legendary Kraken as well as describing current efforts to capture images of a live specimen. In addition, the article also provides descriptions of a giant squid’s physical characteristics. It is part of a four-part series, described at http://burningbird.net/articles/monsters.htm and entitled “A Tale of Two Monsters.” Identified by http://burningbird.net/articles/monster3.htm Written by Shelley Powers Title Architeuthis Dux Series member http://burningbird.net/articles/monsters.htm Associates Kraken and giant squid Provides Physical description of giant squid Title A tale of Two Monsters Article

5 Serializing RDF to XML Example (2/5)  RDF –Starting small, we’ll take a look at mapping the article and the author and title, only into RDF <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> Shelly Powers Architeuthis Dux pstcn Created prefix for the example Subject http://burningbird.net/articles/monsters3.htm Subject http://burningbird.net/articles/monsters3.htm Predicate – Author Object – Shelly Powers Predicate – Author Object – Shelly Powers Predicate – Title Object – Architeuthis Dux Predicate – Title Object – Architeuthis Dux

6 Serializing RDF to XML Example (3/5)  Expanded version of the example <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> Shelly Powers Architeuthis Dux Physical description of giant squids Tale of the Legendary Kraken A Tale of Two Monsters Series member http://burningbird.net/articles/monsters.htm Title A tale of Two Monsters Article

7 Serializing RDF to XML Example (4/5)  Expanded RDF modified to use nested resources <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> Shelly Powers Architeuthis Dux A Tale of Two Monsters Physical description of giant squids Tale of the Legendary Kraken

8 Serializing RDF to XML Example (5/5)  RDF graph http://burningbird.net/postcon/elements/1.0/author http://burningbird.net/postcon/elements/1.0/title http://burningbird.net /postcon/elements/1.0/series http://burningbird.net/postcon/elements/1.0/contains http://burningbird.net/postcon/elements/1.0/alsoContains http://burningbird.net/postcon /elements/1.0/seriesTitle Tale of the legendary Kraken Shelley Powers Architeuthis Dux Physical description of giant squid <rdfDescription xmins.rdf= “http://www.w3.org /199/02/22-rdf-syntax-ns#... A Tale of Two Monsters http://burningbird.net/ articles/monsters.com

9 Serializing RDF to XML Predicates (1/2)  We can mark the type of property using the rdf:parseType attribute –rdf:parseType=“Literal”  Embed XML within an RDF document <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=http://burningbird.net/postcon/elements/1.0/> Shelly Powers Architeuthis Dux A Tale of Two Monsters Physical description of giant squids Tale of the Legendary Kraken

10 Serializing RDF to XML Predicates (2/2)  We can mark the type of property using the rdf:parseType attribute –rdf:parseType=“Resource”  Identify the element as a resource without having to use rdf:about or rdf:ID <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> With no value provided http://burningbird.net/articles/monsters3.htm Genid:ARP107458 http://burningbird.net/postcon/elements/1.0/author

11 Serializing RDF to XML Namespaces and Qnames (1/2)  The format of namespace  RDF Working Group has allowed some attributes to be non- namespace annotated –ID –bagID –about –resource –parseType –type xmlns:name = “URI of schema” QName XML Local name

12 Serializing RDF to XML Namespaces and Qnames (2/2)  Qnames can be used as values for rdf:about or rdf:type <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:bbd=“http://www.burningbird.net/schema#” YASD Does Mozilla/Navigator 6.0 Demonstrations of using XUL for interface development May 2000 Shelly Powers N/A Inactive N/A None

13 RDF Blank Nodes (1/2)  A blank node represents a resource that isn’t currently identified –rdf:nodeID is used to provide a specific identifier  <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/articles/”> Tale of Two Monsters :Legends Part 1 of four-part series on cryptozoology, legends, Nessie the Loch Ness Monster and the giant squid. 1999-08-01T00:00:00-06:00 Shelley Powers

14 RDF Blank Nodes (2/2)  The RDF Validator has generated a node identifier for the blank node, genid:403 http://burningbird.net/postcon/elements/1.0/title http://burningbird.net/postcon/elements/1.0/description http://burningbird.net /postcon/elements/1.0/bio http://burningbird.net/postcon/elements/1.0/created http://burningbird.net/postcon/elements/1.0/creator Blank node genid:403 Tale of Two Monsters:Legends Part 1 of four-part series on cryptozoology, legends 1999-08-01T00:00:00-05:00 Shelly Powers monsters1.htm

15 URI References Resolving Relative URIs and xml:base  With xml:base, we can specify a base document that’s used to generate full URIs when given relative URI references <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/articles/”> Full URI → http://burningbird.net/articles/monsters3.htm A base document A relative URI reference

16 URI References Resolving References with rdf:ID rdf:about Refer to an existing resource rdf:ID Generate a URI → URI (the enclosing document) + identifier <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=http://burningbird.net/postcon/elements/1.0/> Shelly Powers Architeuthis Dux A Tale of Two Monsters Physical description of giant squids Tale of the Legendary Kraken Enclosing document http://burningbird.net/index.htm http://burningbird.net/index.htm #monsters3.htm http://burningbird.net/index.htm #monsters.htm

17 Representing Structured Data with rdf:value  Some data values have both a value and additional information The last modified date : 18 July 18 Ambiguous! Is it 18 days? Months? Hours? 18 days It should be split ! 18 day There is a disconnect between the value and the unit 18 day rdf:value When dealing with structured data, the rdf:value predicate includes the actual value of the structure RDF

18 The rdf:type Property  rdf:type –Explicitly define the resource type –Is associated at the same level of granularity as the other properties <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> Shelly Powers Architeuthis Dux <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> Shelly Powers Architeuthis Dux Abbreviated syntax

19 RDF/XML Shortcuts  RDF/XML Shortcut is an abbreviated technique –Separate predicates can be enclosed within the same resource block –Nonrepeating properties can be created as resource attributes –Empty resource properties do not have to be formally defined with description block <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> <pstcn:Article pstcn:author = “Shelly Powers” pstcn:title = “Architeuthis Dux” rdf:about=“http://dynamicearth.com/articles/monsters3.htm”> <pstcn:related rdf:resource=“http://burningbird.net/articles/monsters1.htm” pstcn:reason=“First in the series” />

20 More on RDF Data Types  Within RDF/XML, the data type is specified as an attribute of the element, using the rdf:datatype attribute <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:pstcn=“http://burningbird.net/postcon/elements/1.0/”> Shelley Powers Architeuthis Dux


Download ppt "Practical RDF Chapter 3. The Basic Elements Within the RDF/XML Syntax Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Kim."

Similar presentations


Ads by Google