Dr. Hoang Huu Hanh, OST – Hue University hanh-at-hueuni.edu.vn D ESCRIBING D ATA WITH RDF Based on tutorials and presentations of G. Antoniou, F. van Harmelen (ICS), O. Lassila, R.R. Swick, J. Cowan, D. Brickley, R.V. Guha (W3C)
Lecture Outline 1. Basic Ideas of RDF 2. XML-based Syntax of RDF 3. Basic Concepts of RDF Schema 4. Τ he Language of RDF Schema 5. The Namespaces of RDF and RDF Schema 6. Axiomatic Semantics for RDF and RDFS 7. Direct Semantics based on Inference Rules RDF and RDF Schema 2
Drawbacks of XML XML is a universal metalanguage for defining markup It provides a uniform framework for interchange of data and metadata between applications However, XML does not provide any means of talking about the semantics (meaning) of data E.g., there is no intended meaning associated with the nesting of tags ◦ It is up to each application to interpret the nesting. RDF and RDF Schema 3
Nesting of Tags in XML Hanh H Hoang is a lecturer of The Semantic Web <course name=“The Semantic Web"> <lecturer>Hanh H Hoang</lecturer> </course> <lecturer name=“Hanh H Hoang"> <teaches>The Semantic Web</teaches> </lecturer> Opposite nesting, same information! RDF and RDF Schema 4
What is RDF ? Resource Description Framework (RDF) is a foundation for processing metadata in the Web; It provides interoperability between applications that exchange machine- understandable information on the Web; RDF emphasises facilities to enable automated processing of Web resources; It is a mechanism for describing resources that makes no assumptions about a particular application domain. 5
Basic Ideas of RDF Basic building block: object-attribute-value triple ◦ It is called a statement ◦ Sentence about Billington is such a statement RDF has been given a syntax in XML ◦ This syntax inherits the benefits of XML ◦ Other syntactic representations of RDF possible RDF and RDF Schema 6
Basic Ideas of RDF (2) The fundamental concepts of RDF are: ◦ resources ◦ properties ◦ statements RDF and RDF Schema 7
Resources We can think of a resource as an object, 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 RDF and RDF Schema 8
Resources and URIs A resource can be anything that has identity Uniform Resource Identifiers (URI)* provide a simple and extensible means for identifying a resource Not all resources are network "retrievable"; e.g., human beings, corporations, and books in a library can also be considered resources * The term "Uniform Resource Locator" (URL) refers to the subset of URI that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource. 9
Properties Properties are a special kind of resources They describe relations between resources ◦ E.g. “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 and RDF Schema 10
Statements Statements assert the properties of resources A statement is a subject-predicate-object triple ◦ It consists of a resource, a property, and a value Values can be resources or literals ◦ Literals are atomic values (strings) RDF and RDF Schema 11
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 RDF and RDF Schema 12
Statements as Triples (“Hanh H Hoang”, http://www.mydomain.org/site-owner, http://www.ifs . tuwien . ac . at /~ hhhanh ) The triple (x,P ,y) can be considered as a logical formula P(x,y) ◦ Binary predicate P relates object x to object y ◦ RDF offers only binary predicates (properties) RDF and RDF Schema 13
Example of RDF Statement Ora Lassila is the creator of the resource http://www.w3.org/Home/Lassila. Subject (resource) http://www.w3.org/Home/Lassila Predicate (property) Creator Object (literal) “Ora Lassila” 14
Property with Structural Value Example (1) The individual whose name is Ora Lassila, email <lassila@w3.org>, is the creator of http://www.w3.org/Home/Lassila. 15
Property with Structural Value Example (2) Subject (resource) http://www.w3.org/Home/Lassila Predicate (property) Creator Object (literal) SOMETHING SOMETHING Subject (resource) Name Predicate (property) “Ora Lassila” Object (literal) Subject (resource) SOMETHING Predicate (property) Email Object (literal) lassila@w3.org 16
Property with Structural Value Example (3) The individual referred to by employee id 85740 is named Ora Lassila and has the email address lassila@w3.org. The resource http://www.w3.org/Home/Lassila was created by this individual. 17
Property with Structural Value Example (4) Subject (resource) http://www.w3.org/Home/Lassila Predicate (property) Creator Object (resource) http://www.w3.org/staffid/85740 Subject (resource) http://www.w3.org/staffid/85740 Predicate (property) Name Object (literal) “Ora Lassila” Subject (resource) http://www.w3.org/staffid/85740 Predicate (property) Email Object (literal) lassila@w3.org 18
XML Vocabularies www.ifs.tuwien.ac.at/~hhhanh Hanh H Hoang A directed graph with labeled nodes and arcs ◦ from the resource (the subject of the statement) ◦ to the value (the object of the statement) Known in AI as a semantic net The value of a statement may be a resource ◦ Ι t may be linked to other resources RDF and RDF Schema 19
A Set of Triples as a Semantic Net RDF and RDF Schema 20
Statements in XML Syntax Graphs are a powerful tool for human understanding but The Semantic Web vision requires machine-accessible and machine- processable representations There is a 3rd representation based on XML ◦ But XML is not a part of the RDF data model ◦ E.g. serialisation of XML is irrelevant for RDF RDF and RDF Schema 21
Statements in XML (2) <rdf:RDF xmlns : rdf =" http :// www . w 3. org /1999/02/22- rdf - syntax - ns #" xmlns : mydomain =" http :// www . mydomain . org / my - rdf - ns "> <rdf:Description rdf:about=" http://www.ifs . tuwien . ac . at /~ hhhanh "> <mydomain:site-owner> Hanh H Hoang </mydomain:site-owner> </rdf:Description> </rdf:RDF> RDF and RDF Schema 22
Statements in XML (3) An RDF document is represented by an XML element with the tag rdf:RDF The content of this element is a number of descriptions, which use rdf:Description tags. Every description makes a statement about a resource, identified in 3 ways: ◦ an about attribute, referencing an existing resource ◦ an ID attribute, creating a new resource ◦ without a name, creating an anonymous resource (blank node) RDF and RDF Schema 23
Statements in XML (4) The rdf:Description element makes a statement about the resource http://www.ifs . tuwien . ac . at /~ hhhanh Within the description ◦ the property is used as a tag ◦ the content is the value of the property RDF and RDF Schema 24
Statements in XML (5) <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:md="http://www.mydomain.org/my-rdf-ns"> <rdf:Description rdf:about="http://www.ifs . tuwien . ac . at /~ hhhanh"> <md:site-owner> David Billington </md:site-owner> </rdf:Description> </rdf:RDF> RDF and RDF Schema 25
Reification In RDF it is possible to make statements about statements ◦ Tim believes that Hanh H Hoang is the creator of http://www.ifs.tuwien.ac.at/~hhhanh 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 RDF and RDF Schema 26
Reification (2) 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 Hanh H Hoang ◦ predicate of belief1 is creator ◦ object of belief1 is http://www.ifs.tuwien.ac.at/~hhhanh RDF and RDF Schema 27
Data Types Data types are used in programming languages to allow interpretation In RDF, typed literals are used, if necessary (“Hanh H Hoang”, http://www.mydomain.org/age, “34”^^http://www.w3.org/2001/XMLSche ma#integer) RDF and RDF Schema 28
Data Types (2) ^^ -notation indicate s the type of a literal In practice, the most widely used data typing scheme will be the one by XML Schema ◦ But the use of any externally defined data typing scheme is allowed in RDF documents XML Schema predefines a large range of data types ◦ E.g. Booleans, integers, floating-point numbers, times, dates, etc. RDF and RDF Schema 29
Recommend
More recommend