“The Semantic Web is a vision: the idea of having data on the Web defined and linked in a way that it can be used by machines not just for display purposes, but for automation, integration and reuse of data across various applications”
1. SSeemmaannttiicc WWeebb::
SSttaattee ooff tthhee AArrtt aanndd OOppppoorrttuunniittiieess
Aatif Hussain Warraich
Compiled, partly based on various online tutorials
and presentations, with respect to their authors
University of Engineering and Technology, Lahore
2. Where we are Today:
the Syntactic Web
[Hendler & Miller 02]
5. AApppprrooaacchh:: SSeemmaannttiicc WWeebb
“The Semantic Web is a vision: the idea of having data on the
Web defined and linked in a way that it can be used by
machines not just for display purposes,
but for automation, integration and reuse
of data across various applications”
http://www.w3.org/sw/
The Semantic Web is an initiative with the goal of extending the
current Web and facilitating Web automation, universally accessible
web resources, and the 'Web of Trust', providing a universally
accessible platform that allows data to be shared and processed by
automated tools as well as by people.
8. SSeemmaannttiicc WWeebb:: NNeeww ““UUsseerrss””
Semantic Users
Web and
Beyond
Semantic
Annotations Ontologies Logical Support
Languages Tools Applications /
Services
WWW Creators Users
and
Beyond
Web content
Semantic
Web
Semantic Web
content
Creators
applications
agents
9. Semantic Web: Annotations
Semantic Users
Web and
Beyond
Semantic
Annotations Ontologies Logical Support
Languages Tools Applications /
Services
WWW Creators Users
and
Beyond
Web content
Semantic
Web
Semantic Web
content
Creators
applications
agents
Semantic annotations are
specific sort of metadata,
which provides information
about particular domain
objects, values of their
properties and relationships,
in a machine-processable,
formal and standardized way.
10. Semantic Web: Ontologies
Semantic Users
Web and
Beyond
Semantic
Annotations Ontologies Logical Support
Languages Tools Applications /
Services
WWW Creators Users
and
Beyond
Web content
Semantic
Web
Semantic Web
content
Creators
applications
agents
Ontologies make metadata
interoperable and ready for
efficient sharing and reuse. It
provides shared and common
understanding of a domain, that
can be used both by people and
machines. Ontologies are used as
a form of agreement-based
knowledge representation about
the world or some part of it and
generally describe: domain
individuals, classes, attributes,
relations and events.
11. Semantic Web: Rules
Semantic Users
Web and
Beyond
Semantic
Annotations Ontologies Logical Support
Languages Tools Applications /
Services
WWW Creators Users
and
Beyond
Web content
Semantic
Web
Semantic Web
content
Creators
applications
agents
Logical support in form of rules is needed to
infer implicit content, metadata and ontologies
from the explicit ones. Rules are considered to
be a major issue in the further development of
the semantic web. On one hand, they can be
used in ontology languages, in conjunction with
or as an alternative to description logics. And on
the other hand, they will act as a means to draw
inferences, to configure systems, to express
constraints, to specify policies, to react to
events/changes, to transform data, to specify
behavior of agents, etc.
12. Semantic Web: Languages
Semantic Users
Web and
Beyond
Semantic
Annotations Ontologies Logical Support
Languages Tools Applications /
Services
WWW Creators Users
and
Beyond
Web content
Semantic
Web
Semantic Web
content
Creators
applications
agents
Languages are needed for machine-processable
formal descriptions of: metadata (annotations) like
e.g. RDF; ontologies like e.g. OWL.; rules like e.g.
RuleML. The challenge is to provide a framework for
specifying the syntax (e.g. XML) and semantics of
all of these languages in a uniform and coherent
way. The strategy is to translate the various
languages into a common 'base' language (e.g. CL
or Lbase) providing them with a single coherent
model theory.
13. Semantic Web: Tools
Semantic Users
Web and
Beyond
Semantic
Annotations Ontologies Logical Support
Languages Tools Applications /
Services
WWW Creators Users
and
Beyond
Web content
Semantic
Web
Semantic Web
content
Creators
applications
agents
User-friendly tools are needed for
metadata manual creation (annotating
content) or automated generation, for
ontology engineering and validation,
for knowledge acquisition (rules), for
languages parsing and processing,
etc.
14. Semantic Web: Applications and Services
Semantic Users
Web and
Beyond
Semantic
Annotations Ontologies Logical Support
Languages Tools Applications /
Services
WWW Creators Users
and
Beyond
Web content
Semantic
Web
Semantic Web
content
Creators
applications
agents
Utilization of Semantic Web
metadata, ontologies, rules,
languages and tools enables to
provide scalable Web applications
and Web services for consumers
and enterprises" making the web
'smarter' for people and machines.
15. The Semantic Web
The Ontology Articulation
Toolkit helps agents to
understand unknown ontologies
16. Semantic Web basics…
RDF:
• is a W3C standard, which provides tool to describe Web
resources
• provides interoperability between applications that
exchange machine-understandable information
RDF Schema:
– is a W3C standard which defines vocabulary for RDF
– organizes this vocabulary in a typed hierarchy
– capable to explicitly declare semantic relations between
vocabulary terms
17. RDF – Semantic Web over Web Resources
Mary
Director
Secretary
has_job
to_be_in_
love_with
has_job
John
has_homepage
has_homepage
OOnnttoollooggyy
18. Resources
• All things being described by RDF
expressions are called resources:
– entire Web page;
– a specific XML element;
– whole collection of pages;
– an object that is not directly accessible via the
Web.
20. Semantic Relation as RDF statement
(so called “object property”)
Personal web page of Terziyan V. Web page of Agora Center
27
Lk
Ai Aj
Relation (i ¹ j)
http://www.cs.jyu.fi/ai/vagan/index.html http://www.jyu.fi/agora-center/indexEng.html
refers_to
Resource
Relation
Resource
Subject Predicate object
URI of Terziyan V. employed_by
http://www.cs.jyu.fi/ai/vagan/#vagan
URI of Agora Center
http://www.jyu.fi/agora-center/#AC
Dereferenceable URI (“Hash vs. Slash”)
21. Semantic Property as RDF statement
(so called “datatype property”)
28
Personal web page of Terziyan V.
http://www.cs.jyu.fi/ai/vagan/index.html
Literal
Literal
Resource
has_birthday
Property
Subject Predicate object
Ai
Lk
Property (i = j)
15.02.2000
“Birthday” of the web-page
URI of Terziyan V. has_birthday
http://www.cs.jyu.fi/ai/vagan/#vagan
27.12.1958
Dereferenceable URI (“Hash vs. Slash”)
Birthday of Terziyan V.
22. Semantic Network of Web Resources
15.02.2000
has_birthday
Personal web page of Terziyan V. Web page of Agora Center
http://www.cs.jyu.fi/ai/vagan/index.html http://www.jyu.fi/agora-center/indexEng.html
29
refers_to
isWebPageOf
27.12.1958 isWebPageOf
URI of Terziyan V. employed_by URI of Agora Center
http://www.cs.jyu.fi/ai/vagan/#vagan
http://www.jyu.fi/agora-center/#AC
hasWebPage
hasWebPage
has_birthday
23. http://www.kture.kharkov.ua/
30
From Hyperlinks to Semantic Web
http://www.cs.jyu.fi/ai/ university
international
_contacts
http://www.cs.jyu.fi/ai/contacts.html
24. 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.
25. URI vs. URL
A URI represents a single concept or thing,
but many URIs can represent the same thing.
All URLs are URIs. Not all URIs are URLs.
URI identifies something uniquely.
URL not only identifies something, but also
describes where it is located.
Venn diagram of Uniform Resource Identifier (URI) scheme categories.
Schemes in the URL (locator) and URN (name) categories both
function as resource IDs, so URL and URN are subsets of URI. They
are also, generally, disjoint sets. However, many schemes can't be
categorized as strictly one or the other, because all URIs can be
treated as names, and some schemes embody aspects of both
categories – or neither.
26. URL vs. URI example
URI of Vagan Terziyan in Nordea Database:
http://www.NordeaDB.fi/#VaganTerziyan
URI of Vagan Terziyan in the Central Hospital
Database:
http://www.JKL_Central_Hospital_DB.fi/#VaganTerziyan
URL of Vagan Terziyan record in Nordea Database:
http://www.NordeaDB.fi/VaganTerziyanRecord
URL of Vagan Terziyan record in the Central Hospital Database:
http://www.JKL_Central_Hospital_DB.fi/VaganTerziyanRecord
?
27. Dereferenceable URI
The term Linked Data is used to describe a method of exposing, sharing,
and connecting data via dereferenceable* URIs on the Web.
Linked Data is about using the Web to connect related data that wasn’t
previously linked, or using the Web to lower the barriers to linking data
currently linked using other methods. More specifically, Wikipedia defines
Linked Data as a term used to describe a recommended best practice for
exposing, sharing, and connecting pieces of data, information, and knowledge
on the Semantic Web using URIs and RDF. Linked Data aims to extend the
Web with a data commons by publishing various open datasets as RDF on the
Web and by setting RDF links between data items from different data sources.
*A dereferenceable Uniform Resource Identifier or dereferenceable URI
is a resource retrieval mechanism that uses any of the internet protocols (e.g.
HTTP) to obtain a copy or representation of the resource it identifies. In the
context of traditional HTML web pages, this is the normal and obvious way of
working: A URI refers to the page, and when requested the web server
returns a copy of it. In other non-dereferenceable contexts, such as XML
Schema, the namespace identifier is still a URI, but this is simply an identifier
(i.e. a namespace name). There is no intention that this can or should be
dereferenced. There is even a separate attribute, schemaLocation, which
may contain a dereferenceable URI that does point to a copy of the schema
document. In the case of Linked Data, the representation takes the form of a
document (typically HTML or XML) that describes the resource that the URI
identifies. In either case, the mechanism makes it possible for a user (or
software agent) to "follow your nose" to find out more information related to
the identified resource.
http://www.ted.com/talks/tim_berners_lee_on_the_next_web.html
28. Relationships between URIs illustrated
The picture shows a Big Lynx film team at work. Within the picture, Big Lynx Lead Cameraman Matt
Briggs as well as his two assistants, Linda Meyer and Scott Miller, are identified by HTTP URIs from
the Big Lynx namespace. The relationship, that they know each other, is represented by connecting
lines having the relationship type http://xmlns.com/foaf/0.1/knows.
[source: http://linkeddatabook.com/editions/1.0/ ]
29. RDF Statement
• Subject of an RDF statement is a
resource
• Predicate of an RDF statement is a
property of a resource
• Object of an RDF statement is the value
of a property of a resource
30. 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”
Lets represent the above statement in RDF/XML in accordance with the
“serialization” and the “abbreviated” syntax (see next slides):
31. RDF Example in serialization syntax
(subject of statement)
Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila.
<rdf:RDF>
<rdf:Description rdf:about=
"http://www.w3.org/Home/Lassila">
<s:Creator>Ora Lassila</s:Creator>
</rdf:Description>
</rdf:RDF>
Subject
32. RDF Example in serialization syntax
(predicate of statement)
Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila.
<rdf:RDF>
<rdf:Description rdf:about=
"http://www.w3.org/Home/Lassila">
<s:Creator>Ora Lassila</s:Creator>
</rdf:Description>
</rdf:RDF>
Predicate
33. RDF Example in serialization syntax
(object of statement)
Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila.
<rdf:RDF>
<rdf:Description rdf:about=
"http://www.w3.org/Home/Lassila">
<s:Creator>Ora Lassila</s:Creator>
</rdf:Description>
</rdf:RDF>
Object
34. RDF Example in serialization syntax
(reference to ontology)
Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila.
<rdf:RDF>
<rdf:Description rdf:about=
"http://www.w3.org/Home/Lassila">
<s:Creator>Ora Lassila</s:Creator>
</rdf:Description>
</rdf:RDF> a specific namespace prefix as reference to
ontology where predicates are defined, e.g.
xmlns: s="http://description.org/schema/"
35. Full XML Document in serialization syntax
for the Example
<?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.w3.org/Home/Lassila">
<s:Creator>Ora Lassila</s:Creator>
</rdf:Description>
</rdf:RDF>
Namespaces
36. Template/frame for RDF/XML statement (1)
Subject (URI)
p Ontology (URI)
Value
p Predicat p
e
Predicat
e
Value
Predicate
Subject
37. Template/frame for RDF/XML statement (2)
p Ontology (URI)
p
Subject (URI)
Object (URI)
Predicate
Subject Object
39. Abbreviated Syntax Example (1)
Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila.
<rdf:RDF>
<rdf:Description rdf:about="http://www.w3.org/Home/Lassila"
s:Creator="Ora Lassila" />
</rdf:RDF>
<?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.w3.org/Home/Lassila"
s:Creator="Ora Lassila"/>
</rdf:RDF>
40. Abbreviated Syntax Example (2)
Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila. Subject
<rdf:Description rdf:about="http://www.w3.org/Home/Lassila"
s:Creator="Ora Lassila" />
41. Abbreviated Syntax Example (3)
Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila.
<rdf:Description rdf:about="http://www.w3.org/Home/Lassila"
s:Creator ="Ora Lassila" />
Predicate
42. Abbreviated Syntax Example (4)
Ora Lassila is the creator of the resource
http://www.w3.org/Home/Lassila.
<rdf:Description rdf:about="http://www.w3.org/Home/Lassila"
s:Creator="Ora Lassila" />
Object
43. Template/frame for RDF statement
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns: = " " >
<rdf:Description rdf:about= " “ "
: = " " />
</rdf:RDF>
Ontology (URI)
Predicat Value
e
prefix
Subject
(URI)
prefi
x
Value
Predicate
Subject
44. RDF N3 syntax
• Notation3, or N3 as it is more commonly known, is a
shorthand non-XML serialization of RDF models,
designed with human-readability in mind: N3 is much
more compact and readable than XML RDF notation.
The format is being developed by Tim Berners-Lee
and others from the Semantic Web community.
RDF sample in
XML notation
RDF sample
in N3 notation
http://www.w3.org/TeamSubmission/n3/
45. RDF N3 syntax
Some fast hints:
All URIs are quoted with angle brackets ( “<“ and “>” ).
Whitespace within the < > is to be ignored.
All values are within " " .
Each statement ends with “.”
@pref is used to define the namespace prefix.
[ ] are used for the “blank nodes”.
Check all in : http://www.w3.org/TeamSubmission/n3/
Shorthand:
Example:
@PREFIX dc: <http://purl.org/dc/elements/1.1/> .
<http://en.wikipedia.org/wiki/Tony_Benn>
dc:publisher
"Wikipedia" .
Square brackets for blank nodes:
[ pl ] means x, where there exists some x such that x has properties in the property list pl. For example:
[ :firstname "Ora" ] dc:wrote [ dc:title "Moby Dick" ] .
… is a statement which would be means in math:
exists x, y . firstname(x, "Ora") & dc:wrote(x,y) & dc:title (y, "Moby Dick")
… or in English "Some person who has a first name Ora wrote a book entitled "Moby Dick". Note not
"the book" or "the person".
46. Template/frame for RDF statement (N3)
Predicate
Subject Object
Predicate
OR
Subject Value
Subject
< (URI) > < Predicate (URI) > < Object (URI) > .
OR
Subject
(URI) < > < Predicate (URI) > " Value " .
OR
@prefix Onto:
< Ontology (URI) > .
Onto : Subject Onto : Predicate Onto : Object .
Onto : Subject Onto : Predicate " Value " .
47. Some N3 syntax specifics
http://www.w3.org/TeamSubmission/n3/
Ontological statements in N3
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:Professor a rdfs:Class .
<http://www.cs.jyu.fi/ai/vagan> a :Professor .
48. RDF N3 examples
The story 4 RDF (N3) statements
1. Gender of Vagan Terziyan is male.
2. His mother is Svetlana Terziyan.
3. He is fun of fishing.
4. He is fun of Nordic walking.
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#hasGender >
"male" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#hasMother>
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#SvetlanaTerziyan
> .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
"Fishing" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
"NordicWalking" .
49. RDF N3 examples
1. Gender of Vagan Terziyan is male.
2. His mother is Svetlana Terziyan.
3. He is fun of fishing.
4. He is fun of Nordic walking.
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#hasGender >
"male" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#hasMother>
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#SvetlanaTerziyan
> .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
"Fishing" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
"NordicWalking" .
Reader-friendly version
@prefix On1: <http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#> .
@prefix On2: <http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#> .
On1:VaganTerziyan On1:hasGender "male" .
On1:VaganTerziyan On1:hasMother On1:SvetlanaTerziyan .
On1:VaganTerziyan On2:isFunOf "Fishing" .
On1:VaganTerziyan On2:isFunOf "NordicWalking" .
50. RDF N3 examples
1. Gender of Vagan Terziyan is male.
2. His mother is Svetlana Terziyan.
3. He is fun of fishing.
4. He is fun of Nordic walking.
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#hasGender >
"male" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#hasMother>
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#SvetlanaTerziyan
> .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
"Fishing" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
"NordicWalking" .
Compact version
@prefix On1: <http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#> .
@prefix On2: <http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#> .
On1:VaganTerziyan On1:hasGender "male" ; On1:hasMother On1:SvetlanaTerziyan ;
On2:isFunOf "Fishing" , "NordicWalking" .
54. RDF/N3 example (blank node with [ ])
1. Gender of Vagan Terziyan is male.
2. His mother is Svetlana Terziyan.
3. He is fun of fishing.
4. He is fun of Nordic walking.
5. He is fun of mother’s hobby.
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#hasGender >
"male" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#hasMother>
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#SvetlanaTerziyan
> .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
"Fishing" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
"NordicWalking" .
<http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#VaganTerziyan> <
http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isFunOf>
[<http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#isHobbyOf> <
http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#SvetlanaTerziyan>].
Compact version
@prefix On1: <http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#> .
@prefix On2: <http://www.cs.jyu.fi/ai/vagan/ontologies/LifeInFinland.owl#> .
On1:VaganTerziyan On1:hasGender "male" ; On1:hasMother On1:SvetlanaTerziyan ;
On2:isFunOf "Fishing" , "NordicWalking" , [On2:isHobbyOf On1:SvetlanaTerziyan ] .
55. … lets translate it to RDF/XML …
http://rdf-translator.appspot.com/
56. … and check with RDF/XML validator
http://www.w3.org/RDF/Validator/
57. What is an ontology?
Studer(98): Formal, explicit specification of a shared conceptualization
Machine
readable
Concepts, properties,
functions, axioms
are explicitly defined
Consensual
knowledge
Abstract model of
some domain
58. 66
What is an Ontology?
A model of (some aspect of) the world
• Introduces vocabulary
relevant to domain, e.g.:
– Anatomy
From: Ian Horrocks “OWL 2:
The Next Generation”
59. 67
What is an Ontology?
A model of (some aspect of) the world
• Introduces vocabulary
relevant to domain
• Specifies meaning of terms
Heart is a muscular organ that
is part of the circulatory system
From: Ian Horrocks “OWL 2:
The Next Generation”
60. 68
What is an Ontology?
A model of (some aspect of) the world
• Introduces vocabulary
relevant to domain
• Specifies meaning of terms
Heart is a muscular organ that
is part of the circulatory system
• Formalised using suitable logic
From: Ian Horrocks “OWL 2:
The Next Generation”
61. Ontology Elements
• Concepts(classes) + their hierarchy
• Concept properties (slots/attributes) + their hierarchy
• Property restrictions (type, cardinality, domain …)
• Relations between concepts (disjoint, equality …)
• Instances
62. 70
DL Semantics
Semantics given by standard FO model theory:
John
Mary
Lawyer
Doctor
Vehicle
hasChild
owns
(Lawyer and Doctor)
From: Ian Horrocks “OWL: A
Description Logic Based
Ontology Language”
63. RDF Schema (language for simple ontologies)
RDF schema is a semantic extension of RDF used for simple ontologies’ design.
The RDF schema language is used for declaring basic class and types when
describing the terms used in RDF and are used to determine characteristics of
other resources, such as the domains and ranges of properties.
• rdfs:Resource
• rdfs:Class
• rdfs:domain
• rdfs:range
• rdfs:subClassOf
• rdfs:subPropertyOf
• …
RDF Schema provides a data-modelling
vocabulary for RDF data.
http://www.w3.org/TR/rdf-schema/
The RDF Schema class and property
system is similar to the type systems of
object-oriented programming
languages such as Java. RDF Schema
differs from many such systems in that
instead of defining a class in terms of
the properties its instances may have,
RDF Schema describes properties in
terms of the classes of resource to
The namespace is identified by: which they apply.
http://www.w3.org/2000/01/rdf-schema#
74. Dublin Core
• A set of fifteen basic properties for describing
generalised Web resources;
• ISO Standard 15836-2003 (February 2003) and
ANSI/NISO Z39.85-2012 (February 2013) :
http://www.niso.org/apps/group_public/download.php/10
256/Z39-85-2012_dublin_core.pdf
The Dublin Core Metadata Initiative is an open forum engaged in the development of interoperable online
metadata standards that support a broad range of purposes and business models.
Namespace:
@prefix dc: http://purl.org/dc/elements/1.0/ .
http://dublincore.org/
76. Dublin Core Example (RDF/XML)
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.0/">
<rdf:Description rdf:about="http://www.ukoln.ac.uk/metadata/resources/dc/datamodel/WD-dc-rdf/">
<dc:title> Guidance on expressing the Dublin Core within the RDF </dc:title>
<dc:creator> Eric Miller </dc:creator>
<dc:creator> Paul Miller </dc:creator>
<dc:creator> Dan Brickley </dc:creator>
<dc:subject> Dublin Core; RDF; XML </dc:subject>
<dc:publisher> Dublin Core Metadata Initiative </dc:publisher>
<dc:contributor> Dublin Core Data Model Working Group </dc:contributor>
<dc:date> 1999-07-01 </dc:date>
<dc:format> text/html </dc:format>
<dc:language> en </dc:language>
</rdf:Description>
</rdf:RDF>
77. Dublin Core Example (RDF/N3)
Obtained with: http://rdf-translator.appspot.com/
78. RDF (as a Linked Data) Illustrated
C
Properties (predicate)
HUMAN
#Vagan Vagan Terziyan 27/12/58 #JyU
#John
#Aino
…
Resources (subject)
hasBirthday
isEmployedBy
hasName
hasSurname
:#JyU a UNIVERSITY
:#JyU :hasTitle “University of Jyvaskyla”
:#JyU :hasLocation “Finland”
:#JyU :hasWorldRank “204”
:#JyU :hasRector :#Aino
RDF triples
:#Vagan a HUMAN
:#Vagan :hasName “Vagan”
:#Vagan :hasSurname “Terziyan”
:#Vagan :hasBirthday “27/12/58”
:#Vagan :isEmployedBy :#JyU
C
UNIVERSITY
#MIT
#JyU University
of
Jyvaskyla
Finland 204 #Aino
#KNURE
…
hasWorldRank
hasRector
hasTitle
hasLocation
:#Aino a HUMAN
Each cell is an
RDF triple
RDF triples (continue)
… … …
!
79. Traditional RDF Statement
• Subject of an RDF statement is a resource
• Predicate of an RDF statement is a property of a
resource
• Object of an RDF statement is the value of a property
of a resource (either literal or resource)
Property_k
Resource_i Literal
Resource_i
Property_r
Resource_ j
OR
80. New semantics of RDF Statement in
S-APL (object - executable resource)
Resource_i
Property_m
exe: Resource_ j
Semantics of such statement executable property
means that the value of the
Property_m of the Resource_i
can be obtained as a result of
execution of the procedure (query,
service, function, etc.) represented
as Resource_ j
SS--AAPPLL
Semantic Agent Programming Language
(Designed by Industrial Ontologies Group)
82. RDFa: Combining human- and machine-readable
information within the same document !
RDFa (or Resource Description Framework – in – attributes) is a W3C Recommendation that
adds a set of attribute-level extensions to XHTML for embedding rich metadata within Web
documents. RDFa provides a set of XHTML attributes to augment visual data with machine-readable
hints and turns the existing human-visible text and links into machine-readable data
without repeating content. The great thing about RDFa is the ability to weave meaning and rich
data directly into a web page without having any impact on the front-end user experience.
XHTML
HTML5
Today's web is built predominantly for human readers. Even as machine-readable data begins to permeate
the web, it is typically distributed in a separate file, with a separate format, and very limited correspondence
between the human and machine versions. As a result, web browsers can provide only minimal assistance to
humans in parsing and processing web pages: browsers only see presentation information. RDFa is intended
to solve the problem of marking up machine-readable data in HTML documents. RDFa provides a set of
HTML attributes to augment visual data with machine-readable hints. Using RDFa, authors may turn their
existing human-visible text and links into machine-readable data without repeating content.
85. RDFa Example (2)
http://www.w3.org/TR/xhtml-rdfa-primer/
Read first:
Use:
(http://rdfa.info/play/)
Update your HTML with some RDFa inside and check it:
88. 96
Where to look next
• RDF:
http://www.w3.org/RDF/
• RDF Schema:
http://www.w3.org/TR/rdf-schema/
• RDFa :
http://www.w3.org/TR/xhtml-rdfa-primer/
89. DBpedia http://dbpedia.org/
DBpedia (DataBasePedia) is a project aiming to extract structured
content from the information created as part of the Wikipedia
project and making it available in the Web. DBpedia allows querying
relationships and properties associated with Wikipedia resources,
including links to other related datasets. Therefore DBpedia is one
of the more famous parts of the decentralized Linked Data effort.
The DBpedia data set uses a large multi-domain
ontology which has been derived
from Wikipedia. The English version of the
DBpedia 2014 data set currently describes
4.58 million “things” with 583 million “facts”.
In addition, localized versions of DBpedia
available in 125 languages. All these versions
together describe 38.3 million things,
out of which 23.8 million overlap (interlinked)
with concepts from the English DBpedia.
90. Concepts in DBpedia
DBpedia Ontology (2014)
The DBpedia Ontology is a
shallow, cross-domain
ontology, which has been
manually created based
on the most commonly
used infoboxes within
Wikipedia. The ontology
currently covers 685
classes which form
a subsumption hierarchy
and are described by 2,795
different properties.
91. Naming “things” in DBpedia
http://wiki.dbpedia.org/Datasets
Each thing in the DBpedia data set is denoted by a de-referenceable URI-based reference of the form:
http://dbpedia.org/resource/Name ,
where Name is derived from the URL of the source Wikipedia article, which has the form:
http://en.wikipedia.org/wiki/Name .
Thus, each DBpedia entity is tied directly to a Wikipedia article. Every DBpedia entity name resolves to a
description-oriented Web document (or Web resource). Read more in: http://wiki.dbpedia.org/Datasets
Kharkiv city in Wikipedia and DBpedia
http://dbpedia.org/resource/Kharkiv http://en.wikipedia.org/wiki/Kharki
v
92. Building personal graph as Linked Data
@base <http://www.cs.jyu.fi/ai/vagan/ontologies/university.owl#> .
@prefix db: <http://dbpedia.org/resource/> .
@prefix gs: <http://scholar.google.com/citations?user=> .
db:Kharkiv_National_University_of_Radioelectronics
db:Kharkiv
db:Ukraine
db:Finland
:hasPhDFrom
:hasPlaceOf Birth
db:University_of_Jyvaskyla
:isCitizenOf
:isResidentOf
:isEmployedBy
:hasPublicationRecord
:
VaganTerziyan
gs:4U8ydfgAAAAJ
93. OWL: Web Ontology Language
• The Web Ontology Language (OWL) is a family of knowledge
representation languages or ontology languages for engineering ontologies
or knowledge bases. The languages are characterized by formal semantics
and RDF/XML-based serializations for the Semantic Web.
• OWL DL (Description Logic) designed to provide the maximum
expressiveness possible while retaining computational completeness
(either φ or ¬φ belong), decidability (there is an effective procedure to
determine whether φ is derivable or not), and the availability of practical
reasoning algorithms. OWL DL includes all OWL language constructs, but
they can be used only under certain restrictions
http://www.w3.org/TR/owl-ref/ OWL 2004
http://www.w3.org/TR/owl2-overview/ OWL-2 2009
94. Why OWL? Limitations of RDFS
• RDFS is too weak in describing resources with
sufficient details, e.g.:
– No localised range and domain constraints
• Cannot say that the range of isToughtBy is only professor when applied to
professors and lecturer when applied to lecturers
– No cardinality constraints
• Cannot say that a course is taught by at least one professor, or persons have
exactly 2 parents
– No transitive, inverse or symmetrical properties
• Cannot say that isPartOf is a transitive property, that hasSupervisor is the
inverse of isSupervisorOf, and, that friendOf is symmetrical
– Disjoint classes
• Cannot say that Graduate and PhD. Students are two disjoint classes
– Boolean combinations of classes
• Sometimes we may need to build new classes by combining other classes using
union, intersection, and complement (e.g. person is the disjoint union of the
classes male and female)
95. OWL Class and OWL Properties
rdfs:Resource
rdfs:Class rdf:Property
owl:Class owl:ObjectProperty owl:DatatypeProperty
96.
97. OWL on one Slide
• Symmetric: if P(x, y) then P(y, x)
• Transitive: if P(x,y) and P(y,z) then P(x, z)
• Functional: if P(x,y) and P(x,z) then y=z
• InverseOf: if P1(x,y) then P2(y,x)
• InverseFunctional: if P(y,x) and P(z,x) then y=z
• allValuesFrom: P(x,y) and y=allValuesFrom(C)
• someValuesFrom: P(x,y) and y=someValuesFrom(C)
• hasValue: P(x,y) and y=hasValue(v)
• cardinality: cardinality(P) = N
• minCardinality: minCardinality(P) = N
• maxCardinality: maxCardinality(P) = N
• equivalentProperty: P1 = P2
• intersectionOf: C = intersectionOf(C1, C2, …)
• unionOf: C = unionOf(C1, C2, …)
• complementOf: C = complementOf(C1)
• oneOf: C = one of(v1, v2, …)
• equivalentClass: C1 = C2
• disjointWith: C1 != C2
• sameIndividualAs: I1 = I2
• differentFrom: I1 != I2
• AllDifferent: I1 != I2, I1 != I3, I2 != I3, …
• Thing: I1, I2, …
Legend:
Properties are indicated by: P, P1, P2, etc
Specific classes are indicated by: x, y, z
Generic classes are indicated by: C, C1, C2
Values are indicated by: v, v1, v2
Instance documents are indicated by: I1, I2, I3, etc.
A number is indicated by: N
P(x,y) is read as: “property P relates x to y”
98. An Example
• Woman ≡ Person ⊓ Female
• Man ≡ Person ⊓ ØWoman
• Mother ≡ Woman ⊓ $hasChild.Person
• Father ≡ Man ⊓ $hasChild.Person
• Parent ≡ Father ⊔ Mother
• Grandmother ≡ Mother ⊓ $hasChild.Parent
We can further infer (though not explicitly stated):
Grandmother ⊑ Person
Grandmother ⊑ Man ⊔ Woman
etc.
99. OWL-2 vs. OWL
OWL-2 adds new functionality with respect to OWL.:
• keys;
• disjoint union of classes
• property chains;
• richer datatypes, data ranges;
• qualified cardinality restrictions;
• asymmetric, reflexive, and disjoint properties;
• enhanced annotation capabilities .
100. Resources
• W3C Documents
– Guide: http://www.w3.org/TR/owl-guide/
– Reference: http://www.w3.org/TR/owl-ref/
– Semantics and Abstract Syntax:
http://www.w3.org/TR/owl-semantics/
• OWL Tutorials
– Ian Horrocks, Sean Bechhofer:
http://www.cs.man.ac.uk/~horrocks/Slides/Innsbruck-tutorial/
– Roger L. Costello, David B. Jacobs:
http://www.xfront.com/owl/
• Example Ontologies, e.g. here:
http://www.daml.org/ontologies/
101. Tutorial: Designing Ontologies with
Protégé
• Protégé is an ontology editor and a
knowledge-base editor (download
from:
http://protege.stanford.edu ).
• Protégé is also an open-source,
Java tool that provides an
extensible architecture for the
creation of customized knowledge-based
applications.
• Protégé's OWL Plug-in now
provides support for editing
Semantic Web ontologies.
http://www.cs.jyu.fi/ai/vagan/ProtegeOWL_1.ppt
http://www.cs.jyu.fi/ai/vagan/ProtegeOWL_2.ppt
PLEASE !!!
Download
version:
Protégé 3.5.
http://www.cs.jyu.fi/ai/vagan/Ontologies.ppt
104. Restrictions of Monotonic Logic
Semantic Web / Ontologies / OWL
are based on the Open World
Assumption: “everything is allowed
if not explicitly prohibited”
Databases / SQL / Prologue are
based on the Closed World
Assumption: “everything is
prohibited if not explicitly allowed”
Example:
John loves Mary
Q: John loves Mary?
A: yes
Q: Mary loves John?
A: I do not know …
Example:
John loves Mary
Q: John loves Mary?
A: yes
Q: Mary loves John?
A: no
Non-Monotonic Logic driven
by the “negation as failure” rule is
used for reasoning. For example
“belief revision” can be applied as
the process of changing beliefs to
accommodate a new belief that
might be inconsistent with the old
ones. In the assumption that the
new belief is correct, some of the
old ones have to be retracted in
order to maintain consistency.
Monotonic Logic assumes that adding a formula to a theory never produces a reduction of its set of
consequences, i.e., learning a new piece of knowledge cannot reduce the set of what is known. Therefore
monotonic logic cannot handle various reasoning tasks such as: reasoning by default (consequences may
be derived only because of lack of evidence of the contrary); abductive reasoning (consequences are only
deduced as most likely explanations); belief revision (when new knowledge may contradict old beliefs), etc.
105.
106. Example (formalised rules)
Atomic predicates from the story:
Let the initial state to be:
R1: IF (P1ÙP4 ÙP2) THEN P 2;
R2: IF (P2ÙP3) THEN P 3;
R3: IF (P2 ÙP4ÙP3) THEN P3;
R4: IF ((P3ÚP2)ÙP1) THEN P1;
R5: IF (P2ÙP4) THEN P2;
R6: IF (P5 ÙP4) THEN P 4;
R7: IF ((P2ÚP3)ÙP5) THEN P5;
R8: IF ((P1ÙP2ÚP1ÙP2)ÙP5) THEN P 5;
R9: IF ((P1ÚP3)ÙP4) THEN P4.
1. Mary will love John if he loves her and if
he is not abusing Pete.
2. Pete will consider Mary as his friend if she
is not in love with John.
3. Pete will not consider Mary as his friend if
she is in love with John who is abusing him.
4. John will stop loving Mary if she does not
love him or she is a friend of Pete.
5. Mary will stop loving John if he is abusing
Pete.
6. John being in bad mood will abuse Pete.
7. John gets rid of bad mood if Mary loves
him or if she is not a friend of Pete.
8. John will fall in a bad mood if he loves
Mary and she does not love him or vice versa.
9. John will stop abusing Pete if he (John)
does not love Mary any more or if she is not a
friend of Pete.
P1 = :John:loves :Mary .
P2 = :Mary :loves :John .
P3 = :Pete :hasFriend :Mary .
P4 = :John :isAbusing :Pete .
P5 = :John :hasBadMood ”true”.
S(t0 ) =P1 Ù P2 ÙP3 Ù P4 Ù P5
Formalized rules from the story:
Rules as the story:
107. Hereinafter for the simplicity we will apply the rules synchronously !
Example (reasoning, 1-st step)
loves
John Mary
Pete
hasFriend
S(t0 ) =P1 Ù P2 ÙP3 Ù P4 Ù P5
R1: IF (P1ÙP4ÙP2) THEN P 2;
R2: IF (P2ÙP3) THEN P 3;
R3: IF (P2ÙP4ÙP3) THEN P3;
R4: IF ((P3ÚP2)ÙP1) THEN P1;
R5: IF (P2 ÙP4) THEN P2;
R6: IF (P5 ÙP4) THEN P 4;
R7: IF ((P2ÚP3)ÙP5) THEN P5;
R8: IF ((P1ÙP2ÚP1ÙP2)ÙP5) THEN P 5;
0 1 2 3 4 5 R9: IF ((P1ÚP3)ÙP4) THEN P4. S(t +t ) = P ÙP ÙP Ù P ÙP
108. Example (reasoning, 2-nd step)
loves
John Mary
Pete
hasFriend
R1: IF (P1ÙP4ÙP2) THEN P 2;
R2: IF (P2ÙP3) THEN P 3;
R3: IF (P2ÙP4ÙP3) THEN P3;
R4: IF ((P3ÚP2)ÙP1) THEN P1;
R5: IF (P2 ÙP4) THEN P2;
R6: IF (P5 ÙP4) THEN P 4;
R7: IF ((P2ÚP3)ÙP5) THEN P5;
R8: IF ((P1ÙP2ÚP1ÙP2)ÙP5) THEN P 5;
R9: IF ((P1ÚP3)ÙP4) THEN P4.
hasBadMood
S(t0 +t ) = P1 ÙP2 ÙP3 Ù P4 ÙP5
S(t0 + 2×t ) = P1 ÙP2 ÙP3 ÙP4 Ù P5
109. Example (reasoning, 3-rd step)
loves
John Mary
Pete
hasFriend
R1: IF (P1ÙP4ÙP2) THEN P 2;
R2: IF (P2ÙP3) THEN P 3;
R3: IF (P2ÙP4ÙP3) THEN P3;
R4: IF ((P3ÚP2)ÙP1) THEN P1;
R5: IF (P2 ÙP4) THEN P2;
R6: IF (P5 ÙP4) THEN P 4;
R7: IF ((P2ÚP3)ÙP5) THEN P5;
R8: IF ((P1ÙP2ÚP1ÙP2)ÙP5) THEN P 5;
R9: IF ((P1ÚP3)ÙP4) THEN P4.
isAbusing
S(t0 + 2×t ) = P1 ÙP2 ÙP3 ÙP4 Ù P5
S(t0 + 3×t ) = P1 Ù P2 Ù P3 Ù P4 ÙP5
110. Example (reasoning, 4-th step)
John Mary
Pete
R1: IF (P1ÙP4ÙP2) THEN P 2;
R2: IF (P2ÙP3) THEN P 3;
R3: IF (P2ÙP4ÙP3) THEN P3;
R4: IF ((P3ÚP2)ÙP1) THEN P1;
R5: IF (P2 ÙP4) THEN P2;
R6: IF (P5 ÙP4) THEN P 4;
R7: IF ((P2ÚP3)ÙP5) THEN P5;
R8: IF ((P1ÙP2ÚP1ÙP2)ÙP5) THEN P 5;
R9: IF ((P1ÚP3)ÙP4) THEN P4.
hasBadMood
S(t0 + 3×t ) = P1 Ù P2 Ù P3 Ù P4 ÙP5
S(t0 + 4×t ) = P1 Ù P2 ÙP3 ÙP4 Ù P5
111. Example (reasoning, 5-th step)
John Mary
isAbusing hasFriend
Pete
R1: IF (P1ÙP4ÙP2) THEN P 2;
R2: IF (P2ÙP3) THEN P 3;
R3: IF (P2ÙP4ÙP3) THEN P3;
R4: IF ((P3ÚP2)ÙP1) THEN P1;
R5: IF (P2 ÙP4) THEN P2;
R6: IF (P5 ÙP4) THEN P 4;
R7: IF ((P2ÚP3)ÙP5) THEN P5;
R8: IF ((P1ÙP2ÚP1ÙP2)ÙP5) THEN P 5;
R9: IF ((P1ÚP3)ÙP4) THEN P4.
S(t0 + 4×t ) = P1 Ù P2 ÙP3 ÙP4 Ù P5
S(t0 + 5×t ) = P1 Ù P2 ÙP3 Ù P4 Ù P5
112. Example (reasoning, reaching terminal
state)
John Mary
Pete
R1: IF (P1ÙP4ÙP2) THEN P 2;
R2: IF (P2ÙP3) THEN P 3;
R3: IF (P2ÙP4ÙP3) THEN P3;
R4: IF ((P3ÚP2)ÙP1) THEN P1;
R5: IF (P2 ÙP4) THEN P2;
R6: IF (P5 ÙP4) THEN P 4;
R7: IF ((P2ÚP3)ÙP5) THEN P5;
R8: IF ((P1ÙP2ÚP1ÙP2)ÙP5) THEN P 5;
R9: IF ((P1ÚP3)ÙP4) THEN P4.
S(t0 + 5×t ) = P1 Ù P2 ÙP3 Ù P4 Ù P5
hasFriend
terminal state
113. Example (final “terminal” state)
1. John does not love Mary.
2. Mary does not love John.
3. Mary is a friend of Pete.
4. John is not abusing Pete.
5. John is not in a bad mood.
S(t0 + 5×t ) = P1 Ù P2 ÙP3 Ù P4 Ù P5
114. Example (another initial and in the
same time terminal state)
1. John loves Mary.
2. Mary loves John.
3. Mary is not a friend of Pete.
4. John is not abusing Pete.
5. John is not in a bad mood.
to love
John Mary
S(t0 ) =P1 ÙP2 Ù P3 Ù P4 Ù P5
to love
Pete
R1: IF (P1ÙP4ÙP2) THEN P 2;
R2: IF (P2ÙP3) THEN P 3;
R3: IF (P2ÙP4ÙP3) THEN P3;
R4: IF ((P3ÚP2)ÙP1) THEN P1;
R5: IF (P2 ÙP4) THEN P2;
R6: IF (P5 ÙP4) THEN P 4;
R7: IF ((P2ÚP3)ÙP5) THEN P5;
R8: IF ((P1ÙP2ÚP1ÙP2)ÙP5) THEN P 5;
R9: IF ((P1ÚP3)ÙP4) THEN P4. terminal state
115. Example (two possible terminal
states of the “love triangle”)
to love
John Mary
to love
Pete
John Mary
Pete
to have a friend
119. SWRL Rule structure
Contains an antecedent part (body), and a consequent (head).
The body and head consist of positive conjunctions of atoms:
Atom Ù Atom … → Atom Ù Atom …
SWRL provides seven types of atoms:
- Class Atoms owl:Class e.g., Person (?x), …, Person (John)
- Individual Property atoms owl:ObjectProperty e.g., loves (?x, ?y), …, loves (John, Mary)
- Data Valued Property atoms owl:DatatypeProperty e.g., hasAge(?x, 19), …, hasAge(Mary, 19)
- Different Individuals atoms e.g., differentFrom(?x, ?y), …,
- Same Individual atoms e.g., sameAs(?x, ?y), …, sameAs(John, ?y)
- Built-in atoms (next slide)
Person(?x) Ù hasSibling(?x,?y) Ù Man(?y) → hasBrother(?x,?y)
antecedent consequent
120. SWRL built-ins
Some mathematical operations
Comparison of two datatypes swrlb:add (satisfied iff the first argument is equal to
swrlb:equal
swrlb:notEqual
swrlb:lessThan
swrlb:lessThanOrEqual
swrlb:greaterThan
swrlb:greaterThanOrEqual
swrlb:stringEqualIgnoreCase
(satisfied iff the first argument (string) is
the same as the second argument
(upper/lower case ignored))
the arithmetic sum of the second argument and the
third argument)
swrlb:subtract
swrlb:multiply
swrlb:divide
swrlb:pow (satisfied iff the first argument is equal
to the result of the second argument raised to the third
argument power)
swrlb:abs (satisfied iff the first argument is the
absolute value of the second argument)
swrlb:round (satisfied iff the first argument is equal
to the nearest number to the second argument with no
fractional part)
swrlb:booleanNot (satisfied iff the first argument is
true and the second argument is false, or vice versa.
Read more in:
http://www.w3.org/Submission/SWRL/
121. Examples of SWRL Rules (1)
Rule computes age of a person from the current year and
the date of birth:
Person(?x) Ù hasYearOfBirth(?x, ?yborn) Ù hasCurrentYear(?x,?ycurrent) Ù
Ù swrlb:subtract(?age, ?ycurrent, ?yborn) ®
® hasAgeYears(?x,?age)
122. Examples of SWRL Rules
A researcher, which Hirsch-index (citation index) is more
than amount of years in her academic career, is a good
researcher:
Researcher(?x) Ù hasHindexOfPublications(?x, ?hirschindex) Ù
Ù hasYearsInCareer(?x, ?years) Ù swrlb:greaterThan(?hirschindex,?years) ®
® GoodResearcher(?x)
123. Examples of SWRL Rules
A person of age between 29-55 would have an extra weight
equal to positive difference between his/her weight in kilos
and his/her height in centimeters (minus 100):
Person(?x) Ù hasAgeYears(?x,?age) Ù swrlb:greaterThan(?age, 28) Ù
Ù swrlb:lessThan(?age, 56) Ù hasWeightKg(?x, ?weight) Ù hasLengthSm(?x, ?length) Ù
Ù swrlb:subtract(?ideal, ?length, 100) Ù swrlb:subtract(?extra, ?weight, ?ideal) Ù
Ù swrlb:greaterThan(?extra, 0) ®
® hasExtraWeightKg(?x, ?extra)
124. Examples of SWRL Rules
A person of age between 29-55 would have a lacking weight
equal to positive difference between his/her height in
centimeters (minus 100) and his/her weight in kilos:
Person(?x) Ù hasAgeYears(?x,?age) Ù swrlb:greaterThan(?age, 28) Ù
Ù swrlb:lessThan(?age, 56) Ù hasWeightKg(?x, ?weight) Ù hasLengthSm(?x, ?length) Ù
Ù swrlb:subtract(?ideal, ?length, 100) Ù swrlb:subtract(?lacking, ?ideal, ?weight) Ù
Ù swrlb:greaterThan(?lacking, 0) ®
® hasLackingWeightKg(?x, ?lacking)
Notes de l'éditeur
¥begin{array}{r@{¥,}c@{¥,}l} ¥forall x.[¥textsf{¥color{blue} Heart}(x) & {¥color{red}¥rightarrow} & ¥textsf{¥color{blue} MuscularOrgan}(x) ¥,¥wedge¥, ¥¥ & & ¥exists y.[¥textsf{¥color{magenta} isPartOf}(x,y) ¥,¥wedge¥, ¥¥&&¥textsf{¥color{blue} CirculatorySystem}(y)]] ¥end{array}