Ontology Languages
Noman Islam
FAST-NU
Karachi
PART I
RDF / RDFS, OWL
Introduction
• What is Ontology?
• What is Semantic Web?
• Ontology Languages (OL)
Ontology Languages for the Semantic Web, 2000, IEEE Intelligent Systems
Introduction – contd…
•
Requirements for a good Ontology Language
–
Well defined syntax
–
Well defined semantics
–
Efficient reasoning support
–
Sufficient expressive power
–
Convenience of expression
Note:
1. Semantics is a prerequisite for reasoning
Introduction to RDF
(
http://www.w3.org/RDF/
)
• RDF - a W3C recommendation since 2004
and part of W3C’s semantic web activity -
describes web resources for machine
processing
• RDF Data Model
– Express Simple statements using subject,
predicate and object
– Graph model and XML model
Dr. Zubair
Shoukat
Introduction to RDF - contd…
RDF examples:
Example 1:<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<rdf:Description rdf:about="http://www.nu.edu.pk/Zubair">
<rdf:supervises>Shoukat</rdf:supervises>
</rdf:Description>
</rdf:RDF >
RDF Online Validator (
http://www.w3.org/RDF/Validator/
)
RDF Container elements: <rdf:Bag>, <rdf:Seq>, <rdf:Alt>,
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/ 1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.recshop.fake/ cd#"> <rdf:Description rdf:about="http://www.recshop.fake/cd/ Beatles"> <cd:artist> <rdf:Bag> <rdf:li>John</rdf:li> <rdf:li>Paul</rdf:li> <rdf:li>George</rdf:li> <rdf:li>Ringo</rdf:li> </rdf:Bag> </cd:artist> </rdf:Description> </rdf:RDF>
Introduction to RDFS
• Shortcomings of RDF:
– No mechanism for describing properties, relationships
– rdfs:Class, rdf:type and rdfs:subClassOf
– rdfs:range, rdfs:domain
<?xml version="1.0"?> <rdf:RDF
xmlns:rdf= "http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xml:base= "http://www.animals.fake/animals#"> <rdf:Description rdf:ID="animal">
<rdf:type
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> </rdf:Description>
<rdf:Description rdf:ID="horse">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#animal"/> </rdf:Description> </rdf:RDF>
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base= "http://www.animals.fake/animals#">
<rdfs:Class rdf:ID="animal" />
<rdfs:Class rdf:ID="horse">
<rdfs:subClassOf rdf:resource="#animal"/>
</rdfs:Class>
Introduction to OWL
• Shortcomings of RDFS:
– local scope of properties
– disjointness of classes
– boolean combination of classes
– cardinality restrictions
– special characteristics of properties
• OWL Species:
– OWL Full
– OWL DL
– OWL Lite
Introduction to OWL – contd…
•
Disjoint Classes
<owl:Class rdf:about="associateProfessor"> <owl:disjointWith rdf:resource="#professor"/>
<owl:disjointWith rdf:resource="#assistantProfessor"/> </owl:Class>
•
Domain and Range Elements
<owl:ObjectProperty rdf:ID="isTaughtBy"> <owl:domain rdf:resource="#course"/>
<owl:range rdf:resource="#academicStaffMember"/> <rdfs:subPropertyOf rdf:resource="#involves"/> </owl:ObjectProperty>
•
Special Characteristics of properties
<owl:ObjectProperty rdf:ID="teaches">
<rdfs:range rdf:resource="#course"/>
<rdfs:domain rdf:resource="#academicStaffMember"/>
<owl:inverseOf rdf:resource="#isTaughtBy"/>
Introduction to OWL – contd…
•
Cardinality Restrictions
Introduction to OWL – contd…
•
Special Properties of properties (owl:TransitiveProperty,
owl:SymmetricProperty, owl:FunctionalProperty,
owl:InverseFunctionalProperty)
<owl:ObjectProperty rdf:ID="hasSameGradeAs"> <rdf:type rdf:resource="&owl;TransitiveProperty" /> <rdf:type rdf:resource="&owl;SymmetricProperty" /> <rdfs:domain rdf:resource="#student" />
<rdfs:range rdf:resource="#student" /> </owl:ObjectProperty>
•
Boolean combinations
References
•
http://www.w3schools.com/RDF/default.asp
• “RDF Tutorial”, Pierre Antoine Champin, April,
2001
• “Web Ontology Language: OWL”, Grigoris
Antoniou and Frank van Harmelen
PART II
OWL, OWL-S, WSMO
OWL Current Status
• OWL 1.1
• OWL 2.0 Working Draft:
–
http://www.w3.org/TR/2008/WD-owl2-syntax-2008041
1/
• OWL Mailing List
–
http://lists.w3.org/Archives/Public/public-owl-dev/
• OWL API
An African Wildlife Ontology [5]
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl ="http://www.w3.org/2002/07/owl#" xmlns="http://www.mydomain.org/african"> <owl:Ontology rdf:about=""> <owl:VersionInfo>My example version 1.2, 17 October 2002 </owl:VersionInfo>
</owl:Ontology>
<owl:Class rdf:ID="animal">
<rdfs:comment>Animals form a class</rdfs:comment> </owl:Class>
<owl:Class rdf:ID="plant"> <rdfs:comment>
Plants form a class disjoint from animals </rdfs:comment>
<owl:disjointWith="#animal"/> </owl:Class>
<owl:Class rdf:ID="tree">
<rdfs:comment>Trees are a type of plants</rdfs:comment> <rdfs:subClassOf rdf:resource="#plant"/>
An African Wildlife Ontology
<owl:Class rdf:ID="carnivore">
<rdfs:comment>Carnivores are exactly those animals
that eat also animals</rdfs:comment>
<owl:intersectionOf rdf:parsetype="Collection">
<owl:Class rdf:about="#animal"/>
<owl:Restriction>
<owl:onProperty rdf:resource="#eats"/>
<owl:someValuesFrom rdf:resource="#animal"/>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
OWL-S
• Ontology:
– O = <c, p, a>
• Web Service
– Service =<d,f,p>
• OWL-S 1.2
•
http://www.daml.org/services/owl-s/
• four fundamental points:
OWL-Service
•
presents
,
describedBy
, and
supports
<service:Service rdf:ID="BravoAir_ReservationAgent">
<service:presents
rdf:resource="BravoAirProfile.owl#Profile_BravoAir_ReservationAgent"/>
<service:describedBy rdf:resource="BravoAirProcess.owl#BravoAir_Process" />
<service:supports
OWL-S Profile
• human-readable information like serviceName,
textDescription and contactInformation
• Functional description:
– IOPE
• Inputs and Outputs
• Preconditions and effects
OWL-S Service Model
• Inputs and Outputs
• Preconditions and effects
• Conditioning outputs and effects
– SWRL
• Process Types:
– Atomic Process
– Simple Process
– Composite Process
• Sequence, split, choice, if-then-else, iterate etc.
<process:hasResult> <process:Result> <process:hasResultVar> <process:ResultVar rdf:ID="CreditLimH"> <process:parameterType rdf:resource="&ecom;#Dollars"/> </process:ResultVar> </process:hasResultVar>
<process:inCondition expressionLanguage="&expr;#KIF" rdf:dataType="&xsd;#string"> (and (current-value (credit-limit ?CreditCard)
?CreditLimH)
(>= ?CreditLimH ?purchaseAmt)) </process:inCondition> <process:withOutput> <process:OutputBinding> <process:toParam rdf:resource="#ConfirmationNum"/> <process:valueFunction rdf:parseType="Literal"> <cc:ConfirmationNum xsd:datatype="&xsd;#string"/> </process:valueFunction> </process:OutputBinding> </process:withOutput>
<process:hasEffect expressionLanguage="&expr;#KIF" rdf:dataType="&xsd;#string"> (and (confirmed (purchase ?purchaseAmt) ?ConfirmationNum)
(own ?objectPurchased)
(decrease (credit-limit ?CreditCard) ?purchaseAmt))
</process:hasEffect> </process:Result> </process:hasResult>
OWL-S Groundings
• A predefined grounding, mapping to WSDL
– OWL-S atomic process is mapped to WSDL operation
WSDL Grounding
<grounding:WsdlAtomicProcessGrounding rdf:ID="WsdlGrounding_GetDesiredFlightDetails"> <grounding:owlsProcess rdf:resource="BravoAirProcess.owl#GetDesiredFlightDetail s"/> <grounding:wsdlOperation rdf:resource="#GetDesiredFlightDetails_operation"/> <grounding:wsdlInputMessage rdf:datatype="&xsd;anyURI"> BravoAirGrounding.wsdl#GetDesiredFlightDetails_Input </grounding:wsdlInputMessage> <grounding:wsdlInput> <grounding:WsdlInputMessageMap> <grounding:owlsParameter rdf:resource="BravoAirProcess.owl#DepartureAirport"/> <grounding:wsdlMessagePart rdf:datatype="&xsd;anyURI"> BravoAirGrounding.wsdl#departureAirport </grounding:wsdlMessagePart> </grounding:WsdlInputMessageMap> </grounding:wsdlInput> ...In WSDL Description
<operation name="GetDesiredFlightDetails_operation" owl-s-process="BravoAir:#GetDesiredFlightDetails">
<input message="tns:GetDesiredFlightDetails_Input"/> </operation>
<message name="GetDesiredFlightDetails_Input"> <part name="departureAirport"
owl-s-parameter="BravoAir:#departureAirport_In" /> ...
WSMO
• WSMO Elements:
– Ontologies
– Goals
– WebServices
• Capabilities
• Interfaces (choreography, orchestration)
– Mediators
An Example of WSMO
goal <<http://www.wsmo.org/2004/d3/d3.2/v0.1/20041004/resources/goal.wsml>> nonFunctionalProperties
dc:description hasValue "Buying a train ticket from Innsbruck to Frankfurt on..." [...] endNonFunctionalProperties importedOntologies <<http://www.wsmo.org/ontologies/dateTime>> [...] webservice <<http://www.wsmo.org/2004/d3/d3.2/v0.1/20041004/resources/ws.wsml>> nonFunctionalProperties [...]
dc:description hasValue "Web Service for booking online train tickets for Austria and Germany" [...] endNonFunctionalProperties importOntologies <<http:://www.wsmo.org/ontologies/dateTime>>, <<http:://www.wsmo.org/ontologies/trainConnection>>, <<http:://www.wsmo.org/ontologies/purchase>>, <<http:://www.wsmo.org/ontologies/location>> capability _# [...] interface _# nonFunctionalProperties
dc:description hasValue "describes the Interface of Web Service (not specified yet)" endNonFunctionalProperties
Ontology Reasoning
• Reasoning is provided mapping ontology
language to a known logical formalism
• OWL is mapped on a description logic
• Reasoners like FaCT and RACER
• We may reason about:
– Class membership
– Equivalence of classes - denote the same set in any
legal world description
– In consistency -denotes the empty set in any legal
world description.
References
1.
“Ontology Language Standardisation Efforts”,
OntoWeb: Ontology-based Information Exchange for
Knowledge Management and Electronic Commerce,
2002
2.
“Web service interface description languages”,
3.
“A Conceptual Comparison between WSMO and
OWL-S”, WSMO Working Draft, January 6, 2005
4.
“OWL-S: Semantic Markup for Web Services”, W3C
Member Submission 22 November 2004