DESCRIBING DATA
WITH RDF
- Dr. Hoang Huu Hanh, OST – Hue University
hanh-at-hueuni.edu.vn
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)
WITH RDF Based on tutorials and presentations of G. Antoniou, F. - - PowerPoint PPT Presentation
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
hanh-at-hueuni.edu.vn
Based on tutorials and presentations of
2 RDF and RDF Schema
3 RDF and RDF Schema
4 RDF and RDF Schema
5
6 RDF and RDF Schema
7 RDF and RDF Schema
8 RDF and RDF Schema
A resource can be anything that has identity Uniform Resource Identifiers (URI)* provide a
Not all resources are network "retrievable"; e.g.,
9
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.
10 RDF and RDF Schema
11 RDF and RDF Schema
12 RDF and RDF Schema
13 RDF and RDF Schema
14
Subject (resource) http://www.w3.org/Home/Lassila Predicate (property) Creator Object (literal) “Ora Lassila”
15
The individual whose name is Ora Lassila, email <lassila@w3.org>, is the creator of http://www.w3.org/Home/Lassila.
Subject (resource) http://www.w3.org/Home/Lassila Predicate (property) Creator Object (literal) SOMETHING Subject (resource) SOMETHING Predicate (property) Name Object (literal) “Ora Lassila” Subject (resource) SOMETHING Predicate (property) Email Object (literal) lassila@w3.org
16
17
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
19 RDF and RDF Schema
www.ifs.tuwien.ac.at/~hhhanh Hanh H Hoang
20 RDF and RDF Schema
21 RDF and RDF Schema
<rdf:RDF xmlns:rdf="http://www.w3.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>
22 RDF and RDF Schema
An RDF document is represented by an XML
The content of this element is a number of
Every description makes a statement about a
23 RDF and RDF Schema
The rdf:Description element makes a
Within the description
24 RDF and RDF Schema
<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>
25 RDF and RDF Schema
In RDF it is possible to make statements about
Such statements can be used to describe belief
The solution is to assign a unique identifier to
26 RDF and RDF Schema
Introduce an auxiliary object (e.g. belief1) relate it to each of the 3 parts of the original
In the preceding example
27 RDF and RDF Schema
28 RDF and RDF Schema
^^-notation indicates the type of a literal In practice, the most widely used data typing
XML Schema predefines a large range of data
29 RDF and RDF Schema
A Critical View of RDF
30 RDF and RDF Schema
A Critical View of RDF
31 RDF and RDF Schema
A Critical View of RDF
32 RDF and RDF Schema
A Critical View of RDF
33 RDF and RDF Schema
A Critical View of RDF
34 RDF and RDF Schema
35 RDF and RDF Schema
An RDF document consists of an rdf:RDF
A namespace mechanism is used
36 RDF and RDF Schema
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XLMSchema#" xmlns:uni="http://www.mydomain.org/uni-ns"> <rdf:Description rdf:about="949318"> <uni:name>Hanh H Hoang</uni:name> <uni:title>Dr of T echnical Science</uni:title> <uni:age rdf:datatype="&xsd:integer">34<uni:age> </rdf:Description>
37 RDF and RDF Schema
<rdf:Description rdf:about="CIT1111"> <uni:courseName>The Semantic Web</uni:courseName> <uni:isTaughtBy>Hanh H Hoang</uni:isTaughtBy> </rdf:Description> <rdf:Description rdf:about="CIT2112"> <uni:courseName> Programming III</uni:courseName> <uni:isTaughtBy>Michael Maher</uni:isTaughtBy> </rdf:Description> </rdf:RDF>
38 RDF and RDF Schema
39 RDF and RDF Schema
Content of rdf:Description elements
<rdf:Description rdf:about="CIT3116"> <uni:courseName>Knowledge Representation</uni:courseName> <uni:isTaughtBy>Grigoris Antoniou</uni:isTaughtBy> </rdf:Description>
uni:courseName and uni:isTaughtBy define
40 RDF and RDF Schema
The attribute rdf:datatype="&xsd:integer"
<rdf:Description rdf:about="949318"> <uni:name>Hanh H Hoang</uni:name> <uni:title>Dr of T echnical Science</uni:title> <uni:age rdf:datatype="&xsd:integer">34<uni:age> </rdf:Description>
41 RDF and RDF Schema
The age property has been defined to have
42 RDF and RDF Schema
The relationships between courses and
The use of the same name may just be a
We can denote that two entities are the same
43 RDF and RDF Schema
44 RDF and RDF Schema
E.g., to refer the externally defined resource CIT1111:
www.mydomain.org/uni-ns is the URI where the
A description with an ID defines a fragment URI, which
45 RDF and RDF Schema
<rdf:Description rdf:about="CIT1111"> <uni:courseName>The Semantic Web</uni:courseName> <uni:isTaughtBy> <rdf:Description rdf:ID="949318"> <uni:name>Hanh H Hoang</uni:name> <uni:title>Dr of T echnical Science</uni:title> </rdf:Description> </uni:isTaughtBy> </rdf:Description>
46 RDF and RDF Schema
Descriptions may be defined within other
Other courses, such as CIT3112, can still refer
Although a description may be defined within
47 RDF and RDF Schema
<rdf:Description rdf:ID="CIT1111"> <rdf:type rdf:resource="http://www.mydomain.org/uni- ns#course"/> <uni:courseName>The Semantic Web</uni:courseName> <uni:isTaughtBy rdf:resource="#949318"/> </rdf:Description> <rdf:Description rdf:ID="949318"> <rdf:type rdf:resource="http://www.mydomain.org/uni- ns#lecturer"/> <uni:name>Hanh H Hoang</uni:name> <uni:title>Dr of T echnical Science</uni:title> </rdf:Description>
48 RDF and RDF Schema
49 RDF and RDF Schema
50 RDF and RDF Schema
<rdf:Description rdf:ID="CIT1111" uni:courseName="Discrete Maths"> <rdf:type rdf:resource="http://www.mydomain.org/uni- ns#course"/> <uni:isTaughtBy rdf:resource="#949318"/> </rdf:Description>
51 RDF and RDF Schema
52 RDF and RDF Schema
53 RDF and RDF Schema
rdf:Bag an unordered container, allowing
rdf:Seq an ordered container, which may
rdf:Alt a set of alternatives
54 RDF and RDF Schema
55 RDF and RDF Schema
56 RDF and RDF Schema
57 RDF and RDF Schema
A limitation of these containers is that there is
RDF provides support for describing groups
58 RDF and RDF Schema
<rdf:Description rdf:about="#CIT2112"> <uni:isTaughtBy rdf:parseType="Collection"> <rdf:Description rdf:about="#949111"/> <rdf:Description rdf:about="#949352"/> <rdf:Description rdf:about="#949318"/> </uni:isTaughtBy> </rdf:Description>
59 RDF and RDF Schema
60 RDF and RDF Schema
<rdf:Description rdf:about="#949352"> <uni:name>Grigoris Antoniou</uni:name> </rdf:Description>
reifies as
<rdf:Statement rdf:ID="StatementAbout949352"> <rdf:subject rdf:resource="#949352"/> <rdf:predicate rdf:resource="http://www.mydomain.org/ uni-ns#name"/> <rdf:object>GrigorisAntoniou</rdf:object> </rdf:Statement>
61 RDF and RDF Schema
rdf:subject, rdf:predicate and rdf:object
The ID of the statement can be used to refer
We write an rdf:Description if we don’t want
We write an rdf:Statement if we wish to
62 RDF and RDF Schema
63 RDF and RDF Schema
RDF is a universal language that lets users
The user can do so in RDF Schema using:
64 RDF and RDF Schema
We must distinguish between
Individual objects that belong to a class are
The relationship between instances and classes
65 RDF and RDF Schema
Impose restrictions on what can be stated in an
66 RDF and RDF Schema
Discrete Maths is taught by Concrete Maths
Room MZH5760 is taught by David Billington
67 RDF and RDF Schema
Classes can be organized in hierarchies
A subclass graph need not be a tree A class may have multiple superclasses
68 RDF and RDF Schema
69 RDF and RDF Schema
Range restriction: Courses must be taught
Michael Maher is a professor He inherits the ability to teach from the class of
This is done in RDF Schema by fixing the
70 RDF and RDF Schema
71 RDF and RDF Schema
72 RDF and RDF Schema
73 RDF and RDF Schema
74 RDF and RDF Schema
The modelling primitives of RDF Schema are
To declare that “lecturer” is a subclass of
We use the XML-based syntax of RDF
75 RDF and RDF Schema
rdfs:Resource, the class of all resources rdfs:Class, the class of all classes rdfs:Literal, the class of all literals (strings) rdf:Property, the class of all properties. rdf:Statement, the class of all reified
76 RDF and RDF Schema
rdf:type, which relates a resource to its class
rdfs:subClassOf, which relates a class to one
rdfs:subPropertyOf, relates a property to
77 RDF and RDF Schema
rdfs:domain, which specifies the domain of a
rdfs:range, which specifies the range of a
78 RDF and RDF Schema
<rdfs:Class rdf:about="#lecturer"> <rdfs:subClassOf rdf:resource="#staffMember"/> </rdfs:Class> <rdf:Property rdf:ID="phone"> <rdfs:domain rdf:resource="#staffMember"/> <rdfs:range rdf:resource="http://www.w3.org/ 2000/01/rdf-schema#Literal"/> </rdf:Property>
79 RDF and RDF Schema
81
rdfs:Resource rdfs:Class rdf:Property rdfs:Literal rdfs:Datatype rdf:XMLLiteral
RDF and RDF Schema
82 rdfs:Class rdfs:Resource rdf:Property rdfs:Literal rdfs:Datatype rdf:XMLLiteral RDF and RDF Schema
83
rdf:Property rdfs:domain rdf:range rdf:type rdfs:subClassOf rdfs:subPropertyOf
RDF and RDF Schema
rdf:subject, relates a reified statement to its subject rdf:predicate, relates a reified statement to its
rdf:object, relates a reified statement to its object rdf:Bag, the class of bags rdf:Seq, the class of sequences rdf:Alt, the class of alternatives rdfs:Container, which is a superclass of all container
84 RDF and RDF Schema
rdfs:seeAlso relates a resource to another
rdfs:isDefinedBy is a subproperty of
rfds:comment. Comments, typically longer
rdfs:label. A human-friendly label (name) is
85 RDF and RDF Schema
86 RDF and RDF Schema
<rdfs:Class rdf:ID="course"> <rdfs:comment>The class of courses</rdfs:comment> </rdfs:Class> <rdf:Property rdf:ID="isTaughtBy"> <rdfs:comment> Inherits its domain ("course") and range ("lecturer") from its superproperty "involves" </rdfs:comment> <rdfs:subPropertyOf rdf:resource="#involves"/> </rdf:Property>
87 RDF and RDF Schema
<rdf:Property rdf:ID="phone"> <rdfs:comment> It is a property of staff members and takes literals as values. </rdfs:comment> <rdfs:domain rdf:resource="#staffMember"/> <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf- schema#Literal"/> </rdf:Property>
88 RDF and RDF Schema
89 RDF and RDF Schema
90 RDF and RDF Schema
<rdfs:Class rdf:ID="Statement" rdfs:comment="The class of triples consisting of a predicate, a subject and an object (that is, a reified statement)"/> <rdfs:Class rdf:ID="Property" rdfs:comment="The class of properties"/> <rdfs:Class rdf:ID="Bag" rdfs:comment="The class of unordered collections"/>
91 RDF and RDF Schema
<rdf:Property rdf:ID="predicate" rdfs:comment="Identifies the property of a statementin reified form"/> <rdfs:domain rdf:resource="#Statement"/> <rdfs:range rdf:resource="#Property"/> </rdf:Property>
92 RDF and RDF Schema
<rdfs:Class rdf:ID="Resource" rdfs:comment="The most general class"/> <rdfs:Class rdf:ID="Class" rdfs:comment="The concept of classes. All classes are resources"/> <rdfs:subClassOf rdf:resource="#Resource"/> </rdfs:Class>
93 RDF and RDF Schema
<rdf:Property rdf:ID="subPropertyOf"> <rdfs:domain rdf:resource="http://www.w3.org/ 1999/02/22-rdf-syntax-ns#Property"/> <rdfs:range rdf:resource="http://www.w3.org/ 1999/02/22-rdf-syntax-ns#Property"/> </rdf:Property> <rdf:Property rdf:ID="subClassOf"> <rdfs:domain rdf:resource="#Class"/> <rdfs:range rdf:resource="#Class"/> </rdf:Property>
94 RDF and RDF Schema
Consider rdfs:subClassOf
The meaning cannot be expressed in RDF
External definition of semantics required
95 RDF and RDF Schema
RDF provides a foundation for representing and
RDF has a graph-based data model RDF has an XML-based syntax to support
RDF has a decentralized philosophy and allows
114 RDF and RDF Schema
RDF is domain-independent RDF Schema provides a mechanism for
RDF Schema is a primitive ontology language
Key concepts of RDF Schema are class, subclass
There exist query languages for RDF and RDFS
115 RDF and RDF Schema