Top Banner
Understanding RDF
30

Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

Dec 13, 2015

Download

Documents

Hector Bruce
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

Understanding RDF

Page 2: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

2/30

What is RDF?

• Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource is an electronic file on the Web accessed via a URL.

• RDF is to create meta data about the document as a standalone entity.

Ex: author, creation date, type.

Page 3: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

3/30

Example use of RDF

• A particularly good use of RDF is to describe resources, which are "opaque" like images or audio files.

• The RDFPic application is a demonstration application developed by the W3C to embed RDF meta data inside JPEG images.

• RDFPic automatically extract the RDF meta data from images stored on W3C's Jigsaw Web server.

Page 4: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

4/30

RDFPic

Page 5: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

5/30

RDF Document

• An RDF document contains a root element and one or more descriptions.

• root element <rdf:RDF> specifies the document is an RDF document.

• A description is a set of statements about a resource.

• The <rdf: Description> element contains an rdf:about attribute that refers to the resource being described.

• The child elements of the Description element are all properties of the resource being described.

Page 6: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

6/30

RDF Generated by RDFPic

Root element

Namespaces

Dublin Core namespa

ces

DescriptionChild elementsOf Desciption

Page 7: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

7/30

RDF Generated by RDFPic

ResourceResourceProperty

PropertyValue

Page 8: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

8/30

RDF Triple

• The RDF model is often called a "triple" because it has three parts: Resource, Property, and Value.

• In the knowledge representation community, those three parts are described in terms of the grammatical parts of a sentence: subject, predicate, and object.

Page 9: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

9/30

RDF Triple

Page 10: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

10/30

Subject

• The noun or noun phrase that is the doer of the action.

• In RDF, we want a URI to stand for the unique concept "company" like "http://www.business.org/ontology/#company" to denote that we mean a form of business ownership and not friends coming for a visit.

• An RDF resource stands for either electronic resources, like files, or concepts, like "person." One way to think of an RDF resource is as "anything that has identity."

Page 11: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

11/30

Predicate

• The part of a sentence that modifies the subject and includes the verb phrase.

• Returning to our sentence "The company sells batteries," the predicate is the phrase "sells batteries."

• In RDF, a predicate is a relation between the subject and the object. Thus, in RDF, we would define a unique URI for the concept "sells" like "http://www.business.org/ontology/#sells".

Page 12: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

12/30

Object

• A noun that is acted upon by the verb. • In our sentence "The company sells batteries," t

he object is the noun "batteries." • In RDF, an object is either a resource referred to

by the predicate or a literal value. In our example, we would define a unique URI for "batteries" like "http://www.business.org/ontology/#batteries".

Page 13: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

13/30

Statement

• In RDF, the combination of the preceding three elements, subject, predicate, and object, as a single unit.

Page 14: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

14/30

Capturing Knowledge with RDF

• Comparing four different ways express concepts in : as natural language sentences, in a simple triple notation called N3, in RDF/XML serialization format, and, finally, as a graph of the triples.

Buddy Belden owns a business. The business has a Web site accessible at http://www.c2i2.com/~budstv. Buddy is the father of Lynne.

Page 15: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

15/30

Capturing Knowledge with RDF

Buddy Belden owns a business. The business has a Web site accessible at http://www.c2i2.com/~budstv. Buddy is the father of Lynne.

<#Buddy> <#owns> <#business>.<#business> <#has-website> <http://www.c2i2.com/~budstv>.<#Buddy> <#father-of> <#Lynne>.

In N3The # sign means the URI of the concepts would be the cu

rrent document.

Page 16: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

16/30

Prefix

• Can replace the # sign with an absolute URI like "http://www.c2i2.com/buddy/ontology" as a formal namespace.

• In N3 you can do that with a prefix tag like this:@prefix bt: <http://www.c2i2.com/buddy/ontology/>.

• Using the prefix, our resources would be as follows:<bt:Buddy> <bt:owns> <bt:business>.

• Of course, we could also add other prefixes from other vocabularies like the Dublin Core:

@prefix dc: <http://purl.org/dc/elements/1.1/>. • This would allow us to add a statement like "The busines

s title is Buddy's TV and VCR Service" in this way:<bt:business> <dc:title> "Buddy's TV and VCR Service".

Page 17: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

17/30

Jena

• Tools are available to automatically convert the N3 notation into RDF/XML format.

• One popular tool is the Jena Semantic Web toolkit from Hewlett-Packard.

Page 18: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

18/30

RDF/XML generated from N3

<rdf:RDFxmlns:RDFNsId1='#' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='#Buddy'>

<RDFNsId1:owns> <rdf:Description rdf:about='business'>

<RDFNsId1:has-website rdf:resource='http://www.c2i2.com/~budstv'/>

