Title: RDF:%20Resource%20Description%20Framework
1RDF Resource Description Framework
- Jianguo Lu
- University of Windsor
2Contents
- Ontology
- Syntax of RDF and RDFS
- Axiomatic Semantics for RDF and RDFS
- Applications of RDF and RDFS
- Querying of RDF/RDFS Documents using RQL
3Web Today
Hendler Miller 02
4The semantic web
5Ontology
- Long history coming from Philosophy, introduced
by Aristotle - a branch of metaphysics concerned with the
nature and relations of being --Webster - Picked up by the Artificial Intelligence
- For AI systems, what exists is that which can
be represented - a shared and common understanding of some domain
that can be communicated between people and
application systems Gruber
6What is Ontology
- An ontology is a formal, explicit specification
of a shared conceptualization - Gruber - Conceptualization refers to an abstract model of
phenomena. - Explicit means that the type of concepts used,
and the constraints on their use are explicitly
defined. - Formal refers to the fact that the ontology
should be machine readable. - Shared reflects that ontology should capture
consensual knowledge accepted by the communities.
7Main components of an Ontology
- Classes concepts of the domain or tasks, which
are usually organized in taxonomies - in a university ontology, student and professor
are two classes - Relations a type of interaction between concepts
of the domain - such as subclass-of, is-a
- Axioms model sentences that are always true
- such as if the student attends both A and B
course, then he or she must be a second year
student - Instances to represent specific elements
- such as a student called Peter is the instance
of Student class
8Contents
- Ontology
- Syntax of RDF and RDFS
- Semantics
- Applications
9RDF is a Web Standard
- RDF Model and Syntax Specification became a W3C
(World Wide Web Consortium) Recommendation in
February 1999. - It has a long history, considering that XML
became W3C Recommendation in 1998. - The purpose of RDF (Resource Description
Framework) is to give a standard way of
specifying data "about" something.
10XML vs. RDF
- ltcompanygt
- lttreatmentOfferedgtPhysiotherapylt/treatmentOffered
gt - ltcompanyNamegtAgilitas Physiotherapy Centre
lt/companyNamegt - ltstaffgt
- lttherapistgtLisa Davenportlt/therapistgt
- lttherapistgtSteve Matthewslt/therapistgt
- ltsecretarygtKelly Townsendlt/secretarygt
- lt/staffgt
-
- lt/companygt
- How to answer the query give me the list of
staff members in this company? - XML provides semantic information as a by-product
of defining the structure of the document - XML prescribes a tree structure for documents and
the different leaves of the tree have a
well-defined tag and context the information can
be understood with. - That is, structure and semantics of documents are
interwoven - there is no intended meaning associated with the
nesting of tags - It is up to each application to interpret the
nesting.
11RDF and RDF Schema
isA
therapist
Lisa
How to encode the rule that a person can not be
a secretary and therapist at the same time?
12OWL (Web Ontology Language)
isA
therapist
Lisa
RDF
secretary
isA
staff
RDFS
subClassOf
therapist
secretary
OWL
Disjoint (therapist, secretary)
13Basic Ideas of RDF
- David Billington is a lecturer of Discrete Maths
- ltcourse name"Discrete Maths"gt
- ltlecturergtDavid Billingtonlt/lecturergt
- lt/coursegt
- ltlecturer name"David Billington"gt
- ltteachesgtDiscrete Mathslt/teachesgt
- lt/lecturergt
- Opposite nesting, same information!
- Basic building block of rdf subject-predicate-obj
ect triple - It is called a statement
- Sentence about Billington is such a statement
- ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" - xmlnsmydomain"http//www.mydomai
n.org/my-rdf-ns"gt - ltrdfDescription rdfabout"http//www.cit.gu.edu
.au/DiscreteMath"gt - ltmydomaintaughtBygt David Billington
lt/mydomaintaughtBygt - lt/rdfDescriptiongt
14Statements
- Statements assert the properties of resources
- A statement is an resource-property-value triple
- Sometimes also called subject, predicate, and
value - Values can be resources or literals
- Literals are atomic values (strings)
15Resource in a statement
- We can think of a resource as a thing we want
to talk about - E.g. authors, books, publishers, places, people,
hotels - Every resource has a URI, a Universal Resource
Identifier - A URI can be
- a URL (Web address), or
- some other kind of unique identifier.
- In the following example, http//www.cit.gu.edu.a
u/DiscreteMath is a resource that we want to
talk about. - ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" - xmlnsmydomain"http//www.mydomai
n.org/my-rdf-ns"gt - ltrdfDescription rdfabout"http//www.cit.gu.edu
.au/DiscreteMath"gt - ltmydomaintaughtBygt David Billington
lt/mydomaintaughtBygt - lt/rdfDescriptiongt
- lt/rdfRDFgt
16Properties
- Properties are a special kind of resources
- They describe relations between resources
- E.g. taught by, written by, age, title,
etc. - Properties are also identified by URIs.
- Advantages of using URIs
- ? global, worldwide, unique naming scheme
- Reduces the homonym problem of distributed data
representation.
ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" xmlnsmydomain"http
//www.mydomain.org/my-rdf-ns"gt
ltrdfDescription rdfabout"http//www.cit.gu.edu.
au/DiscreteMath"gt ltmydomaintaughtBygt
David Billington lt/mydomaintaughtBygt
lt/rdfDescriptiongt lt/rdfRDFgt
17Three Views of a Statement
- A triple
- A piece of a graph
- A piece of XML code
- Thus an RDF document can be viewed as
- A set of triples
- A graph (semantic net)
- An XML document.
18RDF Example
- The statement
- http//www.example.org/index.html
- has a creation-date
- whose value is August 16, 1999
- lt?xml version"1.0"?gt
- ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" - xmlnsexterms"http//www.example.org/
terms/"gt - ltrdfDescription rdfabout"http//www.example
.org/index.html"gt - ltextermscreation-dategtAugust 16,
1999lt/extermscreation-dategt - lt/rdfDescriptiongt
- lt/rdfRDFgt
19Several statements about the same resource
20Its XML representation
- A complete representation
- ltrdfDescription rdfabout"http//www.example.org
/index.html"gt ltextermscreation-dategtAugust 16,
1999lt/extermscreation-dategt - lt/rdfDescriptiongt
- ltrdfDescription rdfabout"http//www.example.org
/index.html"gt ltdclanguagegtenlt/dclanguagegt - lt/rdfDescriptiongt
- ltrdfDescription rdfabout"http//www.example.org
/index.html"gt ltdccreator rdfresource"http//www
.example.org/staffid/85740"/gt - lt/rdfDescriptiongt
- An abbreviation
- ltrdfDescription rdfabout"http//www.example.org
/index.html"gt - ltextermscreation-dategt August 16, 1999
lt/extermscreation-dategt - ltdclanguagegt en lt/dclanguagegt
- ltdccreator rdfresource"http//www.example.o
rg/staffid/85740"/gt - lt/rdfDescriptiongt
21Two different kinds of nodes
- Nodes that are URIrefs are shown as ellipses
- Nodes that are literals are shown as boxes
- Using URIref to identify resource and property
22Structured Property Values and Blank Nodes
Problem with this approach may generate many
intermediate URIRefs.
23Blank Node
24Blank node or anonymous resource
25Corresponding RDF/XML
- lt?xml version"1.0"?gt
- ltrdfRDF xmlnsrdfhttp//www.w3.org/1999/02/22-r
df-syntax-ns - xmlnsdchttp//purl.org/dc/elements/1.1/
- xmlnsexterms"http//example.org/stuff/1.0/"gt
- ltrdfDescription rdfabout"http//www.w3.org/TR/r
df-syntax-grammar"gt - ltdctitlegtRDF/XML Syntax Specification
(Revised)lt/dctitlegt - ltextermseditor rdfnodeID"abc"/gt
- lt/rdfDescriptiongt
- ltrdfDescription rdfnodeID"abc"gt
- ltextermsfullNamegtDave Beckettlt/extermsfullNamegt
- ltextermshomePage rdfresource"http//purl.org/n
et/dajobe/"/gt - lt/rdfDescriptiongt
- lt/rdfRDFgt
26Typed literals
- 27 is an integer or a string?
27A Typed Literal for a Web Page's Creation Date
- ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" - xmlnsexterms"http//www.example.org/
terms/"gt - ltrdfDescription rdfabout"http//www.exampl
e.org/index.html"gt - ltextermscreation-date
rdfdatatype"xsddate"gt1999-08-16 - lt/extermscreation-dategt
- lt/rdfDescriptiongt
- lt/rdfRDFgt
28An Invalid Typed Literal for John Smith's Age
29RDF Containers
- Container is a resource to contain things
- RDF defines three types of containers
- Bag contains an unordered list of value elements
- Seq contains an ordered list of value elements
- Alt contains a list of alternative values for
an element
30Bag
31Bag (cont.)
- ltrdfDescription rdfabout"http//example.org/cou
rses/6.001"gt - ltsstudentsgt
- ltrdfBaggt
- ltrdfli rdfresource"http//example.org/studen
ts/Amy"/gt - ltrdfli rdfresource"http//example.org/student
s/Mohamed"/gt - ltrdfli rdfresource"http//example.org/student
s/Johann"/gt - ltrdfli rdfresource"http//example.org/student
s/Maria"/gt - ltrdfli rdfresource"http//example.org/student
s/Phuong"/gt - lt/rdfBaggt
- lt/sstudentsgt
- lt/rdfDescriptiongt
32Alt container
33Alt container (cont.)
- ltrdfDescription rdfabout"http//example.org/pac
kages/X11"gt - ltsDistributionSitegt
- ltrdfAltgt
- ltrdfli rdfresource"ftp//ftp.example.org"/gt
- ltrdfli rdfresource"ftp//ftp1.example.org"/gt
- ltrdfli rdfresource"ftp//ftp2.example.org"/gt
- lt/rdfAltgt
- lt/sDistributionSitegt
- lt/rdfDescriptiongt
34RDF Collection
- A container only says that certain resources are
members - Id does not say that other members do not exist
ltrdfDescription rdfabout"http//example.org/co
urses/6.001"gt ltsstudents rdfparseType"Colle
ction"gt ltrdfDescription
rdfabout"http//example.org/students/Amy"/gt
ltrdfDescription rdfabout"http//example.org
/students/Mohamed"/gt ltrdfDescription
rdfabout"http//example.org/students/Johann"/gt
lt/sstudentsgt lt/rdfDescriptiongt
35RDF Reification
- In RDF it is possible to make statements about
statements - Grigoris believes that David Billington is the
creator of http//www.cit.gu.edu.au/db - Such statements can be used to describe belief or
trust in other statements - The solution is to assign a unique identifier to
each statement - It can be used to refer to the statement
- Introduce an auxiliary object (e.g. belief1)
- relate it to each of the 3 parts of the original
statement through the properties subject,
predicate and object - In the preceding example
- subject of belief1 is David Billington
- predicate of belief1 is creator
- object of belief1 is http//www.cit.gu.edu.au/db
36Reification example
37Reification in XML
- lt?xml version"1.0"?gt
- lt!DOCTYPE rdfRDF lt!ENTITY xsd
"http//www.w3.org/2001/XMLSchema"gtgt - ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" - xmlnsdchttp//purl.org/dc/elements/1.1/
- xmlnsextermshttp//www.example.com/terms/
- xmlbase"http//www.example.com/2002/04/product
s"gt - ltrdfDescription rdfID"item10245"gt
- ltextermsweight rdfdatatype"xsddecimal"gt2.4
- lt/extermsweightgt
- lt/rdfDescriptiongt
- ltrdfStatement rdfabout"triple12345"gt
- ltrdfsubject rdfresource"http//www.example.com
/2002/04/productsitem10245"/gt - ltrdfpredicate rdfresource"http//www.example.c
om/terms/weight"/gt - ltrdfobject rdfdatatype"xsddecimal"gt2.4lt/rdf
objectgt - ltdccreator rdfresource"http//www.example.com/
staffid/85740"/gt - lt/rdfStatementgt
- lt/rdfRDFgt
38rdfabout vs rdfID
- An element rdfDescription has
- an rdfabout attribute indicating that the
resource has been defined elsewhere - An rdfID attribute indicating that the resource
is defined - Formally, there is no such thing as defining an
object in one place and referring to it elsewhere
- Sometimes it is useful (for human readability) to
have a defining location, while other locations
state additional properties.
39Connecting two resources
- ltrdfDescription rdfabout"CIT1111"gt
- ltunicourseNamegtDiscrete Mathematicslt/unicourse
Namegt - ltuniisTaughtBy rdfresource"949318"/gt
- lt/rdfDescriptiongt
- ltrdfDescription rdfabout"949318"gt
- ltuninamegtDavid Billingtonlt/uninamegt
- ltunititlegtAssociate Professorlt/unititlegt
- lt/rdfDescriptiongt
40Nested description
- ltrdfDescription rdfabout"CIT1111"gt
- ltunicourseNamegtDiscrete Mathslt/unicourseNamegt
- ltuniisTaughtBygt
- ltrdfDescription rdfID"949318"gt
- ltuninamegtDavid Billingtonlt/uninamegt
- ltunititlegtAssociate Professorlt/unititlegt
- lt/rdfDescriptiongt
- lt/uniisTaughtBygt
- lt/rdfDescriptiongt
lt?xml version"1.0"?gt ltResource-Agt
ltproperty-Agt ltResource-Bgt
ltproperty-Bgt ltResource-Cgt
ltproperty-Cgt
Value-C
lt/property-Cgt lt/Resource-Cgt
lt/property-Bgt
lt/Resource-Bgt lt/property-Agt lt/Resource-Agt
value of property-A
value of property-B
41Introducing some Structure to RDF Documents using
the rdftype Element
- What does the following RDF describe? Not very
straightforward. - ltrdfDescription rdfID"CIT1111"gt
- ltunicourseNamegtDiscrete Mathslt/unicourseNamegt
- ltuniisTaughtBy rdfresource"949318"/gt
- lt/rdfDescriptiongt
- Add type declaration
- ltrdfDescription rdfID"CIT1111"gt
- ltrdftype rdfresource"http//www.mydomain.org/u
ni-nscourse"/gt - ltunicourseNamegtDiscrete Mathslt/unicourseNamegt
- ltuniisTaughtBy rdfresource"949318"/gt
- lt/rdfDescriptiongt
- An equivalent, more concise notation
- ltunicourse rdfID"CIT1111"gt
- ltunicourseNamegtDiscrete Mathslt/unicourseNamegt
- ltuniisTaughtBy rdfresource"949318"/gt
- lt/rdfDescriptiongt
42Equivalent Representations
ltRiver rdfID"Yangtze" xmlnsrdf"http//ww
w.w3.org/1999/02/22-rdf-syntax-ns"
xmlns"http//www.geodesy.org/river"
xmlbase"http//www.china.org/geography/rivers"gt
ltlengthgt6300 kilometerslt/lengthgt
ltstartingLocationgtwestern China's Qinghai-Tibet
Plateault/startingLocationgt ltendingLocationgtEast
China Sealt/endingLocationgt lt/Rivergt
ltRiver rdfabout"http//www.china.org/geography/r
iversYangtze" xmlnsrdf"http//www.w
3.org/1999/02/22-rdf-syntax-ns"
xmlns"http//www.geodesy.org/river"gt
ltlengthgt6300 kilometerslt/lengthgt
ltstartingLocationgtwestern China's Qinghai-Tibet
Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt lt/
Rivergt
ltrdfDescription rdfabout"http//www.chin
a.org/geography/riversYangtze"
xmlnsrdf"http//www.w3.org/1999/02/22-rdf-syntax
-ns" xmlns"http//www.geodesy.org/river"gt
ltrdftype rdfresource"http//www.geodesy.org
/riverRiver"/gt ltlengthgt6300
kilometerslt/lengthgt ltstartingLocationgtwestern
China's Qinghai-Tibet Plateau
lt/startingLocationgt ltendingLocationgtEast China
Sealt/endingLocationgt lt/rdfDescriptiongt
Note In the RDF literature the examples are
typically shown in this form.
From Costello
43- Resource URI
- concatenation(xmlbase, '', rdfID)
- concatenation(http//www.china.org/geography/riv
ers, '', "Yangtze") - http//www.china.org/geography/riversYangtze
44Describe a property that has more than one value
lt?xml version"1.0"?gt ltRiver id"Yangtze"
xmlns"http//www.geodesy.org/river"
xmlnsuom"http//www.measurements.org/units-of
-measure"gt ltlength uomunits"kilometers"gt63
00lt/lengthgt ltstartingLocationgtwestern
China's Qinghai-Tibet Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocation
gt lt/Rivergt
Not correct!
RDF does not allow attributes on the properties
(except for special RDF attributes such as
rdfresource). So we need to make the uomunits
attribute a child element. Your first instinct
might be to modify length to have two child
elements
lt?xml version"1.0"?gt ltRiver id"Yangtze"
xmlns"http//www.geodesy.org/river"
xmlnsuom"http//www.measurements.org/units-of
-measure"gt ltlengthgt
ltvaluegt6300lt/valuegt ltuomunitsgtkilometer
slt/uomunitsgt lt/lengthgt
ltstartingLocationgtwestern China's Qinghai-Tibet
Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt lt/
Rivergt
However, now the length property has as its value
two values. RDF allows only binary
relations i.e., a single value for a property.
From Costello
45Rdfvalue
6300
length
kilometers
- length has two values - 6300 and kilometers.
- RDF provides a special property, rdfvalue, to be
used for specifying the "primary" value. - 6300 is the primary value
- kilometers is a value which provides additional
information about the primary value.
From Costello
46Anonymous resource
lt?xml version"1.0"?gt ltRiver rdfID"Yangtze"
xmlnsrdf"http//www.w3.org/1999/02/22-rd
f-syntax-ns" xmlns"http//www.geodes
y.org/river" xmlnsuom"http//www.me
asurements.org/units-of-measure"gt ltlengthgt
ltrdfDescriptiongt
ltrdfvaluegt6300lt/rdfvaluegt
ltuomunitsgtkilometerslt/uomunitsgt
lt/rdfDescriptiongt lt/lengthgt
ltstartingLocationgtwestern China's Qinghai-Tibet
Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt lt/
Rivergt
An anonymous resource
From Costello
47rdfparseType"Resource"
If the value of a property is comprised of
several values then one option is to create an
anonymous resource, as we saw. RDF provides a
shorthand, so that you don't need to create an
rdfDescription element, by using
rdfparseType"Resource", as shown here
lt?xml version"1.0"?gt ltRiver rdfID"Yangtze"
xmlnsrdf"http//www.w3.org/1999/02/22-rd
f-syntax-ns" xmlns"http//www.geodes
y.org/river" xmlnsuom"http//www.me
asurements.org/units-of-measure"gt ltlength
rdfparseType"Resource"gt
ltrdfvaluegt6300lt/rdfvaluegt
ltuomunitsgtkilometerslt/uomunitsgt lt/lengthgt
ltstartingLocationgtwestern China's
Qinghai-Tibet Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt lt/
Rivergt
From Costello
48Equivalent
ltlengthgt ltrdfDescriptiongt
ltrdfvaluegt6300lt/rdfvaluegt
ltuomunitsgtkilometerslt/uomunitsgt
lt/rdfDescriptiongt lt/lengthgt
ltlength rdfparseType"Resource"gt
ltrdfvaluegt6300lt/rdfvaluegt
ltuomunitsgtkilometerslt/uomunitsgt lt/lengthgt
49Exercise
Modify the following XML document so that it is
also a valid RDF document
lt?xml version"1.0"?gt ltRiver id"Yangtze"
xmlns"http//www.geodesy.org/river"
xmlnsuom"http//www.measurements.org/units-of
-measure"gt ltlength uomunits"kilometers"gt63
00lt/lengthgt ltstartingLocationgtwestern
China's Qinghai-Tibet Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocation
gt ltDam id"ThreeGorges" xmlns"http//www.g
eodesy.org/dam"gt ltnamegtThe Three Gorges
Damlt/namegt ltwidthgt1.5 mileslt/widthgt
ltheightgt610 feetlt/heightgt ltcostgt30
billionlt/costgt lt/Damgt lt/Rivergt
50Answer
lt?xml version"1.0"?gt ltRiver rdfID"Yangtze"
xmlnsrdf"http//www.w3.org/1999/02/22-rd
f-syntax-ns" xmlns"http//www.geodes
y.org/river" xmlnsuom"http//www.me
asurements.org/units-of-measure"
xmlbase"http//www.china.org/geography/rivers"gt
ltlength rdfparseType"Resource"gt
ltrdfvaluegt6300lt/rdfvaluegt
ltuomunitsgtkilometerslt/uomunitsgt lt/lengthgt
ltstartingLocationgtwestern China's
Qinghai-Tibet Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt
ltobstaclegt ltDam rdfID"ThreeGorges"
xmlns"http//www.geodesy.org/d
am"gt ltnamegtThe Three Gorges
Damlt/namegt ltwidthgt1.5 mileslt/widthgt
ltheightgt610 feetlt/heightgt
ltcostgt30 billionlt/costgt lt/Damgt
lt/obstaclegt lt/Rivergt
51Exercise 2
Modify the following XML document so that it is
also a valid RDF document
lt?xml version"1.0"?gt ltMeeting id"XML-Design-Patt
erns" xmlns"http//www.business.o
rg"gt ltattendeesgt ltnamegtJohn
Smithlt/namegt ltnamegtSally Joneslt/namegt
lt/attendeesgt lt/Meetinggt
lt?xml version"1.0"?gt ltMeeting rdfID"XML-Design-
Pattern" xmlnsrdf"http//www.w3.
org/1999/02/22-rdf-syntax-ns"
xmlns"http//www.business.org"gt
ltattendeesgt ltrdfBaggt
ltnamegtJohn Smithlt/namegt
ltnamegtSally Joneslt/namegt lt/rdfBaggt
lt/attendeesgt lt/Meetinggt
rdfBag makes it clear that this is an
unordered collection of names.
52Exercise 3
Modify the following XML document so that it is
also a valid RDF document
lt?xml version"1.0"?gt ltCatalogue
xmlns"http//www.publishing.org"
xmlnsdc"http//pur1.org/metadata/dublin-cor
e"gt ltBookgt
ltdcTitlegtLateral Thinkinglt/dcTitlegt
ltdcCreatorgtEdward de Bonolt/dcCreatorgt
ltdcDategt1973lt/dcDategt
ltISBNgt0-06-099325-2lt/ISBNgt
ltdcPublishergtHarper amp Rowlt/dcPublishergt
lt/Bookgt ltBookgt
ltdcTitlegtIllusions The Adventures of a
Reluctant Messiahlt/dcTitlegt
ltdcCreatorgtRichard Bachlt/dcCreatorgt
ltdcDategt1977lt/dcDategt
ltISBNgt0-440-34319-4lt/ISBNgt
ltdcPublishergtDell Publishing Co.lt/dcPublishergt
lt/Bookgt ltBookgt
ltdcTitlegtThe First and Last Freedomlt/dcTitlegt
ltdcCreatorgtJ. Krishnamurtilt/dcCrea
torgt ltdcDategt1954lt/dcDategt
ltISBNgt0-06-064831-7lt/ISBNgt
ltdcPublishergtHarper amp Rowlt/dcPublishergt
lt/Bookgt lt/Cataloguegt
53Modification 1 identifiers are added
lt?xml version"1.0"?gt ltCatalogue
id"BookCatalogue"
xmlns"http//www.publishing.org"
xmlnsdc"http//pur1.org/metadata/dublin-cor
e"gt ltBook id"_0-06-099325-2"gt
ltdcTitlegtLateral Thinkinglt/dcTitlegt
ltdcCreatorgtEdward de Bonolt/dcCreatorgt
ltdcDategt1973lt/dcDategt
ltdcPublishergtHarper amp
Rowlt/dcPublishergt lt/Bookgt ltBook
id"_0-440-34319-4"gt
ltdcTitlegtIllusions The Adventures of a
Reluctant Messiahlt/dcTitlegt
ltdcCreatorgtRichard Bachlt/dcCreatorgt
ltdcDategt1977lt/dcDategt
ltdcPublishergtDell Publishing Co.lt/dcPublishergt
lt/Bookgt ltBook id"_0-06-064831-7"gt
ltdcTitlegtThe First and Last
Freedomlt/dcTitlegt ltdcCreatorgtJ.
Krishnamurtilt/dcCreatorgt
ltdcDategt1954lt/dcDategt
ltdcPublishergtHarper amp Rowlt/dcPublishergt
lt/Bookgt lt/Cataloguegt
Why was an underscore placed in front of
the ISBN? Answer The ID datatype does not allow
an identifier to begin with a digit. So, we
(arbitrarily) decided to use an underscore.
Notice that the ISBN elements were deleted and
their values used as identifiers.
54The RDF document
- lt?xml version"1.0"?gt
- ltCatalogue rdfID"BookCatalogue"
- xmlnsrdf"http//www.w3.org/1
999/02/22-rdf-syntax-ns" - xmlns"http//www.publishing.o
rg" - xmlnsdc"http//pur1.org/meta
data/dublin-core" - xmlbase"http//www.bn.com"gt
- ltitemgt
- ltBook rdfID"_0-06-099325-2"
- xmlbase"http//www.publish
ing.org/book"gt - ltdcTitlegtLateral
Thinkinglt/dcTitlegt - ltdcCreatorgtEdward de
Bonolt/dcCreatorgt - ltdcDategt1973lt/dcDategt
- ltdcPublishergtHarper amp
Rowlt/dcPublishergt - lt/Bookgt
- lt/itemgt
- ltitemgt
- ltBook rdfID"_0-440-34319-4"
- xmlbase"http//www.publish
ing.org/book"gt - ltdcTitlegtIllusions The
Adventures of a Reluctant Messiahlt/dcTitlegt
55Exercise 4 Draw the graph representation of the
following rdf
lt?xml version"1.0"?gt ltRiver rdfabout"http//www
.china.org/geography/riversYangtze"
xmlnsrdf"http//www.w3.org/1999/02/22-rdf-syntax
-ns" xmlns"http//www.geodesy.org/ri
ver"gt ltlengthgt6300 kilometerslt/lengthgt
ltstartingLocationgtwestern China's Qinghai-Tibet
Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt lt/
Rivergt
56RDF and relational database
ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" xmlnscd"http//www.recshop.fake
/cd"gt ltrdfDescription rdfabout"http//www.recs
hop.fake/cd/Empire Burlesque"gt ltcdartistgtBob
Dylanlt/cdartistgt ltcdcountrygtUSAlt/cdcountry
gt ltcdcompanygtColumbialt/cdcompanygt
ltcdpricegt10.90lt/cdpricegt ltcdyeargt1985
lt/cdyeargt lt/rdfDescriptiongt ltrdfDescription
rdfabout"http//www.recshop.fake/cd/Hide your
heart"gt ltcdartistgtBonnie Tylerlt/cdartistgt
ltcdcountrygtUKlt/cdcountrygt
ltcdcompanygtCBS Recordslt/cdcompanygt
ltcdpricegt9.90lt/cdpricegt ltcdyeargt1988lt/cdy
eargt lt/rdfDescriptiongt lt/rdfRDFgt
57Properties as Attributes
- Properties can also be expressed as attributes
(instead of elements) - ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" - xmlnscd"http//www.recshop.fake/c
d"gt - ltrdfDescription rdfabout"http//www.recshop.
fake/cd/Empire Burlesque" - cdartist"Bob Dylan"
cdcountry"USA" - cdcompany"Columbia"
cdprice"10.90" - cdyear"1985" /gt
- lt/rdfRDFgt
- In the example above, the properties (artist,
country, company, price, and year) are expressed
as attributes instead of elements.
58A Critical View of RDF
- RDF uses only binary properties
- This is a restriction because often we use
predicates with more than 2 arguments - But binary predicates can simulate these
- Example referee(X,Y,Z)
- X is the referee in a chess game between players
Y and Z - We introduce
- a new auxiliary resource chessGame
- the binary predicates ref, player1, and player2
- We can represent referee(X,Y,Z) as
59ltRiver rdfabout"http//www.china.org/geography/r
iversYangtze" xmlnsrdf"http//www.w
3.org/1999/02/22-rdf-syntax-ns"
xmlns"http//www.geodesy.org/river"gt
ltlengthgt6300 kilometerslt/lengthgt
ltstartingLocationgtwestern China's Qinghai-Tibet
Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt lt/
Rivergt
ltRiver rdfabout"http//www.china.org/geography/r
iversYangtze" xmlnsrdf"http//www.w
3.org/1999/02/22-rdf-syntax-ns"
xmlns"http//www.geodesy.org/river"gt
ltnamegtDri Chu - Female Yak Riverlt/namegt
ltnamegtTongtian He, Travelling-Through-the-Heavens
Riverlt/namegt ltnamegtJinsha Jiang, River of
Golden Sandlt/namegt lt/Rivergt
http//www.china.org/geography/rivers/yangtze.rdf
http//www.encyclopedia.org/yangtze-alternate-name
s.rdf
Aggregator tool collects data about the Yangtze
ltRiver rdfabout"http//www.china.org/geography/r
iversYangtze" xmlnsrdf"http//www.w
3.org/1999/02/22-rdf-syntax-ns"
xmlns"http//www.geodesy.org/river"gt
ltlengthgt6300 kilometerslt/lengthgt
ltstartingLocationgtwestern China's Qinghai-Tibet
Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt
ltnamegtDri Chu - Female Yak Riverlt/namegt
ltnamegtTongtian He, Travelling-Through-the-Heavens
Riverlt/namegt ltnamegtJinsha Jiang, River of
Golden Sandlt/namegt lt/Rivergt
A distributed network of data!
Aggregated Data!
60Anonymous resources cant be aggregated
lt?xml version"1.0"?gt ltRiver xmlns"http//www.geo
desy.org/river"gt ltnamegtYangtzelt/namegt
ltlengthgt6300 kilometerslt/lengthgt
ltstartingLocationgtwestern China's Qinghai-Tibet
Plateault/startingLocationgt
ltendingLocationgtEast China Sealt/endingLocationgt lt/
Rivergt
http//www.china.org/geography/rivers/yangtze.rdf
lt?xml version"1.0"?gt ltRiver xmlns"http//www.geo
desy.org/river"gt ltnamegtYangtzelt/namegt
ltnamegtDri Chu - Female Yak Riverlt/namegt
ltnamegtTongtian He, Travelling-Through-the-Heavens
Riverlt/namegt ltnamegtJinsha Jiang, River of
Golden Sandlt/namegt lt/Rivergt
http//www.encyclopedia.org/yangtze-alternate-name
s.rdf
Aggregate
An aggregator tool will not be able to determine
if these documents are talking about the same
resource.
61RDF Parser
- There is a nice RDF parser at the W3 Web site
- http//www.w3.org/RDF/Validator
- This RDF parser will tell you if your XML is in
the proper RDF format. - Altova semanticworks support RDF, RDFS, and OWL.
62RDF Application--RSS
- RSS is a family of web feed formats used to
publish frequently updated digital content, such
as blogs, news feeds or podcasts. - The initials "RSS" are variously used to refer to
the following standards - Really Simple Syndication (RSS 2.0)
- Rich Site Summary (RSS 0.91, RSS 1.0)
- RDF Site Summary (RSS 0.9 and 1.0)
- Programs known as feed readers or aggregators can
check a list of feeds on behalf of a user and
display any updated articles that they find. It
is common to find web feeds on major websites and
many smaller ones.
63RSS example
- ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-r
df-syntax-ns" xmlns"http//purl.org/rss/1.0/"gt
ltchannel rdfabout"http//www.xml.com/xml/news.rs
s"gt - lttitlegtXML.comlt/titlegt
- ltlinkgthttp//xml.com/publt/linkgt
- ltdescriptiongt XML.com features a rich mix of
information and services for the XML community. - lt/descriptiongt
- ltimage rdfresource"http//xml.com/universal/imag
es/xml_tiny.gif" /gt - ltitemsgt
- ltrdfSeqgt
- ltrdfli resource"http//xml.com/pub/2000/08/
09/xslt/xslt.html" /gt - ltrdfli resource"http//xml.com/pub/2000/08/
09/rdfdb/index.html" /gt - lt/rdfSeqgt
- lt/itemsgt
- lttextinput rdfresource"http//search.xml.com"
/gt - lt/channelgt
- ltimage rdfabout"http//xml.com/universal/images/
xml_tiny.gif"gt lttitlegtXML.comlt/titlegt
ltlinkgthttp//www.xml.comlt/linkgt
lturlgthttp//xml.com/universal/images/xml_tiny.giflt
/urlgt - lt/imagegt
64RSS
- RSS is a family of web feed formats used to
publish frequently updated digital content, such
as blogs, news feeds or podcasts.