Mais conteúdo relacionado Semelhante a Chapter 3 semantic web (20) Chapter 3 semantic web2. Introduction
• RDF handles limitations of XML in providing
machine understandable documents.
– Feature of RDF is that it provides better support for
interoperability and describes not only contents of
document but also relationships between various
entities within the document.
• Basic model of RDF has three types:
– resources,
– properties, and
– Statements (Values).
Akerkar: Foundations of © Narosa Publishing House, 2009 2
Semantic Web.
3. Introduction
• RDF has been given a syntax in XML
– This syntax inherits the benefits of XML
– Other syntactic representations of RDF
possible
Akerkar: Foundations of © Narosa Publishing House, 2009 3
Semantic Web.
4. RDF Model
RDF Model
Fundamental Model:
Container Model:
Resources,
Bag, Sequence,
Properties,
Alternative
Statements
Akerkar: Foundations of © Narosa Publishing House, 2009 4
Semantic Web.
5. Introduction
• Example 3.1: Typical parts of URIs are,
http://www.tmrfindia.in:8080/secret/top.jsp?id=12&from=2
|Scheme|----------Host--------------|-Port--|---------Path-----------|-----Query-------|
|---------------------------------Scheme-specific part---------------------------|
Akerkar: Foundations of © Narosa Publishing House, 2009 5
Semantic Web.
6. Introduction
• Definition 3.1 : Resource Description Framework (RDF) is a
framework that can be used in many different contexts to achieve
different goals.
• RDF model is a combination of three parts, namely:
– Resource: Any entity that has to be described is known as Resource or
Object. It can be a ‘Web page’ on Internet or an ‘individual’ in a
community.
– Property: Any characteristic of Resource or its attribute, which is used
for the description of the same, is known as Property or Predicate. For
example, a Web page may be known by ‘Title’ or an individual is
recognized by his ‘Name’. Thus, both are attributes for recognition of
Resource ‘Web page’ and ‘individual’, respectively.
– Value: A Property must have a value. For instance, the title of an
Organization Web page is ‘TQ Pioneer Ltd.’, or name of an individual is
‘Gopal’.
Akerkar: Foundations of © Narosa Publishing House, 2009 6
Semantic Web.
7. Example 3.2
• The triple in Figure 3.2 can be interpreted as Gopal is
the creator of the resource
http://www.tmrfindia.org/main.html.
– Here subject (resource) is http://www.tmrfindia.org/main.html and
predicate (property) is http://purl.org/dc/Creator
http://
mailto:gopal@tmrf
www.tmrfindia.org/ http://purl.org/DC/Creator
india.org
main.html
Akerkar: Foundations of © Narosa Publishing House, 2009 7
Semantic Web.
8. Example 3.3
• The RDF directed graph that a resource may
have more than one value for a given property.
http://
mailto:gopal@
www.tmrfindia. http://purl.org/dc/Creator
tmrfindia.org
org/main.html
http://www.example.in/ http://www.example.in/
schema/include schema/colleague
http://purl.org/dc/Creator
http:// mailto:gita@
www.tmrfindia. tmrfindia.org
org/logo.jpeg
Akerkar: Foundations of © Narosa Publishing House, 2009 8
Semantic Web.
9. Vocabulary
• A vocabulary is a list of predefined values.
• rdf:Resource
– It is an attribute of a property element.
• rdf:Property
– The properties are special type of resources
used as predicate of triples; the semantics of
a triple clearly depends on the property used
as predicate.
Akerkar: Foundations of © Narosa Publishing House, 2009 9
Semantic Web.
10. Vocabulary
• rdf:Statement
– A statement is a resource reifying a triple. It
emphasizes the properties of resources
• rdfs:subPropertyOf
– Any property denotes a relation between resources.
rdfs:subPropertyOf applies to properties
• rdfs:Class, rdf:type and rdfs:subClassOf
– Classes are resources denoting a set of resources, by
the mean of the property rdf:type (instances have
property rdf:type valued by the class). All properties
have rdf:type valued by rdf:Property.
Akerkar: Foundations of © Narosa Publishing House, 2009 10
Semantic Web.
11. Vocabulary
• rdfs:domain and rdfs:range
– rdfs:domain is a property used to indicate
that a particular property applies to a
designated class (i.e. domain of the property).
– rdfs:range is a property used to indicate that
the values of a particular property are
instances of designated class.
Akerkar: Foundations of © Narosa Publishing House, 2009 11
Semantic Web.
12. Vocabulary
• rdfs:Literal
– rdfs:Literal, denoting the set of literals, is
declared as a class. Its intended use is to be
the range of properties.
• rdfs:Container
– Containers are collections of resources.
Akerkar: Foundations of © Narosa Publishing House, 2009 12
Semantic Web.
13. Example 3.8
• Here we present a simple XML syntax.
<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/"
xmlns:os="http://www.example.in/schema/">
<rdf:Description about="http://www.tmrfindia.org/main.html">
<dc:Creator rdf:resource="mailto:gita@tmrfindia.org"/>
<dc:Title> Main Website </dc:Title>
<dc:Creator>
<rdf:Description about="mailto:gopal@tmrfindia.org">
<os:colleague rdf:resource="mailto:gita@tmrfindia.org"/>
</rdf:Description>
</dc:Creator>
</rdf:Description>
</rdf:RDF>
Akerkar: Foundations of © Narosa Publishing House, 2009 13
Semantic Web.
14. XML Syntax
http://
mailto:gopal@tmrf
www.tmrfindia.org http://purl.org/dc/Creator
india.org
/main.html
http://www.example.in/
schema/colleague
http://purl.org/dc/Creator
http://www.purl.org/dc/Main
mailto:gita@tmrf
india.org
Main Website
Akerkar: Foundations of © Narosa Publishing House, 2009 14
Semantic Web.
15. Example 3.10
• Illustrate a diagram to representing the following statements in RDF
data model: The creator of the resource http://www.hotmail.com is
Sabeer Bhatia.
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:s="http://description.org/schema/">
<rdf:Description rdf:about="http://www.hotmail.com">
<s:Creator>Sbeer Bhatia</s:Creator>
</rdf:Description>
</rdf:RDF> http://
http://www.description.org/ Sabeer
www.hotmail.
schema/Creator Bhatia
com
Akerkar: Foundations of © Narosa Publishing House, 2009 15
Semantic Web.
16. Example 3.11
<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-
http:// http://
rdf-syntax-ns#"> www.tmrfindia.org rdf_1 www.tmrfindia.org/
/main.html main.html
<rdf:Bag ID="mybag">
<rdf:li resource="http://www.tmrfindia.org
/main.html"/> rdf_3
<rdf:li rdf_2
resource="mailto:gopal@tmrfindia.org"/>
<rdf:li> XYZ </rdf:li> mailto:gopal@tmrf
india.org
"XYZ"
</rdf:Bag>
</rdf:RDF>
Akerkar: Foundations of © Narosa Publishing House, 2009 16
Semantic Web.
17. Example 3.12
• The description is,
<rdf:Description rdf:ID=”ding”>
<library:name>R. Akerkar</library.name>
</rdf:description>
• This can be refined as below, where rdf:subject,
rdf:predicate, rdf:object allow us to access the parts of a
statement.
<rdf:Statement rdf:ID=”StatementIDding”>
<rdf:subject rdf:resource=”ding”/>
<rdf:predicate rdf:resorce=”&library;name”/>
<rdf:object>R. Akerkar</rdf:object>
</rdf:Statement>
Akerkar: Foundations of © Narosa Publishing House, 2009 17
Semantic Web.
18. Example 3.13
s:Creator
http://www.tmrfindia.org/main.html
rdf:subject
rdf:predicate s:Creator
rdf:type rdf:object
rdf:Statement
b:believed
Amit Gopal
Akerkar: Foundations of © Narosa Publishing House, 2009 18
Semantic Web.
19. RDF Schema
• Example 3.16: In the following schema, the resource
"car" is a subclass of the class "vehicle".
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf= "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base= "http://www.vehicle.org/vehicles#">
<rdf:Description rdf:ID="vehicle">
<rdf:type
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
</rdf:Description>
<rdf:Description rdf:ID="car">
<rdf:type
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="#vehicle"/>
</rdf:Description>
</rdf:RDF>
Akerkar: Foundations of © Narosa Publishing House, 2009 19
Semantic Web.
20. RDF Schema
• Previous example is modified with the help of rdfs:Class
instead of rdf:Description, and drop the rdf:type
information.
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf= "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base= "http://www.vehicle.org/vehicles#">
<rdfs:Class rdf:ID="vehicle" />
<rdfs:Class rdf:ID="car">
<rdfs:subClassOf rdf:resource="#vehicle"/>
</rdfs:Class>
</rdf:RDF>
Akerkar: Foundations of © Narosa Publishing House, 2009 20
Semantic Web.
21. Query Languages
• Basic approaches to query RDF metadata:
– SQL style approach that considers RDF metadata as a
relational or XML database and derives API methods to
query the object classes.
– Knowledge Representation style approach that considers
the link structure illustrated by RDF metatdata as a Web
knowledge base and further applies knowledge
representation and reasoning technologies on it.
Akerkar: Foundations of © Narosa Publishing House, 2009 21
Semantic Web.
22. Query Languages
– RQL
– SeRQL
– Triple
– RDQL
– Rule ML
Akerkar: Foundations of © Narosa Publishing House, 2009 22
Semantic Web.
24. RDF Disadvantages
– The RDF format restricts you on how you
design your XML.
– RDF uses namespaces to uniquely identify
types (classes), properties, and resources.
– In order to use the RDF format, you have to
learn the extensive RDF vocabulary.
Akerkar: Foundations of © Narosa Publishing House, 2009 24
Semantic Web.
25. Suggested Readings
1. R. Akerkar and P. Lingras. Building an Intelligent Web: Theory
& Practice, Johns & Bartlett, 2007.
2. T. Berners-Lee, R. Fielding, U.C. Irvine, and L. Masinter.
Uniform Resource Identifiers (URI): Generic Syntax.
urn:ietf:rfc:2396, 1998.
3. D. Brickley and R.V. Guha. Resource Description Framework
(RDF) Schema Specification, W3C proposed
recommendation, 1999.
4. R. Fikes and D. L McGuinness. An Axiomatic Semantics for
RDF, RDF Schema, and DAML-ONT. KS Lab, Stanford
University, 2001.
5. O. Lassila and R. R. Swick. Resource Description Framework
(RDF) Model and Syntax Specification, W3C recommendation,
1999.
Akerkar: Foundations of © Narosa Publishing House, 2009 25
Semantic Web.