</rdf:Description> </RDFNsId1:owns> <RDFNsId1:father-of rdf:resource='#Lynne'/>

</rdf:Description> </rdf:RDF>

Page 19: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

19/30

IsaViz Graph of N3 notation

Page 20: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

20/30

Container: Bag

• The container model allows groups of resources or values.

• The sentence "The people at the meeting were Joe, Bob, Susan, and Ralph." can be translated to:

<rdf:RDF xmlns:ex='http://www.example.org/sample#' xmlns:rdf='http://www.

w3.org/1999/02/22-rdf-syntax-ns#'> <rdf:Description rdf:about='ex:meeting'>

<ex:attendees> <rdf:Bag rdf:ID="people">

<rdf:li rdf:resource='ex:Joe'/> <rdf:li rdf:resource='ex:Bob'/> <rdf:li rdf:resource='ex:Susan'/> <rdf:li rdf:resource='ex:Ralph'/>

</rdf:Bag> </ex:attendees>

</rdf:Description> </rdf:RDF>

Page 21: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

21/30

IsaViz about meeting

Page 22: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

22/30

Explicit Modeling

• RDF containers are different than XML containers because RDF containers are explicit.

• This is the same case as relations between elements, which are also implicit in XML, whereas such relations (synonymous with predicates) are explicit in RDF.

• This explicit modeling of containers and relations is an effort to remove ambiguity from our models so that computers can act reliably in our behalf.

• On the downside, such explicit modeling is harder than the implicit modeling in XML documents.

Page 23: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

23/30

Three types of RDF containers

• Bag An rdf:bag element is used to denote an unordered collection. An example would be when all members of the collection are processed the same without concern for order.

• Sequence An rdf:seq element is used to denote an ordered collection (a "sequence" of elements). One reason to use a sequence would be to preserve the alphabetical order of elements. Another example would be to process items in the order in which items were added to the document.

• Alternate An rdf:alt element is used to denote a choice of multiple values or resources. Some examples would be a choice of image formats (JPEG, GIF, BMP) or a choice of makes and models, or any time you wish to constrain a value to a limited set of legal values.

Page 24: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

24/30

Making Statements

• Can make statements about the collection by attaching an rdf:ID attribute to the container.

• Making statements about the individual members is the same as making any other statement by simply referring to the resource in the collection as the object of your statement.

Page 25: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

25/30

Reification

• While containers affect the modeling of a single statement (for example, an object becoming a collection of values), reification allows you to treat a statement as the object of another statement.

• This is often referred to as "making statements about statements" and is called reification.

Page 26: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

26/30

N3 Example of Reification

@prefix : <http://example.org/onto#>. @prefix earl: <http://www.w3.org/2001/03/earl/0.95#>. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix dc: <http://purl.org/dc/elements/1.1/>.

:Jane earl:asserts [ rdf:subject :MyPage; rdf:predicate earl:passes; rdf:object "Accessibility Tests" ];

earl:email <mailto:[email protected]>; earl:name "Jane Jones".

:MyPage a earl:WebContent; dc:creator <http://example.org/onto/person/Mary/>.

Page 27: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

27/30

Generated RDF Example of Reification

<rdf:RDF xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:earl='http://www.w3.org/2001/03/earl/0.95#'> <rdf:Description rdf:about='http://example.org/onto#Jane'>

<earl:asserts rdf:parseType='Resource'> <rdf:subject>

<earl:WebContent rdf:about='http://example.org/onto#MyPage'> <dc:creator rdf:resource='http://example.org/onto/person/Mary/'/>

</earl:WebContent> </rdf:subject> <rdf:predicate> rdf:resource='http://www.w3.org/2001/03/earl/0.95#passes'/>

<rdf:object>Accessibility Tests</rdf:object> </earl:asserts> <earl:email rdf:resource='mailto:[email protected]'/> <earl:name>Jane Jones</earl:name>

</rdf:Description> </rdf:RDF>

Page 28: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

28/30

Reification

• The method for reifying statements in RDF is to model the statement as a resource via explicitly specifying the subject, predicate, object, and type of the statement.

• Once the statement is modeled, you can make statements about the modeled statement.

• The reification is akin to statements as argument instead of statements as fact, which is useful in cases where the trustworthiness of the source is carefully tracked (for example, human intelligence collection).

Page 29: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

29/30

Graph of reification

Anonymous Node

Page 30: Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.

30/30

Adoption of RDF

• Many people understand the basics of the triple but missing the utility of reification. Most databases treat data as facts, so it is a stretch to think about data as assertions.

• It will take training for developers and modelers to understand where to use reification and what rules apply to reified statements.

• Some current Semantic Web applications explicitly eliminate reification from their knowledge bases to reduce the complexity.

• Complexity hurts adoption, and the adoption of RDF by mainstream developers has been significantly slower than other W3C technologies.