Presentation is loading. Please wait.

Presentation is loading. Please wait.

RDF: Resource Description Framework Some slides are from Costello and “primer to semantic web”

Similar presentations


Presentation on theme: "RDF: Resource Description Framework Some slides are from Costello and “primer to semantic web”"— Presentation transcript:

1 RDF: Resource Description Framework Some slides are from Costello and “primer to semantic web”

2 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 3 Web Today [Hendler & Miller 02]

4 4 The semantic web

5 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 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 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 8 Contents Ontology Syntax of RDF and RDFS Semantics Applications

9 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 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 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 12 OWL (Web Ontology Language) Lisa therapist isA secretary isA staff therapist subClassOf secretary Disjoint (therapist, secretary) RDF OWL RDFS

13 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="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:mydomain="http://www.mydomain.org/my-rdf-ns#"> David Billington

14 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 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, “http://www.cit.gu.edu.au/DiscreteMath” is a resource that we want to talk about. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:mydomain="http://www.mydomain.org/my-rdf-ns#"> David Billington

16 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="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:mydomain="http://www.mydomain.org/my-rdf-ns#"> David Billington

17 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 18 RDF Example The statement: http://www.example.org/index.html has a creation-date whose value is August 16, 1999 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exterms="http://www.example.org/terms/"> August 16, 1999

19 19 Several statements about the same resource

20 20 Its XML representation A complete representation August 16, 1999 en An abbreviation August 16, 1999 en

21 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 22 Structured Property Values and Blank Nodes Problem with this approach: may generate many intermediate URIRefs.

23 23 Blank Node

24 24 Blank node or anonymous resource

25 25 Corresponding RDF/XML <rdf:RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:dc=“http://purl.org/dc/elements/1.1/” xmlns:exterms="http://example.org/terms/"> RDF/XML Syntax Specification (Revised) Dave Beckett

26 26 Typed literals 27 is an integer or a string?

27 27 A Typed Literal for a Web Page's Creation Date <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exterms="http://www.example.org/terms/"> 1999-08-16

28 28 An Invalid Typed Literal for John Smith's Age

29 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 30 Bag

31 31 Bag (cont.)

32 32 Alt container

33 33 Alt container (cont.)

34 34 RDF Collection A container only says that certain resources are members It does not say that other members do not exist

35 35 RDF 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

36 36 Reification example

37 37 Reification in XML ]> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc=“http://purl.org/dc/elements/1.1/” xmlns:exterms=“http://www.example.com/terms/” xml:base="http://www.example.com/2002/04/products"> 2.4 2.4

38 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 39 Connecting two resources Discrete Mathematics David Billington Associate Professor

40 40 Nested description Discrete Maths David Billington Associate Professor Value-C value of property-A value of property-B

