1 / 21

3. RDF and XML

3. RDF and XML. 인공지능 연구실 한기덕. 개요. 1. Basic of RDF 2. Example of RDF 3. How XML Namespaces Work 4. The Abbreviated RDF Syntax 5. RDF Resource Collections 6. Reified Statements. Basic of RDF. The Triples of RDF resource , property , and property value . Literal s

abedi
Download Presentation

3. RDF and XML

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. 3. RDF and XML 인공지능 연구실 한기덕

  2. 개요 • 1. Basic of RDF • 2. Example of RDF • 3. How XML Namespaces Work • 4. The Abbreviated RDF Syntax • 5. RDF Resource Collections • 6. Reified Statements

  3. Basic of RDF • The Triplesof RDF • resource, property, and property value. • Literals • Constants (String values) • A relationship between a resource and a literal is expressed by a statement, which connects a subject with an object via a predicate

  4. Basic of RDF • Ex • The author of this book is Johan Hjelm

  5. Basic of RDF • The difference from traditional predicate logic • The syntax of RDF is declared in the RDF Schema • The RDF Schema • define the set of resource and literal values • creates the structure which you later fill with your description.

  6. Example of RDF • Simple RDF graph: • http://www.wireless-information.net -> Creator -> Johan Hjelm • Creator of http://www.wireless-information.net is Johan Hjelm

  7. Example of RDF • We might also want to make clear that we meant creator in some special, well-defined sense, by using a special element, dc:Creator (as opposed to biblical:Creator, for instance). • Of course, then we would have to declare where the definition of that special element came from.

  8. Example of RDF • <?xml version=“1.0”?> • <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/2-rdf-syntax-ns#” xmlns:dc=“http://purl.org/dc/element/1.1/”> • <rdf:Description about=“http://www.wireless-information.net/”> • <dc:creator rdf:resource=“http://johanhjelm.com/whois/” /> • </rdf:Description> • </rdf:RDF>

  9. Example of RDF • <?xml version=“1.0”> • The XML declaration shows that this is XML, and declares which version it is. • <rdf:RDF xmlns:rdf=“http://www.w3.org..” • The rdf element begins here: It encapsulates the actual statement and is followed by the namespace declaration. It also the RDF namespace (i.e., where to find out what all tags prefixed with rdf: mean)

  10. Example of RDF • Xmlns:dc=“ http://purl.org/dc/elements...” • The second namespace declaration declares the Dublin Core namespace, here prefixed with dc: . Both namespace declarations are attributes on the rdf element. • <rdf:Description about=“ http://www.wireless...” > • The rdf:Description elements declares which resource the statement is about.

  11. Example of RDF • <dc:creator rdf:resource=“ http://johanhjelm.com/..” /> • The dc:Creator element contains the value of the dc:Creator property. • There can be more properties for the same resource.

  12. How XML Namespaces Work • XML namespaces • identify a set of element names by using prefixes in the RDF code • declaring the namespace in the head of the document. • Namespaces • declared using a family of reserved attributes • Such an attribute’s name must either be xmlns or have xmlns: as a prefix (these two are reserved, but you can use any other prefix for your namespaces).

  13. The Abbreviated RDF Syntax • <rdf:description> about=“ http://www.wireless-..” > <dc:creator>johanhjelm.com</dc:creator></rdf:description> • And the abbreviated syntax looks like this: • <description about=“ http://www.wireless-..” dc:creator=“ johanhjelm.com” />

  14. RDF Resource Collections • Bag • Unordered list of resource (URIs) or atomic values (literals, i.e., strings). • Used to declare that a property has multiple values • The order of the values does not matter • There can be duplicates of resources and duplicate values in literals.

  15. RDF Resource Collections • Sequence • Ordered list of resources or atomic values (literals) • The order is significant • Possible to have duplicates of the same value • Used to declare that a property has multiple values.

  16. RDF Resource Collections • Alternative • List of resources or values that represent possible alternatives for the (single) value of a property • Choose any one of the items in the list

  17. Reified Statements • There is a mechanism in RDF to make statements about statements (“he said that she said”). In philosophy, this is called a reified statement.

  18. Reified Statements • <RDF> xmlns=“ http://www.w3.org/1999/...” xmlns:rdf=“ http://www.w3.org/1999/...” xmlns:dc=“ http://purl.org/metadata/dc..” xmlns:l=“ http://mycorp.com/schemas..” <Description about=“ http://www.Webnuts.net/Jan97.html”> <dcsubject rdf:value=“020—Library Science” l:Classification=“Dewey Decimal Code”/> </Description></RDF> • The page Jan97.html in the site www.Webnut.net has a Dublin Core Subject that is Library Science, 020 according to the Dewey Decimal Code

  19. Reified Statements • The different namespaces make the elements unique, using the namespace mechanism. • Each set of elements (the vocabulary) has to be described by a schema, which contains more information than what is available in the DTD. • The RDF Schema language describes the parameters of the elements

  20. Reified Statements • To further illustrate how to use aggregates, consider an example of a document with two authors specified alphabetically, a title specified in two different languages, and having two equivalent locations on the Web: • <rdf:RDF xmlns:rdf=“ http://www.w3.org..” xmlns:dc=“ http://purl.org../dc..” <rdf:Description about=“ http://www.foo.com/cool.html”> <dc:Creator> <rdf:Seq ID=“ CreatorsAhphabeticalBySurname”> <rdf:li>Mary Andrew</rdf:li> <rdf:li>Jacky Crystal</rdf:li> </rdf:Seq> </dc:Creator>

  21. Reified Statements • <dc:Identifier> <rdf:Bag ID=“MirroredSites”> <rdf:li rdf:resource=“ http://www.foo.com.au/cool.html”/> <rdf:li rdf:resource=“ http://www.foo.com.it/cool.html”/> </rdf:bag> </dc:Identifier> <dc:Title> <rdf:Alt> <rdf:li xml:lang=“en”>The Coolest Web Page</rdf:li> <rdf:li xml:lang=“it”>I1 Pagio di Web Fuba</rdf:li> </rdf:Alt> </dc:Title> </rdf:Description></rdf:RDF>

More Related