Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
by Michał Antkiewicz, http://gsd.uwaterloo.ca/mantkiew
<empty model>
abstract Person
Head
Arm 2..2
abstract Person
Head
Arm 2..2
Michal extends Person
abstract Person
Head
Arm 2..2
owns -> Car *
abstract Car
Civic extends Car
Michal extends Person
[Civic in owns ]
abstract Person
name -> String
Michal extends Person
[ name = "Michal" ]
Typical applications of modeling
OWL: classification
"Given an OWL metamodel and a set of individuals,
assign the individuals to appropriate classes."
Clafer: ???
Metamodeling, specialization, configuration, classification, ...
However, both languages can be used for a variety of applications
This presentation is an effort to understand
This presentation is NOT:
Individuals can belong to multiple classes.
No distinction between individuals and classes. Everything is a clafer, some are fully constrained (singletons). Clafers can inherit from at most one clafer.
Pizza
xor PizzaBase
DeepPanBase ; ThinAndCrispyBase
PizzaTopping +
Declaration(Class(:Food))
Declaration(Class(:Pizza))
Declaration(Class(:PizzaBase))
Declaration(Class(:PizzaTopping))
SubClassOf(:Pizza :Food)
SubClassOf(:Pizza ObjectSomeValuesFrom(:hasBase :PizzaBase))
DisjointClasses(:Pizza :PizzaBase)
DisjointClasses(:Pizza :PizzaTopping)
SubClassOf(:PizzaBase :Food)
DisjointClasses(:PizzaBase :Pizza)
DisjointClasses(:PizzaBase :PizzaTopping)
SubClassOf(:PizzaTopping :Food)
DisjointClasses(:PizzaTopping :Pizza)
DisjointClasses(:PizzaTopping :PizzaBase)
Translation Notes:
Declaration(ObjectProperty(:hasBase))
InverseObjectProperties(:hasBase :isBaseOf)
FunctionalObjectProperty(:hasBase)
InverseFunctionalObjectProperty(:hasBase)
ObjectPropertyDomain(:hasBase :Pizza)
ObjectPropertyRange(:hasBase :PizzaBase)
Declaration(ObjectProperty(:hasTopping))
InverseObjectProperties(:hasTopping :isToppingOf)
InverseFunctionalObjectProperty(:hasTopping)
ObjectPropertyDomain(:hasTopping :Pizza)
ObjectPropertyRange(:hasTopping :PizzaTopping)
Declaration(ObjectProperty(:isBaseOf))
InverseObjectProperties(:hasBase :isBaseOf)
FunctionalObjectProperty(:isBaseOf)
InverseFunctionalObjectProperty(:isBaseOf)
ObjectPropertyDomain(:isBaseOf :PizzaBase)
ObjectPropertyRange(:isBaseOf :Pizza)
Declaration(ObjectProperty(:isToppingOf))
InverseObjectProperties(:hasTopping :isToppingOf)
FunctionalObjectProperty(:isToppingOf)
ObjectPropertyDomain(:isToppingOf :PizzaTopping)
ObjectPropertyRange(:isToppingOf :Pizza)
translation to Clafer
- 7 Kb
- 4 pages, 8pt in Word
- 630 words
- 256 lines
OWL functional syntax conversion
- predicates, 1 per line
- 73 Kb
- 20 pages, 8pt in Word
- 3694 words
- 1382 lines
Original file: pizza.owl
- XML
- 233 Kb
- 87 pages, 8pt in Word
- 10048 words
- 6750 lines
abstract Pizza
xor PizzaBase
DeepPanBase ; ThinAndCrispyBase
xor PizzaTopping +
MozzarellaTopping
TomatoTopping
MyThinMozzarellaPizza extends Pizza
[ ThinAndCrispyBase
MozzarellaTopping ]
abstract xor PizzaBase
DeepPanBase ; ThinAndCrispyBase
isBaseOf -> Pizza
[ isBaseOf.hasBase = this ]
abstract PizzaTopping
isToppingOf -> Pizza
[ isToppingOf.hasTopping = this ]
abstract Pizza
hasBase -> PizzaBase
hasTopping -> PizzaTopping +
MyPizzaBase extends PizzaBase
[ ThinAndCrispyBase ]
MyMozzarellaTopping extends PizzaTopping
[ MozzarellaTopping ]
MyThinMozzarellaPizza extends Pizza
[ hasBase = MyPizzaBase
MyMozzarellaTopping in hasTopping ]
Clafer syntax is extremely concise and provides good insight into the structure of the model.
Both OWL and functional syntaxes are human unusable: one has to use a tool.
Declaration(Class(:Country))
EquivalentClasses(:Country ObjectIntersectionOf(ObjectOneOf(:France :Italy :England :Germany :America) :DomainConcept))
Declaration(Class(:Spiciness))
EquivalentClasses(:Spiciness ObjectUnionOf(:Hot :Medium :Mild))
SubClassOf(:Spiciness :ValuePartition)
Declaration(NamedIndividual(:America))
ClassAssertion(:Country :America)
ClassAssertion(owl:Thing :America)
Declaration(NamedIndividual(:England))
ClassAssertion(:Country :England)
ClassAssertion(owl:Thing :England)
Declaration(NamedIndividual(:France))
ClassAssertion(:Country :France)
ClassAssertion(owl:Thing :France)
Declaration(NamedIndividual(:Germany))
ClassAssertion(:Country :Germany)
ClassAssertion(owl:Thing :Germany)
Declaration(NamedIndividual(:Italy))
ClassAssertion(:Country :Italy)
ClassAssertion(owl:Thing :Italy)
Declaration(Class(:Hot))
SubClassOf(:Hot :Spiciness)
DisjointClasses(:Hot :Medium)
DisjointClasses(:Hot :Mild)
Declaration(Class(:Mild))
SubClassOf(:Mild :Spiciness)
DisjointClasses(:Mild :Hot)
DisjointClasses(:Mild :Medium)
Declaration(Class(:Medium))
SubClassOf(:Medium :Spiciness)
DisjointClasses(:Medium :Hot)
DisjointClasses(:Medium :Mild)
enum Country = America | England | France | Germany | Italy
enum Spiciness = Hot | Medium | Mild
<enum is a syntactic sugar for>
abstract Spiciness
Hot extends Spiciness
Medium extends Spiciness
Mild extends Spiciness
Declaration(Class(:Pizza))
SubClassOf(:Pizza :Food)
SubClassOf(:Pizza ObjectSomeValuesFrom(:hasBase :PizzaBase))
DisjointClasses(:Pizza :PizzaBase)
DisjointClasses(:Pizza :PizzaTopping)
Declaration(Class(:PizzaBase))
SubClassOf(:PizzaBase :Food)
DisjointClasses(:PizzaBase :Pizza)
DisjointClasses(:PizzaBase :PizzaTopping)
Declaration(Class(:PizzaTopping))
SubClassOf(:PizzaTopping :Food)
DisjointClasses(:PizzaTopping :Pizza)
DisjointClasses(:PizzaTopping :PizzaBase)
Declaration(Class(:ThinAndCrispyBase))
SubClassOf(:ThinAndCrispyBase :PizzaBase)
DisjointClasses(:ThinAndCrispyBase :DeepPanBase)
Declaration(Class(:DeepPanBase))
SubClassOf(:DeepPanBase :PizzaBase)
DisjointClasses(:DeepPanBase :ThinAndCrispyBase)
Declaration(ObjectProperty(:hasBase))
InverseObjectProperties(:hasBase :isBaseOf)
FunctionalObjectProperty(:hasBase)
InverseFunctionalObjectProperty(:hasBase)
ObjectPropertyDomain(:hasBase :Pizza)
ObjectPropertyRange(:hasBase :PizzaBase)
Declaration(ObjectProperty(:hasTopping))
InverseObjectProperties(:hasTopping :isToppingOf)
InverseFunctionalObjectProperty(:hasTopping)
ObjectPropertyDomain(:hasTopping :Pizza)
ObjectPropertyRange(:hasTopping :PizzaTopping)
Declaration(ObjectProperty(:isBaseOf))
InverseObjectProperties(:hasBase :isBaseOf)
FunctionalObjectProperty(:isBaseOf)
InverseFunctionalObjectProperty(:isBaseOf)
ObjectPropertyDomain(:isBaseOf :PizzaBase)
ObjectPropertyRange(:isBaseOf :Pizza)
Declaration(ObjectProperty(:isToppingOf))
InverseObjectProperties(:hasTopping :isToppingOf)
FunctionalObjectProperty(:isToppingOf)
ObjectPropertyDomain(:isToppingOf :PizzaTopping)
ObjectPropertyRange(:isToppingOf :Pizza)
abstract Pizza
xor PizzaBase
DeepPanBase
ThinAndCrispyBase
PizzaTopping +
spiciness -> Spiciness ?
country -> Country ?
xor KindOfTopping
PizzaTopping +
spiciness -> Spiciness ?
country -> Country ?
xor KindOfTopping
xor CheeseTopping
xor FishTopping
FruitTopping
xor HerbSpiceTopping
xor MeatTopping
NutTopping
SauceTopping
xor VegetableTopping
Declaration(Class(:CheeseTopping))
SubClassOf(:CheeseTopping :PizzaTopping)
DisjointClasses(:CheeseTopping :FishTopping)
DisjointClasses(:CheeseTopping :FruitTopping)
DisjointClasses(:CheeseTopping :HerbSpiceTopping)
DisjointClasses(:CheeseTopping :MeatTopping)
DisjointClasses(:CheeseTopping :NutTopping)
DisjointClasses(:CheeseTopping :SauceTopping)
DisjointClasses(:CheeseTopping :VegetableTopping)
Declaration(Class(:FishTopping))
SubClassOf(:FishTopping :PizzaTopping)
SubClassOf(:FishTopping ObjectSomeValuesFrom(:hasSpiciness :Mild))
DisjointClasses(:FishTopping :CheeseTopping)
DisjointClasses(:FishTopping :FruitTopping)
DisjointClasses(:FishTopping :HerbSpiceTopping)
DisjointClasses(:FishTopping :MeatTopping)
DisjointClasses(:FishTopping :NutTopping)
DisjointClasses(:FishTopping :SauceTopping)
DisjointClasses(:FishTopping :VegetableTopping)
<pattern repeats for each of other kinds of toppings>
....
abstract Pizza
PizzaTopping +
spiciness -> Spiciness ?
country -> Country ?
xor KindOfTopping
xor CheeseTopping
[spiciness = Mild]
FourCheesesTopping
GoatsCheeseTopping
GorgonzolaTopping
MozzarellaTopping
[country = Italy]
ParmesanTopping
SubClassOf(:Food :DomainConcept)
Declaration(Class(:FourCheesesTopping))
SubClassOf(:FourCheesesTopping :CheeseTopping)
SubClassOf(:FourCheesesTopping ObjectSomeValuesFrom(:hasSpiciness :Mild))
DisjointClasses(:FourCheesesTopping :GoatsCheeseTopping)
DisjointClasses(:FourCheesesTopping :GorgonzolaTopping)
DisjointClasses(:FourCheesesTopping :MozzarellaTopping)
DisjointClasses(:FourCheesesTopping :ParmesanTopping)
Declaration(Class(:MozzarellaTopping))
SubClassOf(:MozzarellaTopping :CheeseTopping)
SubClassOf(:MozzarellaTopping ObjectSomeValuesFrom(:hasSpiciness :Mild))
SubClassOf(:MozzarellaTopping ObjectHasValue(:hasCountryOfOrigin :Italy))
DisjointClasses(:MozzarellaTopping :FourCheesesTopping)
DisjointClasses(:MozzarellaTopping :GoatsCheeseTopping)
DisjointClasses(:MozzarellaTopping :GorgonzolaTopping)
DisjointClasses(:MozzarellaTopping :ParmesanTopping)
<pattern repeats for each of other subclass of CheeseTopping>
....
Declaration(Class(:SpicyTopping))
EquivalentClasses(:SpicyTopping ObjectIntersectionOf(ObjectSomeValuesFrom(:hasSpiciness :Hot) :PizzaTopping))
Declaration(Class(:VegetarianTopping))
EquivalentClasses(:VegetarianTopping ObjectIntersectionOf(ObjectUnionOf(:CheeseTopping :FruitTopping
:HerbSpiceTopping :NutTopping :SauceTopping :VegetableTopping) :PizzaTopping))
abstract Pizza
PizzaTopping +
spiciness -> Spiciness ?
country -> Country ?
...
SpicyTopping ?
[spiciness = Hot <=> SpicyTopping]
VegetarianTopping ?
[CheeseTopping || FruitTopping || HerbSpiceTopping || NutTopping || SauceTopping || VegetableTopping <=> VegetarianTopping]
Declaration(Class(:CheeseyPizza))
EquivalentClasses(:CheeseyPizza ObjectIntersectionOf(ObjectSomeValuesFrom(:hasTopping :CheeseTopping) :Pizza))
Declaration(Class(:InterestingPizza))
EquivalentClasses(:InterestingPizza ObjectIntersectionOf(ObjectMinCardinality(3 :hasTopping) :Pizza))
Declaration(Class(:NonVegetarianPizza))
EquivalentClasses(:NonVegetarianPizza
ObjectIntersectionOf(ObjectComplementOf(:VegetarianPizza) :Pizza))
Declaration(Class(:RealItalianPizza))
EquivalentClasses(:RealItalianPizza
ObjectIntersectionOf(ObjectHasValue(:hasCountryOfOrigin :Italy) :Pizza))
Declaration(Class(:SpicyPizza))
EquivalentClasses(:SpicyPizza
ObjectIntersectionOf(ObjectSomeValuesFrom(:hasTopping :SpicyTopping) :Pizza))
abstract Pizza
CheeseyPizza ?
[ CheeseTopping <=> CheeseyPiza]
InterestingPizza ?
[ # PizzaTopping >= 3 <=> InterestingPizza ]
NonVegetarianPizza ?
[ ~ VegetarianPizza <=> NonVegetarianPizza]
RealItalianPizza ?
[ country == Italy && ThinAndCrispyBase <=> RealItalianPizza]
SpicyPizza ?
[ SpicyTopping <=> SpicyPizza]
Declaration(Class(:ThinAndCrispyPizza))
EquivalentClasses(:ThinAndCrispyPizza
ObjectIntersectionOf(ObjectAllValuesFrom(:hasBase :ThinAndCrispyBase) :Pizza))
Declaration(Class(:VegetarianPizza))
EquivalentClasses(:VegetarianPizza
ObjectIntersectionOf(:Pizza ObjectComplementOf(ObjectSomeValuesFrom(:hasTopping :FishTopping)) ObjectComplementOf(ObjectSomeValuesFrom(:hasTopping :MeatTopping))))
DisjointClasses(:VegetarianPizza :NonVegetarianPizza)
Declaration(Class(:VegetarianPizzaEquivalent1))
EquivalentClasses(:VegetarianPizzaEquivalent1
ObjectIntersectionOf(ObjectAllValuesFrom(:hasTopping :VegetarianTopping) :Pizza))
abstract Pizza
...
ThinAndCrispyPizza ?
[ ThinAndCrispyBase <=> ThinAndCrispyPizza]
VegetarianPizza ?
[ ~ FishTopping && ~ MeatTopping <=> VegetarianPizza ]
VegetarianPizzaEquivalent1 ?
[ all p : PizzaToping | p.VegetarianTopping <=>
VegetarianPizzaEquivalent1 ]
DisjointClasses(:Veneziana :Giardiniera)
DisjointClasses(:Veneziana :LaReine)
DisjointClasses(:Veneziana :Margherita)
DisjointClasses(:Veneziana :Mushroom)
DisjointClasses(:Veneziana :Napoletana)
DisjointClasses(:Veneziana :Parmense)
DisjointClasses(:Veneziana :PolloAdAstra)
DisjointClasses(:Veneziana :PrinceCarlo)
DisjointClasses(:Veneziana :QuattroFormaggi)
DisjointClasses(:Veneziana :Rosa)
DisjointClasses(:Veneziana :Siciliana)
DisjointClasses(:Veneziana :SloppyGiuseppe)
DisjointClasses(:Veneziana :Soho)
DisjointClasses(:Veneziana :UnclosedPizza)
Declaration(Class(:Veneziana))
AnnotationAssertion(rdfs:label :Veneziana "Veneziana"@pt)
SubClassOf(:Veneziana :NamedPizza)
SubClassOf(:Veneziana ObjectSomeValuesFrom(:hasTopping :CaperTopping))
SubClassOf(:Veneziana ObjectSomeValuesFrom(:hasTopping :MozzarellaTopping))
SubClassOf(:Veneziana ObjectSomeValuesFrom(:hasTopping :OliveTopping))
SubClassOf(:Veneziana ObjectSomeValuesFrom(:hasTopping :OnionTopping))
SubClassOf(:Veneziana ObjectSomeValuesFrom(:hasTopping :PineKernels))
SubClassOf(:Veneziana ObjectSomeValuesFrom(:hasTopping :SultanaTopping))
SubClassOf(:Veneziana ObjectSomeValuesFrom(:hasTopping :TomatoTopping))
SubClassOf(:Veneziana
ObjectAllValuesFrom(:hasTopping ObjectUnionOf(:CaperTopping :MozzarellaTopping :OliveTopping :OnionTopping :PineKernels :SultanaTopping :TomatoTopping)))
SubClassOf(:Veneziana ObjectHasValue(:hasCountryOfOrigin :Italy))
DisjointClasses(:Veneziana :American)
DisjointClasses(:Veneziana :AmericanHot)
DisjointClasses(:Veneziana :Cajun)
DisjointClasses(:Veneziana :Capricciosa)
DisjointClasses(:Veneziana :Caprina)
DisjointClasses(:Veneziana :Fiorentina)
DisjointClasses(:Veneziana :FourSeasons)
DisjointClasses(:Veneziana :FruttiDiMare)
DisjointClasses(:Veneziana :Giardiniera)
abstract Veneziana extends Pizza
[ country = Italy
CaperTopping
MozzarellaTopping
OliveTopping
OnionTopping
PineKernels
SultanaTopping
TomatoTopping ]
MyVeneziana extends Veneziana
[ ThinAndCrispyBase
GarlicTopping ]
Declaration(NamedIndividual(:MyVeneziana))
ClassAssertion(:Veneziana :MyVeneziana)
<need to choose base and garlic topping>
Further resources:
Visit http://gsd.uwaterloo.ca/node/289
Paper about Clafer accepted at SLE'10
Visit http://gsd.uwaterloo.ca/node/292