90c9a4c3e42237f8c20a72e9723a5ba2.ppt
- Количество слайдов: 91
OWL The Web Ontology Language n n n W 3 C standard Collision of DAML (frames) and Oil (DLs in Frame clothing) Three ‘flavours’ n n n OWL-Lite –simple but limited OWL-DL – complex but deliverable (real soon now) OWL-Full – fully expressive but serious logical/computational problems n n n 1 Russel Paradox etc All layered (awkwardly) on RDF Schema Still work in progress – see Semantic Web Best Practices & Deployment Working Group (SWBP)
Note on syntaxes for OWL n Three official syntaxes + Protégé-OWL syntax n n n New Protégé-OWL simplified abstract syntax n n n 2 Abstract syntax -Specific to OWL N 3 -OWL & RDF -used in all SWBP documents XML/RDF -very verbose Old Protégé-OWL -Compact, derived from DL syntax some. Values. From all. Values. From intersection. Of union. Of OR complement. Of some only AND not Protégé/OWL can generate all syntaxes
A simple ontology: Animals Living Thing Body Part eats has part Plant Arm Animal Leg eats Herbivore Tree Person Carnivore Cow 3 Grass
Description Logics n What the logicians made of Frames n Greater expressivity and semantic precision n Compositional definitions n n To allow automatic classification & consistency checking n The mathematics of classification is tricky n Some seriously counter-intuitive results n 4 “Conceptual Lego” – define new concepts from old The basics are simple – devil in the detail
Description Logics n Underneath: n n computationally tractable subsets of first order logic Describes relations between Concepts/Classes n Individuals secondary n 5 DL Ontologies are NOT databases!
Description Logics: A brief history n Informal Semantic Networks and Frames (pre 1980) n n First Formalisation (1980) n n Wood: What’s in a Link; Brachman What IS-A is and IS-A isn’t. Bobrow KRL, Brachman: KL-ONE All useful systems are intractable (1983) n Brachman & Levesque: A fundamental tradeoff n n All tractable systems are useless (1987 -1990) n 6 Hybrid systems: T-Box and A-Box Doyle and Patel: Two dogmas of Knowledge Representation
A brief history of KR n ‘Maverick’ incomplete/intractable logic systems (1985 -90) n n Practical knowledge management systems based on frames n n GRAIL, LOOM, Cyc, Apelon, …, Protégé The German School: Description Logics (1988 -98) n n Complete decidable algorithms using tableaux methods (1991 -1992) Detailed catalogue of complexity of family – “alphabet soup of systems” n Optimised systems for practical cases (1996 -) n Emergence of the Semantic Web n Development of DAML (frames), OIL (DLs) DAML+OIL OWL n n 7 Development of Protégé-OWL A dynamic field – constant new developments & possibilities
Why the “Best Practice working Group”? n There is no established “best practice” n n n It is new; We are all learning A place to gather experience A catalogue of things that work – Analogue of Software Patterns n Some pitfalls to avoid n…but n Learning to build ontologies n Too many choices n n 8 there is no one way Need starting points for gaining experience Provide requirements for tool builders
Contributing to “best practice” n Please give us feedback n Your questions and experience n On the SW in general: semanticweb@yahoogroups. com n For specific feedback to SWBP n 9 Home & Mail Archive: http: //www. w 3. org/2001/sw/Best. Practices/ public-swbp-wg@w 3. org
Protégé-OWL & CO-ODE n Joint work: Stanford & U Manchester + Southampton & Epistemics n n Please give us feedback on tools – mailing lists & forums at: n protege. stanford. edu n www. co-ode. org Don’t beat your head against a brick wall! n n Look to see if others have had the same problem; If not… ASK! n 10 We are all learning.
Part II – Creating an ontology Useful patterns n n n n 11 Upper ontologies & Domain ontologies Building from trees and untangling Using a classifier Closure axioms Specifying Values n-ary relations Part-whole relations
Upper Ontologies n Ontology Schemas n High level abstractions to constrain construction n n e. g. There are “Objects” & “Processes” Highly controversial n Sumo, Dolce, Onions, GALEN, SBU, … Needed when you work with many people together n NOT in this tutorial – a different tutorial n 12
Domain Ontologies n Concepts specific to a field n n Diseases, animals, food, art work, languages, … The place to start n Understand ontologies from the bottom up n n Levels n n n 13 Or middle out Top domain ontologies – the starting points for the field n Living Things, Geographic Region, Geographic_feature Domain ontologies – the concepts in the field n Cat, Country, Mountain Instances – the things in the world n Felix the cat, Japan, Mt Fuji
Part II – Useful Patterns (continued) Upper ontologies & Domain ontologies n Building from trees and untangling n Using a classifier n Closure axioms & Open World Reasoning n Specifying Values n n-ary relations n 14
Example: Animals & Plants n n n n n 15 Dog Cat Cow Person Tree Grass Herbivore Male Female n n n n Carnivore Plant Animal Fur Child Parent Mother Father n n n n n Dangerous Pet Domestic Animal Farm animal Draft animal Food animal Fish Carp Goldfish
Example: Animals & Plants n n n n n 16 Dog Cat Cow Person Tree Grass Herbivore Male Female n n n n Carnivore Plant Animal Fur Child Parent Mother Father n n n n n Healthy Pet Domestic Animal Farm animal Draft animal Food animal Fish Carp Goldfish
Choose some main axes Add abstractions where needed; identify relations; Identify definable things, make names explicit n Living Thing n Animal n n n Carp Goldfish n n Tree Grass Fruit domestic n n pet Farmed n n n healthy sick Sex n n n Draft Food Wild Health n Plant n 17 n Fish n n Cat Dog Cow Person n Modifiers Mammal n n n Male Female Age n n Adult Child n Relations n eats n owns n parent-of n … Definable n n n n Carinvore Herbivore Child Parent Mother Father Food Animal Draft Animal
Reorganise everything but “definable” things into pure trees – these will be the “primitives” n Primitives n n Living Thing n Animal n Mammal n n n 18 n Domestic n n Wild Use n n n Plant n Tree n Grass n Fruit n Dangerous Safe Sex n n n Draft Food pet Risk n Carp Goldfish n Domestication n Fish n n Cat Dog Cow Person Modifiers Male Female Age n n Adult Child n Relations n eats n owns n parent-of n … Definables n n n n Carnivore Herbivore Child Parent Mother Father Food Animal Draft Animal
Set domain and range constraints for properties n Animal eats Living_thing n n Person owns Living_thing except person n n owns domain: Person range: Living_thing & not Person Living_thing parent_of Living_thing n 19 eats domain: Animal; range: Living_thing parent_of: domain: Animal range: Animal
Define things that are definable from the primitives and relations n n n 20 Parent = Animal and parent_of some Animal Herbivore= Animal and eats only Plant Carnivore = Animal and eats only Animal
Which properties can be filled in at the class level now? n What can we say about all members of a class? n 21 eats n All cows eat some plants n All cats eat some animals n All dogs eat some animals & eat some plants
Fill in the details (can use property matrix wizard) 22
Check with classifier n Cows should be Herbivores n Are they? why not? n What have we said? n n What do we need to say: Closure axiom n 23 Cows are animals and, amongst other things, eat some grass and eat some leafy_plants Cows are animals and, amongst other things, eat some plants and eat only plants
Closure Axiom n Cows are animals and, amongst other things, eat some plants and eat only plants Closure Axiom 24
In the tool n Right mouse button short cut for closure axiom n for any existential restriction adds closure axiom 25
Open vs Closed World reasoning n Open world reasoning n Negation as contradiction n Anything might be true unless it can be proven false n n Closed world reasoning n Negation as failure n Anything that cannot be found is false n 26 Reasoning about any world consistent with this one Reasoning about this world
Normalisation and Untangling Let the reasoner do multiple classification n Tree n n Directed Acyclic Graph (DAG) n n Things can have multiple parents n A ‘Polyhierarchy’ Normalisation n n 27 Everything has just one parent n A ‘strict hierarchy’ Separate primitives into disjoint trees Link the trees with restrictions n Fill in the values
Tables are easier to manage than DAGs / Polyhierarchies …and get the benefit of inference: Grass and Leafy_plants are both kinds of Plant 28
Remember to add any closure axioms Closure Axiom Then let the reasoner do the work 29
Normalisation: From Trees to DAGs n Before classification n A tree n After classification n A DAG n 30 Directed Acyclic Graph
Part II – Useful Patterns (continued) Upper ontologies & Domain ontologies n Building from trees and untangling n Using a classifier n Closure axioms & Open World Reasoning n Specifying Values n n-ary relations n 31
Examine the modifier list n Modifiers n Domestication n Domestic n n Wild n n Dangerous Safe n n n Male Female n Adult Child n Domestication Risk Sex Age Make meaning precise n Age n 32 Draft Food Sex n n n Risk n Identify modifiers that have mutually exclusive values n Use n n n Age_group NB Uses are not mutually exclusive n Can be both a draft (pulling) and a food animal
Extend and complete lists of values n Modifiers n Domestication n Domestic n Wild Feral n n Sex n n n n n Child Adult Elderly n Domestication Risk Sex Age Make meaning precise n Male Female Age n Infant n Toddler n 33 Dangerous Risky Safe Identify modifiers that have mutually exclusive values n Risk n n n Age_group NB Uses are not mutually exclusive n Can be both a draft and a food animal
Note any hierarchies of values n Modifiers n n Domestication n Domestic n Wild Feral n n n Dangerous Risky Safe Child n n n Infant Toddler Adult n Elderly n Domestication Risk Sex Age Make meaning precise n Male Female Age n 34 n Sex n n n Risk n Identify modifiers that have mutually exclusive values Age_group NB Uses are not mutually exclusive n Can be both a draft and a food animal
Specify Values for each: Two methods n Value partitions n Classes that partition a Quality n n Symbolic values n Individuals that enumerate all states of a Quality n 35 The disjunction of the partition classes equals the quality class The enumeration of the values equals the quality class
Method 1: Value Partitionsexample “Dangerousness” n n A parent quality – Dangerousness Subqualities for each degree n n n All subqualities disjoint Subqualities ‘cover’ parent quality n n Dangerous, Risky, Safe Dangerousness = Dangerous OR Risky OR Safe A functional property has_dangerousness n n Range is parent quality, e. g. Dangerousness Domain must be specified separately Dangerous_animal = 36 Animal and has_dangerousness some Dangerous n
as created by Value Partition wizard quality covering axiom partitions disjoints 37
Value partitions Diagram Animal ss usne ero dang s. From has_ alue V some Risky Dangerous Leo’s Danger Safe 38 ess sn erou ng s_da a h Dangerousness Dangerous animal Leo the Lion
Value partitions UML style Animal Dangerousness_ Value owl: union. Of Safe_ value Risky_ value Dangerous_ value Leo’s Dangerousness 39 has_dangerousness Dangerous some. Values. From Animal has_dangerousness Leo the Lion
Method 2: Value sets – Example Sex n There are only two sexes n Can argue that they are things “Administrative sex” definitely a thing n “Biological sex” is more complicated n 40
Method 2: Value setsexample Sex n n A parent quality – Sex_value Individuals for each value n n n Values all different (NOT assumed by OWL) Value type is enumeration of values n n n 41 Sex_value = {male, female} A functional property has_sex n n male, female Range is parent quality, e. g. Sex_value Domain must be specified separately Male_animal = Animal and has_sex is male
Value sets UML style Person Sex Value owl: one. Of has_sex female Man has _se x John 42
Issues in specifying values n Value Partitions n n n Can be subdivided and specialised Fit with philosophical notion of a quality space Require interpretation to go in databases as values n n n Work better with existing classifiers in OWL-DL Value Sets n n 43 in theory but rarely considered in practice Cannot be subdivided Fit with intuitions More similar to data bases – no interpretation Work less well with existing classifiers
Value partitions – practical reasons for subdivisions n n n “All elderly are adults” “All infants are children” etc. n See also “Normality_status” in http: //www. cs. man. ac. uk/~rector/ontologies/mini-top-bio 44 n One can have complicated value partitions if needed.
Picture of subdivided value partition Elderly_ value Adult_value Infant_ value Toddler_ value Child_value Age_Group_value 45
More defined kinds of animals n 46 Before classification, trees n After classification, DAGs
Part III – Hands On n Be sure you have installed the software n n 47 (See front page) Open Animals-tutorial-step-1
Explore the interface 48
Explore the interface New Subclass icon Asserted Hierarchy Class Description Disjoint Classes 49
Explore the interface New restriction Add superclass New expression Description “Necessary Conditions” 50
Explore the interface Definition “Necessary & Sufficient Conditions” 51 “Defined class” has necessary & sufficient conditions ( )
Explore the interface Classify button (racer must be running*) *Or some other DIG compliant classifier 52
Exercise 1 n Create a new animal, an Elephant and an Ape n n Make them disjoint from the other animals Make the ape an omnivore n n Make the sheep a herbivore n 53 eats animals and eats plants and only plants
Exercise 1 b: Classification n n Check it with the classifier Is Sheep classified under Herbivore n n Did it all turn red? n 54 If not, have you forgot the closure axiom? Do you have too many disjoint axioms?
Exercise 1 c: checking disjoints – make things that should be inconsistent n n Create a Probe_Sheep_and_Cow that is a kind of both Sheep and Cow Create a Probe_Ape_and_Man that is a kind of both Ape and Man Run the classifier Did both probes turn red? n 55 If not, check the disjoints
Exercise 1 d: Using Unit Tests n Right click on each of the Probe classes and select “Edit Unit Test Information” n n Mark each class as “unsatisfiable” From the tools menu select n “OWL Unit Testing”--> “Run Unit Tests” n The Unit tests should be ticked n 56 I. e. the classes were correctly found to be unsatisfiable.
Exercise 2: A new value partition n Create a new value partition n Size_partition Big n Medium n Small n n Describe n 57 Lions, Cows, and Elephants as domestic_cat as Small the rest Medium Big
Exercise 2 b n Define Big_animal and Small_animal n n Does the classification work Extra n Make a subdivision of Big for Huge and make elephants Huge n 58 Do elephants still classify as “Big Animal
Part IV – Patterns: n-ary relations Upper ontologies & Domain ontologies n Building from trees and untangling n Using a classifier n Closure axioms & Open World Reasoning n Specifying Values n n-ary relations n 59
Saying something about a restriction n Not just n n that an a book is good but who said so And its price And where to buy it But can say nothing about properties n except special thing Super and subproperties n Functional, transitive, symmetric n 60
N-ary Relations Binary Relation "Lions: Life in the Pride" n quality excellent According to whom?
Adding attributes to a Relation NY Times Book review "Lions: Life in the Pride" quality excellent
Define a class for a relation: Reification Class: Description instance-of "Lions: Life in the Pride" quality description Description_1 Quality: Excellent Source: NY Times Book review
A Relation Between Multiple Participants John buys “Lions: Life in the Pride” from books. com for $15 n Participants in this relation: n n n John “Lions: Life in the Pride” books. com $15 No clear “originator”
Network of Participants Class: Purchase This Purchase buyer John object "Lions: Life in the Pride" seller price books. com $15
Considerations n Choosing the right pattern: often subjective n n Pattern 1: additional attributes for a relation Pattern 2: a network of participants Instances of reified relations usually don’t have meaningful names Defining inverse relations is more tricky
Qualified cardinality constraints n n 68 Use with partonomy Use with n-ary relations
Cardinality Restrictions n “All mammals have four limbs” n n 69 “All Persons have two legs and two arms” “(All mammals have two forelimbs and two hind limbs)”
What we would like to say: Qualified cardinality constraints n n n Mammal has_part cardinality=4 Limb Mammal has_part cardinality = 2 Forelimb has_part cardinality = 2 Hindlimb Arm = Forelimb AND is_part_of some Person Glossary: “Forelimb” = front leg or arm “Hindlimb” = back leg 70
What we have to say in OWL n The property has_part has subproperties: has_limb has_leg has_arm has_wing n Mammal, Reptile, Bird Person has_leg Cow, Dog, Pig… Bird has_leg n Biped = Animal AND has_leg cardinality=2 71 has_limb cardinality=4 cardinality=2 has_leg cardinality=4 cardinality=2
Classification of bipeds and quadrupeds n 72 Before classification n After classificaiton
Cardinality and n-ary relations n Need to control cardinality of relations represented as classes n An animal can have just 1 “dangerousness” n Requires a special subproperty of quality: n 73 has_dangerousness_quality cardinality=1
Re-representing the property has_danger as the class Risk Animal has_danger Dangerous cardinality=1 ‘functional’ has_Quality cardinality=1 Risk pe Risk_type _ty =1 isk lity r s_ ina ha rd ca has_seriousness hacardinality=1 Seriousness ca s_a rd vo in ida ali n ty= ce 1 Avoidance 74
In OWL must add subproperty for each quality to control cardinality, e. g. has_risk_quality special subproperty of has_quality Animal n has_Risk_Quality cardinality=1 Risk Leads to a proliferation of subproperties n 75 The issue of “Qualified Cardinality Constraints” pe Risk_type _ty =1 isk lity r s_ ina ha rd ca has_seriousness hacardinality=1 Seriousness ca s_a rd vo in ida ali n ty= ce 1 Avoidance
Part VII – Summary n n n n Upper ontologies & Domain ontologies Building from trees and untangling Using a classifier Closure axioms & Open World Reasoning Specifying Values n-ary relations Part-whole relations n n 76 Transitive properties Qualified cardinality restrictions
End n To find out more: n n http: //www. co-ode. org n Comprehensive tutorial and sample ontologiesxz http: //protege. stanford. org n Subscribe to mailing lists; participate in forums n n 77 On the SW in general: semanticweb@yahoogroups. com For specific feedback to SWBP n Home & Mail Archive: http: //www. w 3. org/2001/sw/Best. Practices/ public-swbp-wg@w 3. org
“Elephant Traps”: Part 1 n n 79 ‘Some’ does not imply only ‘Only’ does not imply some’ Trivial satisfaction of universal restrictions Domain and Range Constraints What to do when it all turns red
some. Values. From means “some” n n some. Values. From means “some” means “at least 1” Dog_owner complete Person and has. Pet some. Values. From Dog n n Dog_owner partial Person and has. Pet some. Values. From Dog n 80 means: A Pet_owner is any person who has as a pet some (i. e. at least 1) dog means All Pet_owners are people and have as a pet some (i. e. at least 1) dog.
all. Values. From means “only” n all. Values. From means “only” means “no values except” n First_class_lounge complete Lounge and has. Occupants all. Values. From First. Class. Passengers n n Means “A ‘first class lounge’ is any lounge where the occupants are only first class passengers” or “A first ‘class lounge’ is any lounge where there are no occupants except first class passengers” First_class_lounge partial Lounge and has. Occupants all. Values. From First. Class. Passengers n 81 Means “All first class lounges have only occupants who are 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”
“Some” does not mean “only” n A “dog owner” might also own cats, and rats, and guinea pigs, and… n It is an open world, if we want a closed world we must add a closure restriction or axiom n Dog_only_owner complete Person and has. Pet some. Values. From Dog and has. Pet all. Values. From Dog n A “closure restriction” or “closure axiom” n n n 82 The problem in making maguerita pizza a vegie pizza Closure axioms use ‘or’ (disjunction) dog_and_cat_only_owner complete has. Pet some. Values. From Dog and has. Pet some. Values. From Cat and has. Pet all. Values. From (Dog or Cat)
“Only” does not mean “some” n There might be nobody in the first class lounge n n n That would still satisfy the definition It would not violate the rules A pizza with no toppings satisfies the definition of a vegetarian pizza n Pizza & has_topping_ingredient all. Values. From Vegetarian_topping n It has no toppings which are meat n n Analogous to the empty set is a subset of all sets n 83 It has not toppings which are not vegetables n It has no toppings which aren’t fish… One reason for a surprising subsumption is that you have made it impossible for there to be any toppings n all. Values. From (cheese and tomato)
Trivial Satisfiability n A universal (‘only’) restriction with an unsatisfiable filler is “trivially satisfiable” n i. e. it can be satisfied by the case where there is no filler n If there is an existential or min-cardinality restriction, inferred or explicit, then the class will be unsatisfiable n 84 Can cause surprising ‘late’ bugs
Domain & Range Constraints: Part 2 n Actually axioms n Property P range( Range. Class) means n n Property P domain( Domain. Class ) means n 85 owl: Thing restriction(P all. Values. From Range. Class) owl: Thing restriction(inverse(P) all. Values. From Domain. Class)
What happens if violated n Actually axioms n Property eats range( Living. Thing) means n n owl: Thing restriction(P all. Values. From Living. Thing) Bird eats some Rock n All Stone. Eater eats some rocks n 86 What does this imply about rocks? n Some rocks are living things n because only living things can be eaten n What does this say about “all rocks”?
Domain & Range Constraints n Actually axioms n Property eats domain( Living. Thing ) means n n n owl: Thing restriction(inverse(eats) all. Values. From Living. Thing) “Only living things eat anything” Stone. Eater eats some Stone n All Stone. Eaters eat some Stone n 87 Therefore All Stone. Eaters are living things n If Stone. Eaters are not already classified as living things, the classifier will reclassify (‘coerce’) them n If Stone. Eaters is disjoint from Living. Thing it will be found disjoint
Example of Coercion by Domain violation n has_topping: domain(Pizza) range(Pizza_topping) class Ice_cream_cone has_topping some Ice_cream n If Ice_cream_cone and Pizza are not disjoint: n Ice_cream_cone is classified as a kind of Pizza …but: Ice_cream is not classified as a kind of Pizza_topping n Have shown that: but only that: n 88 all Ice_cream_cones are a kinds of Pizzas, some Ice_cream is a kind of Pizza_topping Only domain constraints can cause reclassification
Domain & Range Constraints Non-Obvious Consequences n Range constraint violations – unsatisfiable or ignored n n n Domain constraint violations – unsatisfiable or coerced n n n If subject and Domain. Class are disjoint: unsatisfiable Otherwise, subject reclassified (coerced) to kind of Domain. Class! Furthermore cannot be fully checked before classification n 89 If filler and Range. Class are disjoint: unsatisfiable Otherwise nothing happens! although tools can issue warnings.
Part 3: What to do when “Its all turned red” Don’t Panic! n Unsatisfiability propagates – so trace it to its source n n Any class with an unsatisfiable filler in a some. Values. For (existential) restriction is unsatisfiable Any subclass of an unsatisfiable class is unsatisfiable Therefore errors propagate, trace them back to their source Only a few possible sources n n Violation of disjoint axioms Unsatisfiable expressions in some restrictions n n Violation of a universal (all. Values. From) constraint (including range and domain constraints) n 90 n Confusion of “and” and “or” Unsatisfiable domain or range constraints Tools coming - Try the debugger
End n To find out more: n n http: //www. co-ode. org n Comprehensive tutorial and sample ontologiesxz http: //protege. stanford. org n Subscribe to mailing lists; participate in forums n n 91 On the SW in general: semanticweb@yahoogroups. com For specific feedback to SWBP n Home & Mail Archive: http: //www. w 3. org/2001/sw/Best. Practices/ public-swbp-wg@w 3. org
Part VI – Hands On supplement n 92 Open Animals-tutorial-step-2
Exercise 3: (Advanced supplement) n n n 93 Load Animals-Tutorial-complete. pprj Define a new kind of Limb – Wing Describe birds as having 2 wings Define a Two-Winged_animal Does bird classify under Two-Winged_animal?
90c9a4c3e42237f8c20a72e9723a5ba2.ppt