Semantic Basics: Markup,
Semantic Basics: Markup,
Querying, and Reasoning
Querying, and Reasoning
Marlon Pierce Marlon Pierce
Community Grids Lab Community Grids Lab
Indiana University Indiana University
With Slides and Help from Sean Bechhofer, With Slides and Help from Sean Bechhofer, Carole Goble, Line Pouchard, and Dave De Carole Goble, Line Pouchard, and Dave De
Reductio ad Absurdum
Reductio ad Absurdum
“
“
Physics is the study of the harmonic
Physics is the study of the harmonic
oscillator.”
oscillator.”
•
H. L. Richards
H. L. Richards
“
“
Statistical Mechanics is the study of
Statistical Mechanics is the study of
the Ising Model”
the Ising Model”
•
H. L. Richards
H. L. Richards
“
“
Web Service standards are the
Web Service standards are the
study of <xsd:any> sequences”
Which Web Service Specs?
Which Web Service Specs?
<xs:element name="
<xs:element name="HeaderHeader" " type="
type="tns:Headertns:Header" /> " />
<xs:complexType <xs:complexType name="
name="HeaderHeader">"> <xs:sequence>
<xs:sequence>
<xs:any
<xs:any
namespace="
namespace="##any##any" " processContents="
processContents="laxlax" " minOccurs="
minOccurs="00" " maxOccurs="
maxOccurs="unboundedunbounded" /> " /> </xs:sequence>
</xs:sequence>
<xs:anyAttribute <xs:anyAttribute namespace="
namespace="##other##other" " processContents="
processContents="laxlax" /> " />
</xs:complexType></xs:complexType>
<xsd:complexType
<xsd:complexType
name="
name="SecurityHeaderTypeSecurityHeaderType"" >
>
<xsd:sequence><xsd:sequence>
<xsd:any <xsd:any
processContents="processContents="laxlax" "
minOccurs="minOccurs="00" "
maxOccurs="maxOccurs="unboundedunbounded">">
</xsd:any></xsd:any>
</xsd:sequence></xsd:sequence>
<xsd:anyAttribute <xsd:anyAttribute
namespace="namespace="####otherother" "
processContents="processContents="laxlax" /> " /> </xsd:complexType>
Which, What, and Why?
Which, What, and Why?
Which is what?
Which is what?
• Left is the definition of the SOAP header.Left is the definition of the SOAP header.
• Right is taken from Web Service Secure Messaging Right is taken from Web Service Secure Messaging Specification.
Specification.
• You will find this pattern repeated pretty often in web You will find this pattern repeated pretty often in web service specifications.
service specifications.
Why?
Why?
• We have limited ways of linking several XML schema We have limited ways of linking several XML schema data models.
data models.
Imagine schemas for science applications and computing Imagine schemas for science applications and computing
resources.
resources.
• XML maps relationships to trees.XML maps relationships to trees.
Link application and computer schemas with <xsd:any>.Link application and computer schemas with <xsd:any>. In my application+computer schema, does application In my application+computer schema, does application
contain computer as child node, or vice versa?
contain computer as child node, or vice versa?
• Graphs are a more natural way of expressing many Graphs are a more natural way of expressing many inter-relationships of concepts.
XML is not enough
XML is not enough
XML defines
XML defines
grammars to verify
grammars to verify
and structure
and structure
documents
documents
The grammar
The grammar
enforces constraints
enforces constraints
on tags
on tags
Different grammars
Different grammars
define the same
define the same
content
content
XML lacks a
XML lacks a
semantic model – it
semantic model – it
only has a surface
only has a surface
model which is a
model which is a
tree.
tree.
<Creator>
<uri> http://www.w3.org/Home/Lassila </uri> <name>Ora Lassila</name>
</Creator>
<Document uri=“http://www.w3.org/Home/Lassila” <Creator>Ora Lassila</Creator>
</Document>
<Document uri=“http://www.w3.org/Home/Lassila” Creator=“Ora Lassila”/>
“The Creator of the Resource
“http://www.w3.org/Home/Lassila” is Ora Lassila
XML is not enough
XML is not enough
Meaning of XML documents is Meaning of XML documents is intuitivelyintuitively clear clear
• ““semanticsemantic” markup tags are domain terms” markup tags are domain terms
But computers do not have intuitionBut computers do not have intuition
• Tag names Tag names per seper se do not provide semantics do not provide semantics • The semantics are encoded The semantics are encoded outsideoutside the XML the XML
specification specification
XML makes no commitment on:XML makes no commitment on:
Domain specific ontological Domain specific ontological vocabularyvocabulary Ontological Ontological modeling primitivesmodeling primitives
requires pre-arranged agreement on requires pre-arranged agreement on & &
Feasible for closed collaboration Feasible for closed collaboration
• agents in a small & stable communityagents in a small & stable community • pages on a small & stable intranetpages on a small & stable intranet
Semantic Web Markups often are expressed
Semantic Web Markups often are expressed
Enter the Semantic Web/Grid
Enter the Semantic Web/Grid
“
“
The
The
Semantic Web
Semantic Web
is the
is the
representation of
representation of
data
data
on the
on the
World
World
Wide Web
Wide Web
. It is a collaborative
. It is a collaborative
effort led by W3C with participation
effort led by W3C with participation
from a large number of researchers
from a large number of researchers
and industrial partners. It is based
and industrial partners. It is based
on the
on the
Resource Description
Resource Description
Framework
Framework
(
(
RDF
RDF
), which integrates
), which integrates
a variety of applications using
a variety of applications using
XML
XML
for syntax
The Semantic Stack
The Semantic Stack
XML
XML
Defines the syntax for structured
Defines the syntax for structured
documents.
documents.
XML
XML
Schema
Schema
Defines rules for XML dialects (SVG,
Defines rules for XML dialects (SVG,
GML, etc.) and also built-in data
GML, etc.) and also built-in data
types.
types.
RDF
RDF
A data model definition language with
A data model definition language with
XML bindings
XML bindings
RDF
RDF
Schema
Schema
A way to define RDF-based languages
A way to define RDF-based languages
(DAML-OIL, OWL).
(DAML-OIL, OWL).
OWL
OWL
An extension of RDF/RDFS with
An extension of RDF/RDFS with
extensive property/relationship
extensive property/relationship
definitions for expressing logical
definitions for expressing logical
relationships.
Semantic Markups
Semantic Markups
All semantic markup languages
All semantic markup languages
should be understood as
should be understood as
assertion
assertion
languages.
languages.
•
We will assert that certain relationships
We will assert that certain relationships
between resources exist.
between resources exist.
•
We will express this using RDF, RDFS,
We will express this using RDF, RDFS,
and OWL using XML
and OWL using XML
We must still provide tools for
We must still provide tools for
processing (and verifying) the
processing (and verifying) the
assertions.
Resource Description
Resource Description
Framework
Framework
Overview of RDF basic ideas
Overview of RDF basic ideas
and XML encoding.
Resource Description Framework
Resource Description Framework
(RDF)
(RDF)
RDF is the simplest of the semantic languages.
RDF is the simplest of the semantic languages.
Basic Idea #1: Triples
Basic Idea #1: Triples
• RDF is based on a subject-verb-object statement RDF is based on a subject-verb-object statement structure.
structure.
• RDF subjects are called resources (classes)RDF subjects are called resources (classes) • Verbs (predicates) are called properties.Verbs (predicates) are called properties.
• Objects (values) may be simple literals or other Objects (values) may be simple literals or other resources.
resources.
Basic Idea #2: Everything is a resource that is
Basic Idea #2: Everything is a resource that is
named with a URI
named with a URI
• RDF nouns, verbs, and objects are all labeled with URIsRDF nouns, verbs, and objects are all labeled with URIs • Recall that a URI is just a name for a resource. Recall that a URI is just a name for a resource.
• It may be a URL, but not necessarily.It may be a URL, but not necessarily.
• A URI can name anything that can be describedA URI can name anything that can be described
Web pages, creators of web pages, organizations that the Web pages, creators of web pages, organizations that the
creator works for,….
RDF Graph Model
RDF Graph Model
RDF is defined by a graph model.
RDF is defined by a graph model.
Resources are denoted by ovals (nodes).
Resources are denoted by ovals (nodes).
Lines (arcs) indicate properties.
Lines (arcs) indicate properties.
Squares indicate string literals (no URI).
Squares indicate string literals (no URI).
Resources and properties are labeled by a URI.
Resources and properties are labeled by a URI.
http://.../CMCS/Entries/X
H2O
Encoding RDF in XML
Encoding RDF in XML
The graph represents two statements.
The graph represents two statements.
• Entry X has a creator, Dr. Y.Entry X has a creator, Dr. Y. • Entry X has a title, H2O.Entry X has a title, H2O.
In RDF XML, we have the following tags
In RDF XML, we have the following tags
• <RDF> </RDF> denote the beginning and end of the <RDF> </RDF> denote the beginning and end of the RDF description.
RDF description.
• <Description>’s “about” attribute identifies the subject <Description>’s “about” attribute identifies the subject of the sentence.
of the sentence.
• <Description></Description> enclose the properties <Description></Description> enclose the properties and their values.
and their values.
• We import Dublin Core conventional properties (creator, We import Dublin Core conventional properties (creator, title) from outside RDF proper.
RDF XML: The Gory Details
RDF XML: The Gory Details
<rdf:RDF
<rdf:RDF
xmlns:rdf='http://www.w3.org/1999/02/2
xmlns:rdf='http://www.w3.org/1999/02/2
2-rdf-syntax-ns#'
2-rdf-syntax-ns#'
xmlns:dc='http://purl.org/dc/elements/1.0
xmlns:dc='http://purl.org/dc/elements/1.0
/'>
/'>
<rdf:Description rdf:about='http://.../X‘>
<rdf:Description rdf:about='http://.../X‘>
<dc:creator
<dc:creator
rdf:resource='http://…/people/MEP‘/
rdf:resource='http://…/people/MEP‘/
>
>
<dc
<dc
:title rdf:resource='H2O'/>
:title rdf:resource='H2O'/>
</rdf:Description>
</rdf:Description>
</rdf:RDF>
Encoding RDF as Triplets
Encoding RDF as Triplets
In addition to graphs and XML, RDF may
In addition to graphs and XML, RDF may
be written as triple “sentences”.
be written as triple “sentences”.
A triple is just the subject, predicate,
A triple is just the subject, predicate,
and object (in that order) of a graph
and object (in that order) of a graph
segment.
segment.
<http://.../CMCS/Entries/X>
http://purl.org/dc/elements/1.1/creator<
http://.../CMCS/People/DrY
>
>
•
This structure may look trivial but is
This structure may look trivial but is
useful in expressing queries (more
useful in expressing queries (more
later).
Creating RDF Documents
Creating RDF Documents
Writing RDF XML (or DAML or OWL) by
Writing RDF XML (or DAML or OWL) by
hand is not easy.
hand is not easy.
•
It’s a good way to learn to read/write, but after
It’s a good way to learn to read/write, but after
you understand it, automate it.
you understand it, automate it.
Authoring tools are available
Authoring tools are available
•
OntoMat: buggy
OntoMat: buggy
•
Protégé: preferred by CGL grad students
Protégé: preferred by CGL grad students
•
IsaViz: another nice tool with very good
IsaViz: another nice tool with very good
graphics.
graphics.
You can also generate these
You can also generate these
programmatically using Hewlett Packard
programmatically using Hewlett Packard
Labs’ Jena toolkit for Java.
Labs’ Jena toolkit for Java.
What is the Advantage?
What is the Advantage?
So far, properties are just conventional URI names.So far, properties are just conventional URI names.
• All semantic web properties are conventional assertions about All semantic web properties are conventional assertions about relationships between resources.
relationships between resources.
• RDFS and OWL will offer more precise property capabilities.RDFS and OWL will offer more precise property capabilities.
But there is a powerful feature we are about to explore…But there is a powerful feature we are about to explore…
• Properties provide a powerful way of linking different RDF Properties provide a powerful way of linking different RDF resources
resources
““Nuggets” of information.Nuggets” of information.
For example, a publication is a resource that can be For example, a publication is a resource that can be
described by RDF described by RDF
• Author, publication date, URL are all metadata property Author, publication date, URL are all metadata property values.
values.
• But publications have references that are just other But publications have references that are just other publications
publications
• DC’s “hasReference” can be used to point from one publication DC’s “hasReference” can be used to point from one publication to another.
to another.
Publication also have authors Publication also have authors
• An author is more than a nameAn author is more than a name
• Also an RDF resource with collections of propertiesAlso an RDF resource with collections of properties
Graph Model Depicting vCard and
Graph Model Depicting vCard and
DC Linking
DC Linking
http://.../CMCS/Entry/1
dc:title
H20
http://.../People/DrY
dc:creator
vcard:N
vcard:EMAIL
What Else Does RDF Do?
What Else Does RDF Do?
Collections: typically used as the object of an RDF
Collections: typically used as the object of an RDF
statement
statement
• Bag: unordered collection of resources or literals.Bag: unordered collection of resources or literals.
• Sequence: ordered collection or resources or literals.Sequence: ordered collection or resources or literals. • Alternative: collection of resources or literals, from Alternative: collection of resources or literals, from
which only one value may be chosen which only one value may be chosen
And that’s about it. RDF does not define
And that’s about it. RDF does not define
properties, it just tells you where to put them.
properties, it just tells you where to put them.
• Definitions are done by specific groups for specific fields Definitions are done by specific groups for specific fields (Dublin Core Metadata Initiative, for example).
(Dublin Core Metadata Initiative, for example).
• RDF Schema provides the rules for defining specific RDF Schema provides the rules for defining specific resources classes and properties.
resources classes and properties.
But the graph model has opened some doors
But the graph model has opened some doors
RDF Schema
RDF Schema
RDF Schema is a rules system for building RDF
RDF Schema is a rules system for building RDF
languages.
languages.
• RDF and RDFS are defined in terms of RDFSRDF and RDFS are defined in terms of RDFS • DAML+OIL and OWL are defined by RDFS.DAML+OIL and OWL are defined by RDFS.
Take our Dublin Core RDF encoding as an
Take our Dublin Core RDF encoding as an
example:
example:
• Can we formalize this process, defining a consistent set Can we formalize this process, defining a consistent set of rules?
of rules?
Previous example was valid RDF but how do I formalize the Previous example was valid RDF but how do I formalize the
process of writing sentences about creators of entries?
process of writing sentences about creators of entries?
• Can we place restrictions and use inheritance to define Can we place restrictions and use inheritance to define resources?
resources?
What really is the value of “creator”? Can I derive it from What really is the value of “creator”? Can I derive it from
another class, like “person”?
another class, like “person”?
• Can we provide restrictions and rules for properties?Can we provide restrictions and rules for properties? How can I express the fact that “title” should only appear How can I express the fact that “title” should only appear
once?
once?
Some RDFS Classes (Subjects and Values)
Some RDFS Classes (Subjects and Values)
RDFS: Resource
RDFS: Resource
The RDFS root element. All The RDFS root element. All other tags derive fromother tags derive from Resource
Resource
RDFS: Class
RDFS: Class
The Class class. Literals and The Class class. Literals and Datatypes are example Datatypes are example classes. Classes consist of classes. Classes consist of entities that share entities that share properties. properties.RDFS: Literal
RDFS: Literal
The class for holding Strings The class for holding Strings and integers. Literals are and integers. Literals are dead ends in RDF graphs. dead ends in RDF graphs.RDFS: Datatype
RDFS: Datatype
A type of data, a member of A type of data, a member of the Literal class.the Literal class.
RDFS: XMLLiteral
RDFS: XMLLiteral
A datatype for holding XML A datatype for holding XML data.data.
RDFS:Property
Some RDFS Properties
Some RDFS Properties
subClassOf
subClassOf
Indicates the subject is a Indicates the subject is a subclass of the object in a subclass of the object in a statement.statement.
subPropertyOf
subPropertyOf
The subject is a subProperty The subject is a subProperty of the propertyof the property
(masquerading as an (masquerading as an object).
object).
Domain
Domain
Restricts a property to only Restricts a property to only apply to certain classes of apply to certain classes of subjectssubjects
Range
Range
Restricts the values of a Restricts the values of a property to be members of property to be members of an indicated class or one of an indicated class or one of its subclasses.its subclasses.
type
type
Denotes an instance of a Denotes an instance of a particular class. Actually particular class. Actually from RDF, not RDFS.Sample RDFS: Defining <Property>
Sample RDFS: Defining <Property>
This is the definition of <property>, taken from the RDF This is the definition of <property>, taken from the RDF
schema. schema.
The “about” attribute labels names this nugget.The “about” attribute labels names this nugget. <property> has several properties<property> has several properties
• <label>,<comment> are self explanatory.<label>,<comment> are self explanatory.
• <subClassOf> means <property> is a subclass of <resource><subClassOf> means <property> is a subclass of <resource>
• <isDefinedBy> points to the human-readable documentation.<isDefinedBy> points to the human-readable documentation.
<rdfs:Class rdf:ID=“Property">
<rdfs:isDefinedBy rdf:resource="http://.../some/uri"/>
<rdfs:label>Property</rdfs:label>
<rdfs:comment>The class of RDF
properties.</rdfs:comment>
Property Relationships and Simple
Property Relationships and Simple
Reasoning
Reasoning
subClassOf:
subClassOf:
•
Carole is a member of the class <Professor>
Carole is a member of the class <Professor>
•
<Professor> is a subclass of
<Professor> is a subclass of
<UniversityEmployee>
<UniversityEmployee>
•
So Carole works for a university.
So Carole works for a university.
subPropertityOf:
subPropertityOf:
•
Marlon hasSibling Susan
Marlon hasSibling Susan
•
hasSibling is a subclass of hasRelative
hasSibling is a subclass of hasRelative
•
So Marlon and Susan are related.
So Marlon and Susan are related.
Domain and Range:
Domain and Range:
•
hasSibling applies to animal subjects and
hasSibling applies to animal subjects and
animal objects, so Marlon is a member of the
animal objects, so Marlon is a member of the
Web Ontology Language
Web Ontology Language
(OWL)
(OWL)
Eeyore: W-O-L. That spells owl.
Eeyore: W-O-L. That spells owl.
Owl: Bless my soul! So it does!
Owl: Bless my soul! So it does!
(Many Slides Courtesy of Sean
(Many Slides Courtesy of Sean
Bechhofer)
What’s an Ontology?
What’s an Ontology?
English definitions tend to be vague to
English definitions tend to be vague to
non-specialists
non-specialists
•
“
“
A formal, explicit specification of a shared
A formal, explicit specification of a shared
conceptionalization”
conceptionalization”
Clearer definition: an ontology is a
Clearer definition: an ontology is a
taxonomy combined with inference rules
taxonomy combined with inference rules
•
T. Berners-Lee, J. Hendler, O. Lassila
T. Berners-Lee, J. Hendler, O. Lassila
But really, if you sit down to describe a
But really, if you sit down to describe a
subject in terms of its classes and their
subject in terms of its classes and their
relationships, you are creating an
relationships, you are creating an
Ontology.
RDFS Limitations
RDFS Limitations
RDFS
RDFS
too weak
too weak
to describe resources in
to describe resources in
sufficient detail
sufficient detail
• No No localised range and domainlocalised range and domain constraints constraints
Can’t say that the range of hasChild is person when applied Can’t say that the range of hasChild is person when applied
to persons and elephant when applied to elephants
to persons and elephant when applied to elephants
• No No existence/cardinalityexistence/cardinality constraints constraints
Can’t say that all Can’t say that all instancesinstances of person have a mother that is of person have a mother that is
also a person, or that persons have exactly 2 parents
also a person, or that persons have exactly 2 parents
• No No transitive, inverse transitive, inverse oror symmetrical symmetrical properties properties
Can’t say that isPartOf is a transitive property, that hasPart Can’t say that isPartOf is a transitive property, that hasPart
is the inverse of isPartOf or that touches is symmetrical
is the inverse of isPartOf or that touches is symmetrical
Difficult to provide
Difficult to provide
reasoning support
reasoning support
OWL Semantic Layering
OWL Semantic Layering
Full
DL
Lite
Three language “layers”:Three language “layers”:
• OWL OWL LiteLite
A subset of OWL useful for expressing A subset of OWL useful for expressing
classifications and simple relationships
classifications and simple relationships
• OWL OWL DL DL (Description Logic)(Description Logic)
Contains all OWL constructions but with limitations Contains all OWL constructions but with limitations
that guarantee computational completeness and
that guarantee computational completeness and
decidability.
decidability.
• OWL OWL FullFull
All OWL constructs with no restrictions but no All OWL constructs with no restrictions but no
guaranteed processibility.
guaranteed processibility. Syntactic LayeringSyntactic Layering
Semantic LayeringSemantic Layering
• Layers should agree on semantics.Layers should agree on semantics.
• All legal Lite ontologies are legal DL ontologies.All legal Lite ontologies are legal DL ontologies.
OWL Lite Synopsis
OWL Lite Synopsis
Built on RDFS, with usual RDFS classes
Built on RDFS, with usual RDFS classes
(see previous table in these slides).
(see previous table in these slides).
•
Includes a special class, <
Includes a special class, <
Thing
Thing
>, that is the
>, that is the
superclass of all OWL classes.
superclass of all OWL classes.
•
Built in class <
Built in class <
Nothing
Nothing
> that is the most
> that is the most
specific class (has no instances or subclasses).
specific class (has no instances or subclasses).
•
Built-in class <
Built-in class <
Individual
Individual
> for instances of
> for instances of
classes.
classes.
In OWL, properties may apply to either individuals or In OWL, properties may apply to either individuals or
to all members of a class. to all members of a class.
So <worksForIU> applies to Marlon but not Dave.So <worksForIU> applies to Marlon but not Dave.
Expresses concepts such as equivalent
Expresses concepts such as equivalent
classes, synonymous properties.
classes, synonymous properties.
Allows you to assert that properties can be
Allows you to assert that properties can be
inverse, transitive, and symmetric.
Some OWL DL and OWL Full
Some OWL DL and OWL Full
Extensions
Extensions
Class Axioms:
Class Axioms:
•
oneOf: a class can be defined by its
oneOf: a class can be defined by its
members (ex: daysOfWeek defined by
members (ex: daysOfWeek defined by
members)
members)
An Enumeration class
An Enumeration class
•
disjointWith
disjointWith
More Boolean Relationships:
More Boolean Relationships:
•
unionOf, complementOf, intersectionOf
unionOf, complementOf, intersectionOf
Unrestricted cardinality
Unrestricted cardinality
Differences Between DL and Full
Differences Between DL and Full
Both DL and Full use the same OWL vocabularyBoth DL and Full use the same OWL vocabulary
• See previous slide.See previous slide.
Difference #1: DL classes and properties cannot also be Difference #1: DL classes and properties cannot also be
individuals (instances), and vice versa. individuals (instances), and vice versa.
• That is, there is a strict separation between That is, there is a strict separation between type type and and
subClassOf. subClassOf.
• So if you use <Merlot> as <rdf:type> of <Wine>, you can’t So if you use <Merlot> as <rdf:type> of <Wine>, you can’t subclass <Merlot> to add additional properties in OWL DL.
subclass <Merlot> to add additional properties in OWL DL.
• ““subClass versus instance” decisions should be made based on subClass versus instance” decisions should be made based on the intended use of the ontology.
the intended use of the ontology.
Don’t make Merlot an instance if you are developing an ontology to Don’t make Merlot an instance if you are developing an ontology to
describe your wine collection, which consists of many bottles of
describe your wine collection, which consists of many bottles of
Merlot (instances), and you want to use OWL DL
Merlot (instances), and you want to use OWL DL
Difference #2: All DL properties are required to be eitherDifference #2: All DL properties are required to be either
• owl:ObjectProperty:owl:ObjectProperty: used to connect instances of two used to connect instances of two classes.
classes.
• owl:DataTypePropertyowl:DataTypeProperty: used to connect class instances with : used to connect class instances with XML schema types and RDF literal strings.
XML schema types and RDF literal strings.
• (OWL Full allows us to tag DataTypeProperties as (OWL Full allows us to tag DataTypeProperties as
owl:InverseFunctionalProperty,
owl:InverseFunctionalProperty, so we can create a string so we can create a string literal instance that uniquely identifies a class instance.
An OWL Example
An OWL Example
An Earth Systems Grid
An Earth Systems Grid
example
example
(Courtesy of Line Pouchard)
An Example Ontology: Climate
An Example Ontology: Climate
Data
Data
The example shows how to construct a really
The example shows how to construct a really
simple ontology and instance.
simple ontology and instance.
We don’t use it to encode all data but rather to
We don’t use it to encode all data but rather to
encode metadata about data files.
encode metadata about data files.
• Where is the data file (URI) that has the temperature Where is the data file (URI) that has the temperature associated with this dataset?
associated with this dataset?
Two classes:
Two classes:
• datasetdataset • ParameterParameter
One property:
One property:
• hasParameterhasParameter
Several parameters: cloud_medium,
Several parameters: cloud_medium,
bounds_latitude, temperature
bounds_latitude, temperature
Line Pouchard (ORNL) created this for ESG using
Line Pouchard (ORNL) created this for ESG using
Let’s Begin
Let’s Begin
Front matters: OWL ontologies begin with the
Front matters: OWL ontologies begin with the
<Ontology> header.
<Ontology> header.
• A useful place to put metadata about the document.A useful place to put metadata about the document. • Line uses the Dublin Core to establish authorship.Line uses the Dublin Core to establish authorship.
Next, define two classes: dataset and parameter.
Next, define two classes: dataset and parameter.
• Class definitions are almost trivial.Class definitions are almost trivial.
• We really state what something is by its properties.We really state what something is by its properties. Deep philosophical arguments here, I’m sure.Deep philosophical arguments here, I’m sure.
Most of the work will go into defining the
Most of the work will go into defining the
property, hasParameter.
property, hasParameter.
• Begins on bottom of next slideBegins on bottom of next slide
• But the full extent of the definition requires a separate But the full extent of the definition requires a separate slide.
Class Definitions
Ontology header
With Dublin Core
Parameters.
Defining hasParameter
Defining hasParameter
hasParameter domain: it applies to the dataset
hasParameter domain: it applies to the dataset
class.
class.
hasParameter range: it applies to a list of 3 OWL
hasParameter range: it applies to a list of 3 OWL
Things
Things
• Cloud_medium, bounds_latitude, and temperature.Cloud_medium, bounds_latitude, and temperature. • This is done using the awkward RDF list structure. This is done using the awkward RDF list structure.
““Give me the first of the rest recursively until I get to nil”Give me the first of the rest recursively until I get to nil”
These three OWL Things are then defined.
These three OWL Things are then defined.
• They are each of type “parameter” They are each of type “parameter”
That is, members of the parameter class.That is, members of the parameter class.
• Each may also be further defined by additional Each may also be further defined by additional properties and classes.
properties and classes.
Temperature has units, for example, bounds_latitude needs Temperature has units, for example, bounds_latitude needs
starting and stopping values in decimal degrees,etc.
starting and stopping values in decimal degrees,etc.
• Or it may be out of scope. I may just need to know that Or it may be out of scope. I may just need to know that the bounds_latitude for particular dataset is located in the bounds_latitude for particular dataset is located in
Parameter:
Cloud_medium
Parameter:
temperature
Parameter:
Finally, Apply It to Something
Finally, Apply It to Something
What is the file PCM.B06.10.dataset1?
• It’s a member of the dataset class, which we
have defined.
What properties does it have?
• bounds_latitude and cloud_medium, as all
such members do.
Where can I get the bounds_latitude for
this data set?
OWL Enriched RDF
Metadata about
Is It Lite, DL, or Full?
Is It Lite, DL, or Full?
Our ontology example is (at least)
Our ontology example is (at least)
DL because we include the oneOf
DL because we include the oneOf
property.
OWL Equivalence and Inheritance
OWL Equivalence and Inheritance
<owl:Class rdf:ID=”user”> <owl:Class rdf:ID=”user”> <owl:equivalentClass <owl:equivalentClass rdf:resource=”person”> rdf:resource=”person”> <owl:Class> <owl:Class> <owl:Class <owl:Class rdf:about=”#magneticSpe rdf:about=”#magneticSpe ctrometer”> ctrometer”> <rdfs:subClassOf> <rdfs:subClassOf> <owl:Restriction> <owl:Restriction> <owl:onProperty <owl:onProperty rdf:resource=”#hasMagnet rdf:resource=”#hasMagnet s”> s”> <owl:allValuesFrom <owl:allValuesFrom rdf:resource=”#Spectrome rdf:resource=”#Spectrome ter”> ter”> </owl:Restriction></owl:Restriction> </rdfs: subClassOf> </rdfs: subClassOf> </owl:Class> </owl:Class>
Other logical relationships
that can be asserted:
•inverseOf,
•TransitveProperty,
•SymmetricProperty,
•FunctionalProperty,
Querying Semantic Data
Querying Semantic Data
The Data Access Working
The Data Access Working
Group (DAWG)
What Is Semantic Querying?
What Is Semantic Querying?
Don’t confuse
Don’t confuse
querying with
querying with
inference.
inference.
Querying just means
Querying just means
retrieving data from
retrieving data from
Semantic data
Semantic data
models.
models.
• Post a query to the Post a query to the
world of distributed RDF world of distributed RDF
data nuggets. data nuggets.
For RDF-like
For RDF-like
structures, this
structures, this
amounts to querying
amounts to querying
triples
triples
Examples
Examples
• Finding an Email Finding an Email
address from a person’s address from a person’s
vCard. vCard.
• Searching across Searching across
subgraphs: get me the subgraphs: get me the
email of the author of email of the author of this document (Dublin this document (Dublin
Core + vCard). Core + vCard).
• Persistent/scheduled Persistent/scheduled queries on updates to queries on updates to
several multimedia several multimedia
The DAWG Working Group
The DAWG Working Group
Unfortunately, there are no standards for
Unfortunately, there are no standards for
querying RDF, etc.
querying RDF, etc.
•
There are solutions, like RDQL/SquishQL
There are solutions, like RDQL/SquishQL
•
These are just not “official”
These are just not “official”
The W3C Data Access Working Group
The W3C Data Access Working Group
DAWG is filling the query gap.
DAWG is filling the query gap.
•
Formed Feb 2004.
Formed Feb 2004.
This is a work in progress:
This is a work in progress:
•
Use Cases and Requirements:
Use Cases and Requirements:
http://www.w3.org/TR/rdf-dawg-uc/
http://www.w3.org/TR/rdf-dawg-uc/
•
BRQL Query Language:
BRQL Query Language:
http://www.w3.org/2001/sw/DataAccess/rq23/
A Simple Query
A Simple Query
Consider the following RDF triple
Consider the following RDF triple
•
<http://example.org/book/book1>
<http://example.org/book/book1>
<http://purl.org/dc/elements/1.1/title> "BRQL
<http://purl.org/dc/elements/1.1/title> "BRQL
Tutorial“
Tutorial“
•
Recall this is equivalent to the sentence “book1
Recall this is equivalent to the sentence “book1
[has] title ‘BRQL Tutorial’”
[has] title ‘BRQL Tutorial’”
•
We may have a large set of such triples in our
We may have a large set of such triples in our
data store.
data store.
We want to make a query on this data like
We want to make a query on this data like
this: “What is the title of book1?”
The Query and the Results
The Query and the Results
We can construct queries on any of the
We can construct queries on any of the
parts of the triple, such as
parts of the triple, such as
SELECT ?title
SELECT ?title
WHERE { <http://example.org/book/book1>
WHERE { <http://example.org/book/book1>
<http://purl.org/dc/elements/1.1/title> ?title .
<http://purl.org/dc/elements/1.1/title> ?title .
}
}
Thus just means “what is the title of
Thus just means “what is the title of
book1?”
book1?”
?title = "BRQL Tutorial“
So What?
So What?
This was a trivial example in which we
This was a trivial example in which we
posed a query on the triple’s object, which
posed a query on the triple’s object, which
was a string.
was a string.
But the object of the triple may be a URI
But the object of the triple may be a URI
(an RDF resource), not just a literal.
(an RDF resource), not just a literal.
•
Or we may construct queries against subjects
Or we may construct queries against subjects
or verbs of triples.
or verbs of triples.
For complicated graphs, this means that
For complicated graphs, this means that
the query returns a “pointer” to another
the query returns a “pointer” to another
section of the graph.
section of the graph.
This means that we can make linked
This means that we can make linked
queries that allow us to navigate graphs.
Linked Queries Across Graph
Linked Queries Across Graph
Sections
Sections
http://.../CMCS/Entry/1
dc:title
H20
http://.../People/DrY dc:creator
vcard:N
vcard:EMAIL
vcard:Given vcard:Family
What If You Can’t Wait?
What If You Can’t Wait?
BRQL is still a work in progress.
BRQL is still a work in progress.
If you need something now, there is
If you need something now, there is
Jena’s RDQL.
Jena’s RDQL.
RDQL allows you to pose triplet
RDQL allows you to pose triplet
queries similar BRQL
queries similar BRQL
•
Jena has a programming interface that
Jena has a programming interface that
allows you to construct and execute
allows you to construct and execute
these queries against RDF.
Tools for Playing with Things
Tools for Playing with Things
Jena Toolkit: Java packages from HPLabs
Jena Toolkit: Java packages from HPLabs
for building Semantic Web applications.
for building Semantic Web applications.
•
http://www.hpl.hp.com/semweb/
http://www.hpl.hp.com/semweb/
•
Both IsaViz and Protégé use this.
Both IsaViz and Protégé use this.
IsaViz: A nice authoring/graphing tool
IsaViz: A nice authoring/graphing tool
•
http://www.w3.org/2001/11/IsaViz/
http://www.w3.org/2001/11/IsaViz/
Protégé: Another ontology authoring tool
Protégé: Another ontology authoring tool
•
http://protege.stanford.edu/
http://protege.stanford.edu/
SiRPAC
SiRPAC
•
Allows you to parse RDF, convert RDF/XML into
Allows you to parse RDF, convert RDF/XML into
graphs and triplets.
graphs and triplets.
Other Tutorials
Other Tutorials
Original Semantic Grid GGF tutorial
Original Semantic Grid GGF tutorial
material is here:
material is here:
•
http://www.semanticgrid.org/presentations/
http://www.semanticgrid.org/presentations/
ontologies-tutorial/
ontologies-tutorial/
Beginner and Advanced OWL tutorials are
Beginner and Advanced OWL tutorials are
here:
here:
•
http://www.co-ode.org/resources/
http://www.co-ode.org/resources/
•
Lectures cover working examples (pizza
Lectures cover working examples (pizza
ontology) built with Protégé.
ontology) built with Protégé.
•
http://www.semanticgrid.org/presentations/
http://www.semanticgrid.org/presentations/
ontologies-tutorial/
Advanced OWL Tutorial
Advanced OWL Tutorial
Courtesy of Sean Bechhofer
OWL Syntaxes
OWL Syntaxes
Abstract Syntax
Abstract Syntax
•
Used in the definition of the language and the
Used in the definition of the language and the
DL/Lite semantics
DL/Lite semantics
OWL as
OWL as
RDF triples
RDF triples
(and thus as, e.g.
(and thus as, e.g.
RDF/XML or N3)
RDF/XML or N3)
•
the “official” concrete syntax
the “official” concrete syntax
•
mapping rules describe how to translate from
mapping rules describe how to translate from
abstract syntax to triples.
abstract syntax to triples.
XML Presentation
XML Presentation
Syntax
Syntax
OWL Ontologies
OWL Ontologies
An OWL ontology consists of a number of Classes,
An OWL ontology consists of a number of Classes,
Properties and Individuals
Properties and Individuals
• All identified via All identified via URIURIs.s.
Classes
Classes
• Have “definitions” providing their characteristicsHave “definitions” providing their characteristics
Properties
Properties
• Characteristics such as transitivity or functionalityCharacteristics such as transitivity or functionality • Domains and RangesDomains and Ranges
Individuals
Individuals
• Class membershipClass membership
XML Datatypes in OWL
XML Datatypes in OWL
OWL supports
OWL supports
XML Schema
XML Schema
primitive datatypes
primitive datatypes
Clean
Clean
separation
separation
between ”object” classes and
between ”object” classes and
datatypes
datatypes
Philosophical reasons:
Philosophical reasons:
• Datatypes structured by Datatypes structured by built-in predicatesbuilt-in predicates
• Not appropriate to form new datatypes using ontology Not appropriate to form new datatypes using ontology language
language
Practical reasons:
Practical reasons:
• Ontology language remains Ontology language remains simple and compactsimple and compact
• ImplementabilityImplementability not compromised – can use hybrid not compromised – can use hybrid reasoner
OWL Class constructors
OWL Class constructors
OWL has a number of
OWL has a number of
operators
operators
for
for
constructing class expressions.
constructing class expressions.
Boolean
Boolean
operators
operators
•
and, or, not
and, or, not
Restrictions
Restrictions
•
slot fillers with explicit quantification
slot fillers with explicit quantification
Enumerated
Enumerated
Classes
Classes
.
.
•
explicit enumerations of the class
explicit enumerations of the class
members
OWL Class Constructors
OWL Class Constructors
Constructor
Constructor ExampleExample
Classes
Classes HumanHuman intersectionOf
intersectionOf (and)
(and) intersectionOf(Human Male)intersectionOf(Human Male) unionOf (or)
unionOf (or) unionOf(Doctor Lawyer)unionOf(Doctor Lawyer) complementOf
complementOf (not)
(not) complementOf(Male)complementOf(Male) oneOf
oneOf oneOf(john mary)oneOf(john mary) someValuesFrom
someValuesFrom restriction(hasChild someValuesFrom restriction(hasChild someValuesFrom Lawyer)
Lawyer) allValuesFrom
allValuesFrom restriction(hasChild allValuesFrom Doctor)restriction(hasChild allValuesFrom Doctor) minCardinality
minCardinality restriction(hasChild minCardinality (2))restriction(hasChild minCardinality (2)) maxCardinality
OWL Class constructors
OWL Class constructors
The operators have an
The operators have an
associated
associated
semantics
semantics
•
Given in terms of a domain:
Given in terms of a domain:
•
and an
and an
interpretation
interpretation
function
function
I
I
I
I
:
:
concepts
concepts
!
!
(
(
)
)
I
I
:
:
properties
properties
!
!
(
(
£
£
)
)
I
I
:
:
individuals
individuals
!
!
OWL Constructor Semantics
OWL Constructor Semantics
Construc
Construc
tor
tor
Example
Example
Semantics
Semantics
Classes
Classes
Human
Human
I(Human)
I(Human)
intersectio
intersectio
nOf
nOf
intersectionOf(Huma
n Male)
intersectionOf(Huma
n Male)
I(Human)
I(Male)
I(Human)
I(Male)
Å
Å
unionOf
unionOf
unionOf(Doctor
unionOf(Doctor
Lawyer)
Lawyer)
I(Doctor)
[
I(Doctor)
[
I(Lawyer)
I(Lawyer)
compleme
compleme
ntOf
ntOf
complementOf(Male)
complementOf(Male)
n
n
I(Male)
I(Male)
oneOf
oneOf
oneOf(john mary)
oneOf(john mary)
{
{
I(john)
I(john)
,
,
I(mary)
OWL Constructor Semantics
OWL Constructor Semantics
ConstructorConstructor ExampleExample SemanticsSemantics
someValuesFr someValuesFr om
om restriction(hasChildrestriction(hasChild someValuesFrom someValuesFrom Lawyer)
Lawyer)
{x
{xj9j9y.y.hhx,yx,yi2i2I(hasChild)I(hasChild)
Æ
Æ
y
y22I(Lawyer)I(Lawyer)}}
allValuesFrom
allValuesFrom restriction(hasChilrestriction(hasChil d d allValuesFrom allValuesFrom Doctor) Doctor) {x
{xj8j8y.y.hhx,yx,yi2i2I(hasChild)I(hasChild)
)
) y
y22I(Doctor)I(Doctor)}}
minCardinalit minCardinalit y
y restriction(hasChildrestriction(hasChild minCardinality minCardinality (2))
(2))
{x
{x|# |# hhx,yx,yi2i2I(hasChild)I(hasChild)
¸
¸ 2}2}
maxCardinalit maxCardinalit y
y restriction(hasChildrestriction(hasChild maxCardinality maxCardinality (2))
(2))
{x
{x|# |# hhx,yx,yi2i2I(hasChild)I(hasChild)
·
OWL Axioms
OWL Axioms
Axioms
Axioms
allow us to add further statements about
allow us to add further statements about
arbitrary concept expressions and properties
arbitrary concept expressions and properties
• Disjointness, equivalence, transitivity of properties etc.Disjointness, equivalence, transitivity of properties etc.
An interpretation is then a model of the axioms iff
An interpretation is then a model of the axioms iff
it satisfies
it satisfies
every
every
axiom in the ontology.
axiom in the ontology.
Axiom
Axiom ExampleExample SemanticsSemantics
EquivalentClass
EquivalentClass
es
es EquivalentClass(ManintersectionOf(Human EquivalentClass(ManintersectionOf(Human
Male))
Male))
I(Man)
I(Man) = = I(Human)I(Human) ÅÅ
I(Male) I(Male)
DisjointClasses
DisjointClasses DisjointClasses(Animal DisjointClasses(Animal Plant)
Plant) I(Animal)I(Animal) ÅÅ I(Plant)I(Plant) = = ;;
SameIndividual
SameIndividual
As
As SameIndividualAs(GeorgeWBush SameIndividualAs(GeorgeWBush PresidentBush)
PresidentBush)
I(GeorgeWBush) I(GeorgeWBush) = =
Basic Inference Tasks
Basic Inference Tasks
Inference can now be defined w.r.t.
Inference can now be defined w.r.t.
interpretations/models.
interpretations/models.
• C C subsumessubsumes D w.r.t. K iff for D w.r.t. K iff for everyevery model model I of I of KK, , I(D)
I(D) µµ I(C) I(C)
• C is C is equivalentequivalent to D w.r.t. K iff for to D w.r.t. K iff for everyevery model model I of I of K, I (
K, I (C)C) = I (D) = I (D)
• C is C is satisfiablesatisfiable w.r.t. K iff there exists w.r.t. K iff there exists somesome model model I I of K s.t.
of K s.t. I (C) I (C) ;;
Querying
Querying
knowledge
knowledge
• x is an x is an instanceinstance of C w.r.t. K iff for of C w.r.t. K iff for everyevery model model I of I of K, I(x)
K, I(x) 22 I(C) I(C)
•
h
hx,yx,yii is an is an instanceinstance of R w.r.t. K iff for, of R w.r.t. K iff for, everyevery model model I I
of of KK, ,
(I(x),I(y))
Why Reasoning?
Why Reasoning?
Why do we want it?Why do we want it?
• Semantic Web aims at “machine understanding”Semantic Web aims at “machine understanding”
• UnderstandingUnderstanding closely related to closely related to reasoningreasoning
Given key role of ontologies in the Semantic Web, it will be Given key role of ontologies in the Semantic Web, it will be
essential to provide
essential to provide toolstools and and servicesservices to help users: to help users:
• Design and maintain high quality ontologies, e.g.:Design and maintain high quality ontologies, e.g.:
MeaningfulMeaningful —— all named classes can have instances all named classes can have instances CorrectCorrect —— captured intuitions of domain experts captured intuitions of domain experts Minimally redundantMinimally redundant —— no unintended synonyms no unintended synonyms
Richly axiomatisedRichly axiomatised —— (sufficiently) detailed descriptions (sufficiently) detailed descriptions
• Answer Answer queriesqueries over ontology classes and instances, e.g.: over ontology classes and instances, e.g.:
Find more general/specific classesFind more general/specific classes
Why
Why
Decidable
Decidable
Reasoning?
Reasoning?
OWL DL constructors/axioms restricted so reasoning is OWL DL constructors/axioms restricted so reasoning is
decidable
decidable
Consistent with Semantic Web's Consistent with Semantic Web's layered architecturelayered architecture
• XML provides syntax XML provides syntax transport layertransport layer
• RDF(S) provides basic RDF(S) provides basic relational languagerelational language and simple and simple ontological primitives
ontological primitives
• OWL DL provides powerful but still decidable OWL DL provides powerful but still decidable ontology ontology language
language
• Further layers may (will) extend OWLFurther layers may (will) extend OWL
Will almost certainly be undecidableWill almost certainly be undecidable
Facilitates provision of Facilitates provision of reasoning servicesreasoning services
• Known “practical” Known “practical” algorithmsalgorithms • Several implemented Several implemented systemssystems
• Evidence of Evidence of empirical tractabilityempirical tractability
Understanding dependent on Understanding dependent on reliable & consistentreliable & consistent
XML Primer
XML Primer
General characteristics of XML
Basic XML
Basic XML
XML consists of human XML consists of human
readable tags readable tags
Schemas define rules for a Schemas define rules for a
particular dialect. particular dialect.
XML Schema is the root, XML Schema is the root,
defines the rules for defines the rules for
making other XML making other XML
schemas. schemas.
Tree structure: tags must Tree structure: tags must
be closed in reverse order be closed in reverse order
that they are opened. that they are opened.
Tags can be modified by Tags can be modified by
attributes attributes
• name, minOccursname, minOccurs
Tags enclose either strings Tags enclose either strings
or structured XML or structured XML
<complexType name="FaultType">
<complexType name="FaultType">
<sequence><sequence>
<element name="FaultName" <element name="FaultName"
type="xsd:string" /> type="xsd:string" />
<element name="MapView<element name="MapView/>/>
<element name="CartView“/><element name="CartView“/>
<element name="MaterialProps" <element name="MaterialProps" minOccurs="0" />
minOccurs="0" />
<choice><choice>
<element name="Slip" /><element name="Slip" />
<element name="Rate" /><element name="Rate" />
</choice></choice>
</sequence></sequence>
Namespaces and URIs
Namespaces and URIs
XML documents can be XML documents can be composed of several
composed of several
different schemas.
different schemas.
Namespaces are used to Namespaces are used to identify the source schema
identify the source schema
for a particular tag.
for a particular tag.
• Resolves name conflictsResolves name conflicts —”full path”
—”full path”
Values of namespaces are Values of namespaces are URIs.
URIs.
• URI are just structured URI are just structured names.
names.
May point to May point to
something not something not electronically electronically retrievable retrievable
• URLs are special cases.URLs are special cases.
<
<
xsd:schema xsd:schemaxmlns:xsd="http://www.w xmlns:xsd="http://www.w 3.org/2001/XMLSchema" 3.org/2001/XMLSchema" xmlns:gem="http://comm xmlns:gem="http://comm grids.indiana.edu/GCWS/S grids.indiana.edu/GCWS/S chema/GEMCodes/Faults”