41 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 42 Equivalent Representations <River rdf:ID="Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#" xml:base="http://www.china.org/geography/rivers"> 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea <River rdf:about="http://www.china.org/geography/rivers#Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#"> 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea <rdf:Description rdf:about="http://www.china.org/geography/rivers#Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#"> 6300 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 43 Resource URI = concatenation(xml:base, '#', rdf:ID) = concatenation(http://www.china.org/geography/rivers, '#', "Yangtze") = http://www.china.org/geography/rivers#Yangtze

44 44 <River id="Yangtze" xmlns="http://www.geodesy.org/river" xmlns:uom="http://www.measurements.org/units-of-measure#"> 6300 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="http://www.geodesy.org/river" xmlns:uom="http://www.measurements.org/units-of-measure#"> 6300 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 45 Rdf:value length has two values - 6300 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 46 Anonymous resource <River rdf:ID="Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#" xmlns:uom="http://www.measurements.org/units-of-measure#"> … 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea An anonymous resource

47 47 rdf:parseType="Resource" <River rdf:ID="Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#" xmlns:uom="http://www.measurements.org/units-of-measure#"> 6300 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 48 Equivalent 6300 kilometers 6300 kilometers

49 49 Exercise Modify the following XML document so that it is also a valid RDF document: <River id="Yangtze" xmlns="http://www.geodesy.org/river" xmlns:uom="http://www.measurements.org/units-of-measure#"> 6300 western China's Qinghai-Tibet Plateau East China Sea The Three Gorges Dam 1.5 miles 610 feet $30 billion

50 50 Answer <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#" xmlns:uom="http://www.measurements.org/units-of-measure#" xml:base="http://www.china.org/geography/rivers"> 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea <Dam rdf:ID="ThreeGorges" xmlns="http://www.geodesy.org/dam#"> The Three Gorges Dam 1.5 miles 610 feet $30 billion

51 51 Exercise 2 <Meeting id="XML-Design-Patterns" xmlns="http://www.business.org"> 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="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 3: xmlns="http://www.business.org#" 4: xml:base="http://www.business.org" > 5: 6: 7: 8: John Smith 9: Sally Jones 10: 11: 12: 13:

52 52 Exercise 3 Modify the following XML document so that it is also a valid RDF document: <Catalogue xmlns="http://www.publishing.org#" xmlns:dc="http://pur1.org/metadata/dublin-core#"> Lateral Thinking Edward de Bono 1973 0-06-099325-2 Harper & Row Illusions: The Adventures of a Reluctant Messiah Richard Bach 1977 0-440-34319-4 Dell Publishing Co. The First and Last Freedom J. Krishnamurti 1954 0-06-064831-7 Harper & Row

53 53 Modification 1: identifiers are added <Catalogue id="BookCatalogue" xmlns="http://www.publishing.org#" xmlns:dc="http://pur1.org/metadata/dublin-core#"> 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 54 The RDF document <Catalogue rdf:ID="BookCatalogue" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.publishing.org#" xmlns:dc="http://pur1.org/metadata/dublin-core#" xml:base="http://www.bn.com"> <Book rdf:ID="_0-06-099325-2" xml:base="http://www.publishing.org/book"> Lateral Thinking Edward de Bono 1973 Harper & Row <Book rdf:ID="_0-440-34319-4" xml:base="http://www.publishing.org/book"> Illusions: The Adventures of a Reluctant Messiah Richard Bach 1977 Dell Publishing Co....

55 55 Exercise 4: Draw the graph representation of the following rdf <River rdf:about="http://www.china.org/geography/rivers#Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#"> 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea

56 56 RDF and relational database TitleArtistCountryCompanyPriceYear Empire BurlesqueBob DylanUSAColumbia10.901985 Hide your heartBonnie TylerUKCBS Records9.901988... <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd"> Bob Dylan USA Columbia 10.90 1985 Bonnie Tyler UK CBS Records 9.90 1988

57 57 Properties as Attributes Properties can also be expressed as attributes (instead of elements): <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/cd"> <rdf:Description rdf:about="http://www.recshop.fake/cd/Empire 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 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 59 <River rdf:about="http://www.china.org/geography/rivers#Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#"> 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea <River rdf:about="http://www.china.org/geography/rivers#Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#"> Dri Chu - Female Yak River Tongtian He, Travelling-Through-the-Heavens River Jinsha Jiang, River of Golden Sand <River rdf:about="http://www.china.org/geography/rivers#Yangtze" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#"> 6300 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! http://www.china.org/geography/rivers/yangtze.rdf http://www.encyclopedia.org/yangtze-alternate-names.rdf

60 60 Anonymous resources can’t be aggregated Yangtze 6300 kilometers western China's Qinghai-Tibet Plateau East China Sea http://www.china.org/geography/rivers/yangtze.rdf Yangtze Dri Chu - Female Yak River Tongtian He, Travelling-Through-the-Heavens River Jinsha Jiang, River of Golden Sand http://www.encyclopedia.org/yangtze-alternate-names.rdf An aggregator tool will not be able to determine if these documents are talking about the same resource. Aggregate

61 61 RDF Parser There is a nice RDF parser at the W3 Web site: –http://www.w3.org/RDF/Validatorhttp://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.

62 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 63 RSS example XML.com http://xml.com/pub XML.com features a rich mix of information and services for the XML community. XML.com http://www.xml.com http://xml.com/universal/images/xml_tiny.gif …

64 64 FOAF: Friend of a friend Ontology to describe persons, theirs activities, and relations to other persons. Social semantic web E.g., www.aminer.org provide foaf for each researcherE.g., www.aminer.org Hans Meier Hans Meier is a software engineer living in Salzburg

65 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


Download ppt "RDF: Resource Description Framework Some slides are from Costello and “primer to semantic web”"

Similar presentations


Ads by Google