OWL: abstract syntaxFor details see http://www.w3.org/TR/owl-semantics/syntax.html#18.104.22.168Ontology Languages 1
Classes: primitive vs. deﬁned descriptions deﬁnitions Class(name partial ...) Class(name complete ...) ‘all name ...’ ‘a name is anything that ...’ primitive concepts deﬁned concepts ≡Example: Class(MargheritaPizza partial Class(CheesyPizza complete Pizza Pizza restriction(hasTopping restriction(hasTopping someValuesFrom(Mozzarella)) someValuesFrom(Cheese))) restriction(hasTopping someValuesFrom(Tomato))) ‘All Margherita pizzas have, amongst ‘A cheesy pizza is any pizza that has, other things, some mozzarella topping amongst other things, and also some tomato topping’ some cheese topping’Ontology Languages 2
Classes: disjointness PizzaTopping“What does such a hierarchy actually mean?” – Vegetable – Tomato – PepperIn OWL, classes are overlapping until – Mushroom disjointness axiom is entered: – Meat – SpicyBeef – Pepperoni DisjointClasses(class1 ... classn ) – Seafood – Tuna – PrawnExample: – Anchovy – Cheese DisjointClasses( – Mozzarella Vegetable Meat Seafood Cheese) – ParmesanOntology Languages 3
Property restrictions existential universal restriction(prop restriction(prop someValuesFrom(class)) allValuesFrom(class)) ‘some’, ‘at least one’ ‘only’, ‘no value except’ . . . ∃ . ∀Example: Class(FirstClassLounge complete Lounge Class(DogOwner complete restriction(hasOccupants Person allValuesFrom(FirstCPassenger))) restriction(hasPet someValuesFrom(Dog))) ‘A ﬁrst class lounge is any lounge where the occupants are ‘A dog owner is any person who only ﬁrst class passengers’ has as a pet some dog’ ‘A ﬁrst class lounge is any lounge where there are no occupants except ﬁrst class passengers’Ontology Languages 4
Property restrictions (cont.) existential universal . . . ∃ . ∀Example: Class(DogOwner partial Class(FirstClassLounge partial Person Lounge restriction(hasPet restriction(hasOccupants someValuesFrom(Dog))) allValuesFrom(FirstCPassenger))) ‘All ﬁrst class lounges have ‘Dog owners are people only occupants who are and have as a pet some dog’ ﬁrst class passengers’ ‘All ﬁrst class lounges have no occupants except ﬁrst class passengers’ ‘All ﬁrst class lounges have no occupants who are not ﬁrst class passengers’Ontology Languages 5
Boolean combinations union (disjunction) intersection (conjunction) unionOf(class1 . . . classn ) intersectionOf(class1 . . . classn ) ‘class1 and/or class2 ’ ‘both class1 and also class2 ’ . .Example: . . Class(VegetarianPizza complete Class(ProteinLoversPizza complete Pizza Pizza restriction(hasTopping restriction(hasTopping allValuesFrom( allValuesFrom( unionOf(Vegetable Cheese)))) intersectionOf(Meat Seafood)))) ‘A vegetarian pizza is any pizza which, ‘A protein lover’s pizza is any pizza that, amongst other things, has amongst other things, has only toppings only vegetable and/or cheese toppings’ that are both meat and also seafood’ NO topping is both meat and also seafood !Ontology Languages (therefore, the intersection is empty) 6
Boolean combinations (cont.) . complementOf(class) . ¬• complementOf(intersectionOf(class1 class2 )) — ‘not all of’ / ‘not both class1 and also class2 ’• complementOf(unionOf(class1 class2 )) — ‘neither class1 nor class2 ’• restriction(prop someValuesFrom(complementOf(class))) — ‘has some prop that are not class’• complementOf(restriction(prop someValuesFrom(class)))) — ‘does not have any prop that are class’• restriction(prop allValuesFrom(complementOf(class))) — ‘has prop no class’ / ‘has only prop that are not class’• complementOf(restriction(prop allValuesFrom(class)))) — ‘does not have only prop that are class’Ontology Languages 7
Cardinality constraints restriction(prop restriction(prop minCardinality(n)) maxCardinality(n)) ‘at least n (distinct) prop’ ‘at most n (distinct) prop’ . . . .Example: Class(InterestingPizza complete Class(Pizza partial Pizza restriction(hasBase restriction(hasTopping maxCardinality(1))) minCardinality(3))) ‘Any pizza, amongst other things, ‘An interesting pizza is any pizza that, has at most 1 pizza base’ amongst other things, has at least 3 (distinct) toppings’Ontology Languages 8
Object properties ObjectProperty(name ... domain(classD) range(classR))Domain and range constraints are actually axioms: range domain Class(owl:Thing partial SubClassOf(restriction(name restriction(name someValuesFrom(owl:Thing)) allValuesFrom(classR))) classD) ‘All things have no name except classR’ ‘Having a name implies being classD’Ontology Languages 9
Object properties: domain constraints ObjectProperty(hasTopping ‘Having a topping implies being pizza’ domain(Pizza))Consider now ice-cream cones: Class(IceCreamCone partial ‘All ice-cream cones, restriction(hasTopping amongst other things, someValuesFrom(IceCream))) have some ice-cream topping’NB: if ice-cream cone is disjoint from pizza then the deﬁnition of ice-cream cone is inconsistent otherwise ice-cream cone will be classiﬁed as a kind of pizzaOntology Languages 10
Bus Drivers are Drivers Class(Driver complete ‘A driver is any person that Person drives a vehicle’ restriction(drives someValuesFrom(Vehicle))) Class(Bus partial Vehicle) ‘All buses are vehicles’ Class(BusDriver complete ‘A bus driver is any person that Person drives a bus’ restriction(drives someValuesFrom(Bus)))So, a bus driver must be a driver: BusDriver Driver (the subclass is inferred due to subclasses being used in existential quantiﬁcation)Ontology Languages 12
Drivers are Grown-ups Class(Driver complete ‘A driver is any person that Person drives a vehicle’ restriction(drives someValuesFrom(Vehicle))) Class(Driver partial Adult) ‘Drivers are adults’ Class(GrownUp complete ‘A grown up is any person that is an adult’ Person Adult)So, all drivers must be adult persons (grown-ups): Driver GrownUp(an example of axioms being used to assert additional necessary information about a class;we do not need to know that a driver is an adult in order to recognise one, but once we have recognised a driver, we know that they must be adult)Ontology Languages 13
Cat Owners like Cats Class(CatOwner complete ‘A cat owner is any person that Person has a cat as a pet’ restriction(hasPet someValuesFrom(Cat))) SubPropertyOf(hasPet likes) ‘Anything that has a pet must like that pet’ Class(CatLover complete ‘A cat-lover is any person that Person likes a cat’ restriction(likes someValuesFrom(Cat)))So, a cat owner must like a cat: CatOwner CatLover (the subclass is inferred due to a subproperty assertion)Ontology Languages 14
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.