Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Owl syntax
1. OWL: abstract syntax
For details see http://www.w3.org/TR/owl-semantics/syntax.html#2.3.2.1
Ontology Languages 1
2. Classes: primitive vs. defined
descriptions definitions
Class(name partial ...) Class(name complete ...)
‘all name ...’ ‘a name is anything that ...’
primitive concepts defined 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
3. Classes: disjointness
PizzaTopping
“What does such a hierarchy actually mean?” – Vegetable
– Tomato
– Pepper
In OWL, classes are overlapping until – Mushroom
disjointness axiom is entered: – Meat
– SpicyBeef
– Pepperoni
DisjointClasses(class1 ... classn )
– Seafood
– Tuna
– Prawn
Example: – Anchovy
– Cheese
DisjointClasses( – Mozzarella
Vegetable Meat Seafood Cheese)
– Parmesan
Ontology Languages 3
4. 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 first class lounge is any lounge where
the occupants are
‘A dog owner is any person who only first class passengers’
has as a pet some dog’ ‘A first class lounge is any lounge where
there are no occupants except
first class passengers’
Ontology Languages 4
5. Property restrictions (cont.)
existential universal
. .
.
∃ . ∀
Example:
Class(DogOwner partial Class(FirstClassLounge partial
Person Lounge
restriction(hasPet restriction(hasOccupants
someValuesFrom(Dog))) allValuesFrom(FirstCPassenger)))
‘All first class lounges have
‘Dog owners are people
only occupants who are
and have as a pet some dog’
first class passengers’
‘All first class lounges
have no occupants except
first class passengers’
‘All first class lounges
have no occupants who are
not first class passengers’
Ontology Languages 5
6. 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
7. 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
8. 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
9. 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
10. 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 definition of ice-cream cone is inconsistent
otherwise ice-cream cone will be classified as a kind of pizza
Ontology Languages 10
12. 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 quantification)
Ontology Languages 12
13. 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
14. 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