The Wine Ontology

Download Report

Transcript The Wine Ontology

An Introduction to Ontologies
in OWL
Bibliography
The OWL Guide
The OWL Overview
Description Logic slides from Enrico Franconi
Artificial Intelligence A Modern Approach by Russel and Nordig
95-733 Internet Technologies
1
What is an Ontology?
• A representation of terms and their
interrelationships (OWL Overview)
• A formal conceptualization of the world
• Smart data
95-733 Internet Technologies
2
Ontology Languages
• Typically introduce concepts, properties,
relationships between concepts and
constraints
• May be expressed with diagrams
• ER Diagrams and UML Class Diagrams
are ontology languages
• OWL (The Web Ontology Language) is
expressed in XML
• OWL is a distributed ontology language
95-733 Internet Technologies
3
The OWL Language
• February 10, 2004 OWL and RDF become W3C
Recommendations
• See Jena from Hewlett-Packard Research for an
existing Java API
• See Protégé-2000 at Stanford University for an
existing OWL editor
• Big names in this space include Jim Hendler,
and Debra McGuiness
• A large example can be found at
http://www.mindswap.org/2003/CancerOntology/
nciOncology.owl
95-733 Internet Technologies
4
From the W3C
95-733 Internet Technologies
5
OWL Has Three Sublanguages
• OWL Lite (decidable)
• OWL DL (Description Logic) (Decidable)
• OWL Full (Allows classes as instances of
classes)
• As we move from OWL Lite to OWL full we
increase expressiveness and logical
complexity.
95-733 Internet Technologies
6
Decidability
• A proof procedure r is incomplete if there
are true statements that the procedure
cannot infer.
• Godel (1930’s) showed that, for first order
logic, any statement entailed by a set of
statements can be proved from the set. In
other words, a proof procedure exists.
• In 1965, Robinson found the resolution
method.
95-733 Internet Technologies
7
Decidability
• But, entailment is semi-decidable. If a
statement does not follow from the
premises it may go on and on.
If S follows the proof
of S will emerge after
some time.
Premises
Resolution is complete
Statment S
95-733 Internet Technologies
If S does not follow
the procedure may loop
forever.
8
Open/Closed World Assumption
•
•
•
•
Semantic web languages make an open-world assumption.
- If a fact does not follow from premises, it may be the case that the fact is true or
false.
- Under an open-world assumption, we just don't know.
- No single agent has complete knowledge.
- We represent new knowledge as we discover it.
Under a closed world assumption, if a fact does not follow from premises then it is
false.
- The system has complete knowledge.
Consider an employee table
Robert Faculty
Donald Faculty
Sue
Admin
Is Andy an employee? No. Not under the closed world assumption.
Under the open world assumption, we don't know.
95-733 Internet Technologies
9
OWL Lite is a Decidable Language
• A Class is a set of individuals
• The class Thing is the superclass of all
OWL classes
• The class Nothing is a subclass of all OWL
classes and has no individuals members
• Classes may be defined as subClasses of
other classes
95-733 Internet Technologies
10
Three classes that subclass Thing
<owl:Class rdf:ID=“Winery”/>
<owl:Class rdf:ID=“Region”/>
<owl:Class rdf:ID=“ConsumableThing”/>
These terms may be referred to from within this
Document by ‘#Winery’,’ #Region’ and
‘#ConsumableThing’.
Other ontologies may refer to these terms with
‘SomeURI#Winery’, ‘SomeURI#Region’ and so
on.
95-733 Internet Technologies
11
Class Hierarchies built with
subClassOf
<owl:Class rdf:ID=“PotableLiquid”>
<rdfs:subClassOf rdf:resource = “#ConsumableThing” />
…
</owl:Class>
<owl:Class rdf:ID=“EdibleThing”>
<rdfs:subClassOf rdf:resource = “#ConsumableThing” />
…
</owl:Class>
Deduction:
If x is a PotableLiquid
then x is a ConsumableThing
95-733 Internet Technologies
12
Wine and Pasta
<owl:Class rdf:ID=“Wine”>
<rdfs:subClassOf rdf:resource =
“#PotableLiquid” />
…
</owl:Class>
<owl:Class rdf:ID = “Pasta”
<rdfs:subClassOf rdf:resource = “#EdibleThing” />
…
Deduction:
</owl:Class>
95-733 Internet Technologies
If x is Pasta then x is
a ConsumableThing
13
SweetFruit and NonSweetFruit
<owl:Class rdf:ID=“SweetFruit”> <!– food.xml-->
<rdfs:subClassOf
rdf:resource=“#EdibleThing”/>
</owl:Class>
<owl:Class rdf:ID=“NonSweetFruit”> <!– food.xml-->
<rdfs:subClassOf
rdf:resource=“#EdibleThing”/>
…
</owl:Class>
95-733 Internet Technologies
14
Defining Individuals
<Region rdf:ID=“CentralCoastRegion”/>
Is identical to
<owl:Thing rdf:ID=“CentralCoastRegion”/>
<owl:Thing rdf:about=“#CentralCoastRegion”>
<rdf:type rdf:resource=“#Region”/>
</owl:Thing>
95-733 Internet Technologies
15
Another individual
<owl:Class rdf:ID=“Grape”>
<!– food.xml-->
<rdfs:subClassOf rdf:resource=“#SweetFruit”/>
</owl:Class>
<!– wine.xml -->
<owl:Class rdf:ID=“WineGrape”>
<rdfs:subClassOf rdf:resource=“&food;Grape”/>
</owl:Class>
<WineGrape rdf:ID=“CabernetSauvignonGrape” />
Deduction: CabernetSauvignon is a SweetFruit
95-733 Internet Technologies
16
So far we have…
Thing
Winery
Region
• CentralCoastalRegion
ConsumableThing
PotableLiquid
Wine
SweetFruit
EdibleThing
NonSweetFruit
Pasta
Grape
WineGrape
95-733 Internet Technologies
•CabernetSauvignonGrape
17
So far we have …
• Classes
• Individuals
• We now need properties to state facts
about classes and facts about individuals
95-733 Internet Technologies
18
Properties
• Properties are binary relations
• A binary relation R from a set X to a set Y
is a subset of the Cartesian product X x Y.
If (x,y) ε R, we write xRy and say x is
related to y.
95-733 Internet Technologies
19
Binary Relations
Suppose the set X has members {a,b} and
the set Y has members {c,d,e}.
XxY = {(a,c),(a,d),(a,e),(b,c),(b,d),(b,e)}
Let R = {(a,c),(b,e)}
Since (a,c) ε R and (b,e) ε R we write aRc
and bRe.
Notice that a binary relation is a set of ordered pairs.
95-733 Internet Technologies
20
Domain and Range
The set {x ε X | (x,y) ε R for some y ε Y} is
called the domain of R.
The domain of R = {(a,c),(b,e)} is {a,b}.
The set {y ε Y | (x,y) ε R for some x ε X} is
called the range of R.
The range of R = {(a,c),(b,e)} is {c,e}.
95-733 Internet Technologies
21
Properties
• R is Transitive if and only if
xRy and yRz imply xRz
locateIn is transitive in the wine ontology
• R is Symmetric if and only if
xRy iff yRx
adjacentTo is symmetric in the wine
ontology
95-733 Internet Technologies
22
Properties
• R is Functional if and only if
xRy and xRz implies y = z
hasVintageYear is functional in the wine
ontology
• R1 and R2 are Inverse Properties if and only if
xR1y iff yR2x
hasMaker and producesWine are inverse
relations in the wine ontology
95-733 Internet Technologies
23
OWL’s Property Hierarchy
• Thing is a superset of Property
• Property is a superset of ObjectProperty
• Property is a superset of DataProperty
• An ObjectProperty associates a class
instance with another class instance.
• A DataProperty associates a class
instance with a datatype value
95-733 Internet Technologies
24
OWL’s Property Hierarchy
Example
Thing
Mammal
Person
• Mike
• Sue
Indentation shows subset
relationships.
Set elements are marked
with dots.
Property
ObjectProperty
hasRelative
hasSibling
• (Mike,Sue)
DataProperty
hasAge
• (Mike,23)
95-733 Internet Technologies
25
OWL Property Syntax
<owl:ObjectProperty rdf:ID=“locatedIn”>
<rdfs:domain
rdf:resource=“OWLURI#Thing”/>
<rdfs:range
rdf:resource=“#Region”/>
</owl:ObjectProperty>
“OWLURI” will actually appear as the official OWL URI.
95-733 Internet Technologies
26
Adding pairs to locatedIn
<Region rdf:ID=“SantaCruzMountainsRegion”>
<locatedIn rdf:resource=“#CaliforniaRegion”/>
</Region>
<CabernetSauvignon
rdf:ID=
“SantaCruzMountainVinyardCabernetSauvignon”>
<locatedIn
rdf:resource=“#SantaCruzMountainsRegion”/>
…
Can we make a
</CabernetSauvignon>
deduction?
95-733 Internet Technologies
27
locatedIn
• locatedIn is defined as a set of ordered pairs.
• Each pair must contain an owl:Thing (maybe a Region)
followed by value from the set Region.
• For example:
locatedIn =
{(SantaCruzMountainsRegion, CaliforniaRegion),
(SantaCruzMountainVinyardCabernetSauvignon,
SantaCruzMountainsRegion)…}
• A deduction like the following is not yet possible…
The Thing SantaCruzMountainVinyardCabernetSauvignon
is locatedIn CaliforniaRegion
95-733 Internet Technologies
28
Define locatedIn as Transitive
<owl:ObjectProperty rdf:ID=“locatedIn”>
<rdf:type rdf:resource=“TransitiveProperty” /> <!– include an OWLURI -->
<rdfs:domain
rdf:resource=“OWLURI#Thing”/>
<rdfs:range
rdf:resource=“#Region”/>
</owl:ObjectProperty>
•
A deduction like the following is now possible…
The Thing SantaCruzMountainVinyardCabernetSauvignon
is locatedIn CaliforniaRegion
95-733 Internet Technologies
29
Given the madeFromGrape
property
<owl:ObjectProperty
rdf:ID=“madeFromGrape”>
<rdfs:domain rdf:resource=“#Wine”/>
<rdfs:range rdf:resource=“#WineGrape”/>
</owl:ObjectProperty>
madeFromGrape
(#Wine,#WineGrape)
(#Wine,#WineGrape)
95-733 Internet Technologies
30
And…
<owl:Thing
ref:ID=“LindemansBin65Chardonnay”>
<madeFromGrape
rdf:resource=“#ChardonnayGrape”/>
<owl:Thing>
We can deduce that
LindemansBin65Chardonnay is a Wine.
95-733 Internet Technologies
31
Given a Property…
<owl:Class rdf:ID=“WineDescriptor”/>
<owl:Class rdf:ID=”WineColor”>
<rdfs:subClassOf rdf:resource=“WineDescriptor”/>
…
<owl:Class>
<owl:ObjectProperty rdf:ID=“hasWineDescriptor”>
<rdfs:domain rdf:resource=“#Wine”/>
<rdfs:range rdf:resource=“#WineDescriptor”/>
<owl:ObjectProperty>
95-733 Internet Technologies
32
We can define a subproperty
<owl:ObjectProperty rdf:ID=“hasColor”>
<rdfs:subPropertyOf rdf:resource=“#hasWineDescriptor”/>
<rdfs:domain rdf:resource=“#Wine”/>
<rfds:range rdf:resource = “#WineColor” />
…
hasWineDescriptor
</owl:ObjectProperty>
(#Wine,#WineDescriptor)
(#Wine,#WineDescriptor)
(#Wine,#WineDescriptor)
(#Wine,#WineDescriptor)
(#Wine,#WineColor)
(#Wine,#WineColor)
95-733 Internet Technologies
33
And make it functional.
<owl:ObjectProperty rdf:ID=“hasColor”>
<rdf:type rdf:resource=“&owl;FunctionalProperty”/>
<rdfs:subPropertyOf rdf:resource=“#hasWineDescriptor”/>
<rdfs:domain rdf:resource=“#Wine”/>
<rfds:range rdf:resource = “#WineColor” />
hasWineDescriptor
…
</owl:ObjectProperty>
Now, for each Wine, there
can be at most one WineColor.
95-733 Internet Technologies
(#Wine,#WineDescriptor)
(#Wine,#WineDescriptor)
(#Wine,#WineDescriptor)
(#Wine,#WineDescriptor)
(#Wine,#WineColor)
(#Wine,#WineColor)
34
Anonymous Classes
<owl:Class rdf:ID=“Wine”>
<rdfs:subClassOf rdf:resource = “&food;#PotableLiquid” />
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource=“#madeFromGrape”/>
<owl:minCardinality rdf:datatype=
“&xsd;nonNegativeInteger”>1
</owl:minCardinalty>
So, those Things that are in
</owl:restriction>
the PotableLiquid set that are
<rdfs:subClassOf>
also in the set of things made
…
from at least one grape are
</owl:Class>
Wines. If we know that x is
a Wine then we know it has at
95-733 Internet Technologiesleast one madeFromGrape 35
property defined.
A Wine Individual
<CabernetSauvignon
rdf:ID= “SantaCruzMountainVinyardCabernetSauvignon”>
<locatedIn rdf:resource=“#SantaCruzMountainsRegion”/>
:
</CabernetSauvignon>
This says nothing about what grape it’s made from. To find that out
we must look to the class CabernetSauvignon. There we learn all
wines of this variety are madeFromGrape CabernetSauvignon.
So, individuals inherit properties and property values from their class.
95-733 Internet Technologies
36
What does this mean?
<owl:Class rdf:ID="#Student">
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="#Person"/>
<owl:Restriction>
<owl:onProperty rdf:resource="#enrolledIn"/>
<owl:minCardinality rdf:datatype=
"&xsd;nonNegativeInteger"> 1
</owl:minCardinality>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
95-733 Internet Technologies
37
And this?
<Student rdf:ID="John">
<friendOf>
<Student rdf:resource="#Peter" />
</friendOf>
</Student>
95-733 Internet Technologies
38
How about this one?
<Student rdf:about=" http://www.student.org#DanielaRenuncio ">
<owl:sameIndividualAs rdf:resource=
"http://www.student.org#Daniela_de_Senna_Eyng_Renuncio"/>
</Student>
95-733 Internet Technologies
39