1 of 28

Ontology Languages

Noman Islam

FAST-NU

Karachi

Ontology Languages

Noman Islam�NU-FAST, Karachi

BRINGING THE WEB TO ITS FULL POTENTIAL

Bringing the Web to its full potential

1

2 of 28

PART I

RDF / RDFS, OWL

21st May, 2008

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

2

3 of 28

Introduction

  • What is Ontology?
  • What is Semantic Web?
  • Ontology Languages (OL)

Ontology Languages

Noman Islam�NU-FAST, Karachi

Ontology Languages for the Semantic Web, 2000, IEEE Intelligent Systems

Asunción Gómez-Pérez and Oscar Corcho

Bringing the Web to its full potential

3

4 of 28

Introduction – contd…

  • Requirements for a good Ontology Language
    • Well defined syntax
    • Well defined semantics
    • Efficient reasoning support
    • Sufficient expressive power
    • Convenience of expression

Note:

    • Semantics is a prerequisite for reasoning
    • There is a trade-off between expressive power and efficient reasoning

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

4

5 of 28

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

Ontology Languages

Noman Islam�NU-FAST, Karachi

Dr. Zubair

Shoukat

advises

Bringing the Web to its full potential

5

6 of 28

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>,

Ontology Languages

Noman Islam�NU-FAST, Karachi

<?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>

Example 2 (www.w3schools.org):

Bringing the Web to its full potential

6

7 of 28

Introduction to RDFS

  • Shortcomings of RDF:
    • No mechanism for describing properties, relationships
    • rdfs:Class, rdf:type and rdfs:subClassOf
    • rdfs:range, rdfs:domain

Ontology Languages

Noman Islam�NU-FAST, Karachi

<?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>

</rdf:RDF>

Bringing the Web to its full potential

7

8 of 28

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
  • OWL species are upward compatible

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

8

9 of 28

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"/>

</owl:ObjectProperty

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

9

10 of 28

Introduction to OWL – contd…

  • Cardinality Restrictions

Example 1:

<owl:Class rdf:about="#firstYearCourse">

<rdfs:subClassOf>

<owl:Restriction>

<owl:onProperty rdf:resource="#isTaughtBy"/>

<owl:allValuesFrom rdf:resource="#Professor"/>

</owl:Restriction>

</rdfs:subClassOf>

</owl:Class>

Example 2:

<owl:Class rdf:about="#mathCourse">

<rdfs:subClassOf>

<owl:Restriction>

<owl:onProperty rdf:resource="#isTaughtBy"/>

<owl:hasValue rdf:resource="#949352"/>

</owl:Restriction>

</rdfs:subClassOf>

</owl:Class>

Ontology Languages

Noman Islam�NU-FAST, Karachi

Example 3:

<owl:Class rdf:about="#course">

<rdfs:subClassOf>

<owl:Restriction>

<owl:onProperty rdf:resource="#isTaughtBy"/>

<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">

1

</owl:minCardinality>

</owl:Restriction>

</rdfs:subClassOf>

</owl:Class>

Bringing the Web to its full potential

10

11 of 28

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

<owl:Class rdf:about="#course">

<rdfs:subClassOf>

<owl:Restriction>

<owl:complementOf rdf:resource="#staffMember"/>

</owl:Restriction>

</rdfs:subClassOf>

</owl:Class>

Ontology Languages

Noman Islam�NU-FAST, Karachi

<owl:Class rdf:ID="peopleAtUni">

<owl:unionOf rdf:parseType="Collection">

<owl:Class rdf:about="#staffMember"/>

<owl:Class rdf:about="#student"/>

</owl:unionOf>

</owl:Class>

Bringing the Web to its full potential

11

12 of 28

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
  • “RDF Vocabulary Description Language 1.0: RDF Schema”, W3C Recommendation 10 February 2004

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

12

13 of 28

PART II

OWL, OWL-S, WSMO

28th May, 2008

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

13

14 of 28

OWL Current Status

  • OWL 1.1
  • OWL 2.0 Working Draft:
    • http://www.w3.org/TR/2008/WD-owl2-syntax-20080411/
  • OWL Mailing List
  • OWL API

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

14

15 of 28

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"/>

</owl:Class>

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

15

16 of 28

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>

</rdf:RDF>

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

16

17 of 28

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:
    • Service
    • Profile
    • Process
    • Grounding

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

17

18 of 28

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 rdf:resource=BravoAirGrounding.owl#Grounding_BravoAir_ReservationAgent"/>

</service:Service>

Ontology Languages

Noman Islam�NU-FAST, Karachi

Service Ontology [4]

Bringing the Web to its full potential

18

19 of 28

OWL-S Profile

  • human-readable information like serviceName, textDescription and contactInformation
  • Functional description:
    • IOPE
      • Inputs and Outputs
      • Preconditions and effects
  • Other features include categories, quality of service parameters and an unbounded list of other parameters

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

19

20 of 28

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.
  • Participants

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

20

21 of 28

<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>

An Example of Conditional Output and Effects

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

21

22 of 28

OWL-S Groundings

  • A predefined grounding, mapping to WSDL
    • OWL-S atomic process is mapped to WSDL operation
  • Why OWL-S?

Ontology Languages

Noman Islam�NU-FAST, Karachi

[2] Comparison of WDL and OWL-S for semantic web

Bringing the Web to its full potential

22

23 of 28

WSDL Grounding

<grounding:WsdlAtomicProcessGrounding rdf:ID="WsdlGrounding_GetDesiredFlightDetails">

<grounding:owlsProcess rdf:resource="BravoAirProcess.owl#GetDesiredFlightDetails"/>

<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>

...

Ontology Languages

Noman Islam�NU-FAST, Karachi

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" />

...

</message>

Bringing the Web to its full potential

23

24 of 28

WSMO

  • WSMO Elements:
    • Ontologies
    • Goals
    • WebServices
      • Capabilities
      • Interfaces (choreography, orchestration)
    • Mediators

Ontology Languages

Noman Islam�NU-FAST, Karachi

WSMO Core Elements [3]

Bringing the Web to its full potential

24

25 of 28

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

choreography ***

orchestration ***

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

25

26 of 28

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.
    • Classification

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

26

27 of 28

Ontology Languages and related standards [1]

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

27

28 of 28

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
  5. “Web Ontology Language: OWL”, Grigoris Antoniou and Frank van Harmelen

Ontology Languages

Noman Islam�NU-FAST, Karachi

Bringing the Web to its full potential

28