Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
02/23/2010 CPSC 449
Computer Science
Unless otherwise noted, all artwork and illustrations by either Rob Kremer or Jörg Denzinger (course instructors)
Special Purpose Languages
OWL2: A language for defining ontologies
351
2015/01/05 CPSC 449
What is an ontology?
• A set of concepts and their relationships (Types and Relations)
• Describes a domain
• Can be used to reason about the domain
• Usually contains an isa hierarchy (or lattice)
352
2015/01/05 CPSC 449
OWL
353
• OWL is the Web Ontology Language
• It’s part of the Semantic Web framework
• It’s a standard
2015/01/05 CPSC 449
The 3 flavours of OWL2
354
Lite partially restricted to aid learning curve
liteDL = Description LogicDescription Logics are a fragment of First Order Logic (FOL) that can be reasoned with
DL Full unrestricted use of OWL constructs, but cannot reasonFull
2015/01/05 CPSC 449
OWL2 Structure: many syntaxes
355
OWL 2 Web Ontology Language Document Overview (Second Edition). W3C Recommendation 11, December 2012, p.3
2015/01/05 CPSC 449
Editing an OWL2 Ontology
• Multiple methods: - Use Protege
• Download from http://protege.stanford.edu
- Use a text editor (and choose a syntax)
356
2015/01/05 CPSC 449
Types ⇒ Classes & Individuals
357
2015/01/05 CPSC 449
Types ⇒ Classes & Individuals
358
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)Prefix(events:=<http://casa.cpsc.ucalgary.ca/ontologies/events.owl#>)Prefix(actions:=<http://casa.cpsc.ucalgary.ca/ontologies/actions.owl#>)
Ontology(<http://casa.cpsc.ucalgary.ca/ontologies/actions.owl>Import(<http://casa.cpsc.ucalgary.ca/ontologies/events.owl>)
Declaration(Class(actions:LAC_closing))SubClassOf(actions:LAC_closing actions:action)Declaration(Class(actions:accept-proposal))SubClassOf(actions:accept-proposal actions:agree)Declaration(Class(actions:ack))SubClassOf(actions:ack actions:performative)Declaration(Class(actions:act))SubClassOf(actions:act actions:action)Declaration(Class(actions:action))SubClassOf(actions:action events:event)Declaration(Class(actions:add_observer))SubClassOf(actions:add_observer actions:register)…
(OWL Functional Syntax)
2015/01/05 CPSC 449
Types ⇒ Classes & Individuals
359
2015/01/05 CPSC 449
Relations/Attributes ⇒ Object Properties
360
2015/01/05 CPSC 449
Relations/Attributes ⇒ Object Properties
361
Declaration(ObjectProperty(actions:FIPA-follows))InverseObjectProperties(actions:FIPA-follows actions:FIPA-preceeds)AsymmetricObjectProperty(actions:FIPA-follows)Declaration(ObjectProperty(actions:FIPA-preceeds))InverseObjectProperties(actions:FIPA-follows actions:FIPA-preceeds)AsymmetricObjectProperty(actions:FIPA-preceeds)
(OWL Functional Syntax)
2015/01/05 CPSC 449
Example: Animal Ontology
• We want to represent a hierarchy of animals, starting with Thing -> Animate -> Animal -> Mammal, etc.
• Some individuals like Rex (a dog) and Felix (a cat). • Animals have a gender (male/female) property
- but Animates, in general do not. • While we have a lattice, we want to restrict anything
from being both a K9 and a Feline and from being both male and female.
362
2015/01/05 CPSC 449
Example: Animal Ontology (Protege OntoGraf)
363
object property:gender gender
has-subclass
has-individual
2015/01/05 CPSC 449
… and in Manchester syntax
364
Prefix: dc: <http://purl.org/dc/elements/1.1/>Prefix: owl: <http://www.w3.org/2002/07/owl#>Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>Prefix: xml: <http://www.w3.org/XML/1998/namespace>Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>Prefix: animals: <http://www.semanticweb.org/kremer/ontologies/2015/0/animals-demo1#>
Ontology: <http://www.semanticweb.org/kremer/ontologies/2015/0/animals-demo1>
ObjectProperty: animals:gender Domain: animals:Mammal Range: animals:GenderClass: animals:Lion SubClassOf: animals:FelineClass: animals:Siamese SubClassOf: animals:DomesticCatClass: animals:AnimateClass: animals:Mammal SubClassOf: animals:AnimateClass: animals:Feline SubClassOf: animals:Mammal DisjointWith: animals:K9Class: animals:Tiger SubClassOf: animals:Feline
Class: animals:K9 SubClassOf: animals:Mammal DisjointWith: animals:FelineClass: animals:GenderClass: animals:Wolf SubClassOf: animals:K9Class: animals:Pug SubClassOf: animals:DogClass: animals:Tabby SubClassOf: animals:DomesticCatClass: animals:Coyote SubClassOf: animals:K9Class: animals:DomesticCat SubClassOf: animals:FelineClass: animals:GermainShepard SubClassOf: animals:Dog
Class: animals:Dog SubClassOf: animals:K9Individual: animals:Rex Types: animals:GermainShepard Facts: animals:gender animals:maleIndividual: animals:male Types: animals:Gender DifferentFrom: animals:femaleIndividual: animals:Garfield Types: animals:Tabby Facts: animals:gender animals:maleIndividual: animals:female Types: animals:Gender DifferentFrom: animals:male
2015/01/05 CPSC 449
…and in OWL Functional syntax
365
Prefix(dc:=<http://purl.org/dc/elements/1.1/>)Prefix(owl:=<http://www.w3.org/2002/07/owl#>)Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)Prefix(animals:=<http://www.semanticweb.org/kremer/ontologies/ 2015/0/animals-demo1#>)
Ontology(<http://www.semanticweb.org/kremer/ontologies/ 2015/0/animals-demo1>Declaration(Class(animals:Animate))Declaration(Class(animals:Coyote))Declaration(Class(animals:Dog))Declaration(Class(animals:DomesticCat))Declaration(Class(animals:Feline))Declaration(Class(animals:GermainShepard))Declaration(Class(animals:K9))Declaration(Class(animals:Lion))Declaration(Class(animals:Mammal))Declaration(Class(animals:Pug))Declaration(Class(animals:Gender))Declaration(Class(animals:Siamese))Declaration(Class(animals:Tabby))Declaration(Class(animals:Tiger))Declaration(Class(animals:Wolf))Declaration(ObjectProperty(animals:gender))Declaration(NamedIndividual(animals:Garfield))Declaration(NamedIndividual(animals:Rex))
Declaration(NamedIndividual(animals:female))Declaration(NamedIndividual(animals:male))SubClassOf(animals:Coyote animals:K9)SubClassOf(animals:Dog animals:K9)SubClassOf(animals:DomesticCat animals:Feline)SubClassOf(animals:Feline animals:Mammal)DisjointClasses(animals:Feline animals:K9)SubClassOf(animals:GermainShepard animals:Dog)SubClassOf(animals:K9 animals:Mammal)SubClassOf(animals:Lion animals:Feline)SubClassOf(animals:Mammal animals:Animate)SubClassOf(animals:Pug animals:Dog)SubClassOf(animals:Siamese animals:DomesticCat)SubClassOf(animals:Tabby animals:DomesticCat)SubClassOf(animals:Tiger animals:Feline)SubClassOf(animals:Wolf animals:K9)ObjectPropertyDomain(animals:gender animals:Mammal)ObjectPropertyRange(animals:gender animals:Gender)ClassAssertion(animals:Tabby animals:Garfield)ObjectPropertyAssertion(animals:gender animals:Garfield animals:male)ClassAssertion(animals:GermainShepard animals:Rex)ObjectPropertyAssertion(animals:gender animals:Rex animals:male)ClassAssertion(animals:Gender animals:female)ClassAssertion(animals:Gender animals:male)DifferentIndividuals(animals:male animals:female))
2015/01/05 CPSC 449
Classes
366
Class: animals:GermainShepard SubClassOf: animals:Dog
(Manchester syntax)
Declaration(Class(animals:GermainShepard))SubClassOf(animals:GermainShepard animals:Dog)
(OWL functional syntax)
(Protege OntoGraf)
(Protege)
2015/01/05 CPSC 449
Disjoint Classes
367
Class: animals:K9 SubClassOf: animals:Mammal DisjointWith: animals:Feline
(Manchester syntax)
DisjointClasses(animals:Feline animals:K9)(OWL functional syntax)
(Protege OntoGraf)
(Protege)
2015/01/05 CPSC 449
Individuals
368
Individual: animals:Rex Types: animals:GermainShepard
(Manchester syntax)
Declaration(NamedIndividual(animals:Rex))ClassAssertion(animals:GermainShepard animals:Rex)
(OWL functional syntax)
(Protege OntoGraf)
(Protege)
2015/01/05 CPSC 449
Distinct Individuals
369
Individual: animals:female Types: animals:Gender DifferentFrom: animals:male
(Manchester syntax)
Declaration(NamedIndividual(animals:female))Declaration(NamedIndividual(animals:male))ClassAssertion(animals:Gender animals:female)ClassAssertion(animals:Gender animals:male)DifferentIndividuals(animals:male animals:female)
(OWL functional syntax)
(Protege OntoGraf)
(Protege)
2015/01/05 CPSC 449
Object Properties (attributes)
370
ObjectProperty: animals:gender Domain: animals:Mammal Range: animals:Gender
(Manchester syntax)
Declaration(ObjectProperty(animals:gender))ObjectPropertyDomain(animals:gender animals:Mammal)ObjectPropertyRange(animals:gender animals:Gender)
(OWL functional syntax)
(Protege OntoGraf)
(Protege)
2015/01/05 CPSC 449
Object Property Instances
371
Individual: animals:Rex Types: animals:GermainShepard Facts: animals:gender animals:male
(Manchester syntax)
ObjectPropertyAssertion(animals:gender animals:Rex animals:male)
(OWL functional syntax)
(Protege OntoGraf)
(Protege)