RDF: Resource Description Framework Some slides are from Costello and “primer to semantic web”
2 Contents Ontology Syntax of RDF and RDFS Axiomatic Semantics for RDF and RDFS Applications of RDF and RDFS –Querying of RDF/RDFS Documents
3 Web Today [Hendler & Miller 02]
4 The semantic web
5 Ontology 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
6 What is Ontology An ontology is a formal, explicit specification of a shared conceptualization – Tom 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. For example, in medical domains, the concepts can be diseases and symptoms, the relations between them are causal and a constraint is that a disease cannot cause itself. –Formal refers to the fact that the ontology should be machine readable. Not described in natural language –Shared reflects that ontology should capture consensual knowledge accepted by the communities. it is not private to some individual, but accepted by a group
7 Main 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
8 Contents Ontology Syntax of RDF and RDFS Semantics Applications
9 RDF is a Web Standard RDF: Resource Description Framework –Resource: web resource The purpose is to give a standard way of specifying data "about" something RDF Model and Syntax Specification became a W3C Recommendation in February 1999 –W3C: World Wide Web Consortium –It has a “long” history, considering that XML became W3C Recommendation in 1998.
10 XML vs. RDF Physiotherapy Agilitas Physiotherapy Centre Lisa Davenport Steve Matthews Kelly Townsend … … 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.
11 RDF and RDF Schema Lisa therapist isA staff therapist subClassOf secretary subClassOf How to encode the rule that “a person can not be a secretary and therapist at the same time”? RDF RDF Schema
12 OWL (Web Ontology Language) Lisa therapist isA secretary isA staff therapist subClassOf secretary Disjoint (therapist, secretary) RDF OWL RDFS
13 Basic Ideas of RDF David Billington is a lecturer of Discrete Maths David Billington Discrete Maths –Opposite nesting, same information! Basic building block of rdf: subject-predicate-object triple –It is called a statement; –Sentence about Billington is such a statement; <rdf:RDF xmlns:rdf=" xmlns:mydomain=" David Billington
14 Statements 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) Subject Object predicate Resource Value property Equivalent!
15 Resource 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, “ is a resource that we want to talk about. <rdf:RDF xmlns:rdf=" xmlns:mydomain=" David Billington
16 Properties 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. <rdf:RDF xmlns:rdf=" xmlns:mydomain=" David Billington
17 Three 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.
18 RDF Example The statement: has a creation-date whose value is August 16, 1999 <rdf:RDF xmlns:rdf=" xmlns:exterms=" August 16, 1999
19 Several statements about the same resource
20 Its XML representation A complete representation August 16, 1999 en An abbreviation August 16, 1999 en
21 Two 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
22 Structured Property Values and Blank Nodes Problem with this approach: may generate many intermediate URIRefs.
23 Blank Node
24 Blank node or anonymous resource
25 Corresponding RDF/XML <rdf:RDF xmlns:rdf=“ xmlns:dc=“ xmlns:exterms=" RDF/XML Syntax Specification (Revised) Dave Beckett
26 Typed literals 27 is an integer or a string?
27 A Typed Literal for a Web Page's Creation Date <rdf:RDF xmlns:rdf=" xmlns:exterms="
28 An Invalid Typed Literal for John Smith's Age
29 RDF 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:
30 Bag
31 Bag (cont.)
32 Alt container
33 Alt container (cont.)
34 RDF Collection A container only says that certain resources are members It does not say that other members do not exist
35 RDF Reification In RDF it is possible to make statements about statements –Grigoris believes that David Billington is the creator of 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
36 Reification example
37 Reification in XML ]> <rdf:RDF xmlns:rdf=" xmlns:dc=“ xmlns:exterms=“ xml:base="
38 rdf:about vs rdf:ID An element rdf:Description has –an rdf:about attribute indicating that the resource has been “defined” elsewhere –An rdf:ID 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.
39 Connecting two resources Discrete Mathematics David Billington Associate Professor
40 Nested description Discrete Maths David Billington Associate Professor Value-C value of property-A value of property-B
41 Introducing some Structure to RDF Documents using the rdf:type Element What does the following RDF describe? Not very straightforward. Discrete Maths Add type declaration Discrete Maths An equivalent, more concise notation Discrete Maths
42 Equivalent Representations <River rdf:ID="Yangtze" xmlns:rdf=" xmlns=" xml:base=" kilometers western China's Qinghai-Tibet Plateau East China Sea <River rdf:about=" xmlns:rdf=" xmlns=" kilometers western China's Qinghai-Tibet Plateau East China Sea <rdf:Description rdf:about=" xmlns:rdf=" xmlns=" kilometers western China's Qinghai-Tibet Plateau East China Sea Note: In the RDF literature the examples are typically shown in this form. Example From Costello
43 Resource URI = concatenation(xml:base, '#', rdf:ID) = concatenation( '#', "Yangtze") =
44 <River id="Yangtze" xmlns=" xmlns:uom=" western China's Qinghai-Tibet Plateau East China Sea RDF does not allow attributes on the properties (except for special RDF attributes such as rdf:resource). So we need to make the uom:units attribute a child element. Your first instinct might be to modify length to have two child elements: <River id="Yangtze" xmlns=" xmlns:uom=" kilometers western China's Qinghai-Tibet Plateau East China Sea However, now the length property has as its value two values. RDF allows only binary relations i.e., a single value for a property. Describe a property that has more than one value From Costello Not correct! Example From Costello
45 Rdf:value length has two values and kilometers. RDF provides a special property, rdf:value, 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. length 6300 kilometers From Costello
46 Anonymous resource <River rdf:ID="Yangtze" xmlns:rdf=" xmlns=" xmlns:uom=" … 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea An anonymous resource
47 rdf:parseType="Resource" <River rdf:ID="Yangtze" xmlns:rdf=" xmlns=" xmlns:uom=" kilometers western China's Qinghai-Tibet Plateau East China Sea 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 rdf:Description element, by using rdf:parseType="Resource", as shown here: From Costello
48 Equivalent 6300 kilometers 6300 kilometers
49 Exercise Modify the following XML document so that it is also a valid RDF document: <River id="Yangtze" xmlns=" xmlns:uom=" western China's Qinghai-Tibet Plateau East China Sea The Three Gorges Dam 1.5 miles 610 feet $30 billion
50 Answer <rdf:RDF xmlns:rdf=" xmlns=" xmlns:uom=" xml:base=" kilometers western China's Qinghai-Tibet Plateau East China Sea <Dam rdf:ID="ThreeGorges" xmlns=" The Three Gorges Dam 1.5 miles 610 feet $30 billion
51 Exercise 2 <Meeting id="XML-Design-Patterns" xmlns=" John Smith Sally Jones Modify the following XML document so that it is also a valid RDF document: rdf:Bag makes it clear that this is an unordered collection of names. 1: 2: <rdf:RDF xmlns:rdf=" 3: xmlns=" 4: xml:base=" > 5: 6: 7: 8: John Smith 9: Sally Jones 10: 11: 12: 13:
52 Exercise 3 Modify the following XML document so that it is also a valid RDF document: <Catalogue xmlns=" xmlns:dc=" Lateral Thinking Edward de Bono Harper & Row Illusions: The Adventures of a Reluctant Messiah Richard Bach Dell Publishing Co. The First and Last Freedom J. Krishnamurti Harper & Row
53 Modification 1: identifiers are added <Catalogue id="BookCatalogue" xmlns=" xmlns:dc=" Lateral Thinking Edward de Bono 1973 Harper & Row Illusions: The Adventures of a Reluctant Messiah Richard Bach 1977 Dell Publishing Co. The First and Last Freedom J. Krishnamurti 1954 Harper & Row Notice that the ISBN elements were deleted and their values used as identifiers. 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.
54 The RDF document <Catalogue rdf:ID="BookCatalogue" xmlns:rdf=" xmlns=" xmlns:dc=" xml:base=" <Book rdf:ID="_ " xml:base=" Lateral Thinking Edward de Bono 1973 Harper & Row <Book rdf:ID="_ " xml:base=" Illusions: The Adventures of a Reluctant Messiah Richard Bach 1977 Dell Publishing Co....
55 Exercise 4: Draw the graph representation of the following rdf <River rdf:about=" xmlns:rdf=" xmlns=" kilometers western China's Qinghai-Tibet Plateau East China Sea
56 RDF and relational database TitleArtistCountryCompanyPriceYear Empire BurlesqueBob DylanUSAColumbia Hide your heartBonnie TylerUKCBS Records <rdf:RDF xmlns:rdf=" xmlns:cd=" Bob Dylan USA Columbia Bonnie Tyler UK CBS Records
57 Properties as Attributes Properties can also be expressed as attributes (instead of elements): <rdf:RDF xmlns:rdf=" xmlns:cd=" <rdf:Description rdf:about=" Burlesque" cd:artist="Bob Dylan" cd:country="USA" cd:company="Columbia" cd:price="10.90" cd:year="1985" /> In the example above, the properties (artist, country, company, price, and year) are expressed as attributes instead of elements.
58 A 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:
59 <River rdf:about=" xmlns:rdf=" xmlns=" kilometers western China's Qinghai-Tibet Plateau East China Sea <River rdf:about=" xmlns:rdf=" xmlns=" Dri Chu - Female Yak River Tongtian He, Travelling-Through-the-Heavens River Jinsha Jiang, River of Golden Sand <River rdf:about=" xmlns:rdf=" xmlns=" kilometers western China's Qinghai-Tibet Plateau East China Sea Dri Chu - Female Yak River Tongtian He, Travelling-Through-the-Heavens River Jinsha Jiang, River of Golden Sand Aggregated Data! Aggregator tool collects data about the Yangtze A distributed network of data!
60 Anonymous resources can’t be aggregated Yangtze 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea Yangtze Dri Chu - Female Yak River Tongtian He, Travelling-Through-the-Heavens River Jinsha Jiang, River of Golden Sand An aggregator tool will not be able to determine if these documents are talking about the same resource. Aggregate
61 RDF Parser There is a nice RDF parser at the W3 Web site: – This RDF parser will tell you if your XML is in the proper RDF format. Altova semanticworks support RDF, RDFS, and OWL.
62 RDF 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.
63 RSS example XML.com XML.com features a rich mix of information and services for the XML community. XML.com …
64 FOAF: Friend of a friend Ontology to describe persons, theirs activities, and relations to other persons. Social semantic web E.g., provide foaf for each researcherE.g., Hans Meier Hans Meier is a software engineer living in Salzburg
SIRI on iphone 4S Spin off of knowledge engineering research Virtual personal assistant No longer simple searches and following links User specifies the task SIRI looks at various sources, integrate the data, and provide the solution Tom Gruber is the co-founder An ontology is a formal, explicit specification of a shared conceptualization --Tom Gruber 65