Download - Semantic Recognition of Ontology Refactoring
Web Science & Technologies
University of Koblenz ▪ Landau, Germany
Semantic Recognition of Ontology Refactoring
Gerd Gröner
Fernando Silva Parreiras
Steffen Staab
ISWC2010, Shanghai
Gerd Grö[email protected]
ISWC 20102
WeST
Distributed Development of Ontologies
ChangeOntology
Version V1 ChangeOntology
Version V2Ontology
Version V3
ChangeOntology
Version V4
Change
Change ...
...
No change logs!
Gerd Grö[email protected]
ISWC 20103
WeST
What has changed?ontology version V ontology version V'
∆?
Compare
Recognize,analyze and explain!
Gerd Grö[email protected]
ISWC 20104
WeST
Agenda
Problem Description and Ontology Refactoring
Analyze and describe Changes
Recognize Changes
Reasoning for Comparison of Ontology Versions
Refactoring Recognition
Discussion and Conclusion
Gerd Grö[email protected]
ISWC 20105
WeST
Refactoring Scenario
Change
ontology version V
ontology version V'
Gerd Grö[email protected]
ISWC 20106
WeST
Comparison: What has changed?
ontology version V ontology version V'
Employee ⊑ PersonEmployee ⊑ ∃ project.Project (d)Employee ⊑ ∃ department.DepartmentEmployee ⊑ ∃=1 SSN.string (d)Person ⊑ ∃ name.stringPerson ⊑ ∃ address.string (d)Person ⊑ ∃ telephone.string (d)
Employee ⊑ PersonEmployee ⊑ ∃ department.DepartmentEmployee ⊑ ∃≥1 SSN.string (a)Person ⊑ ∃ name.string Person ⊑ ∃≤1 SSN.string (a)Person ⊑ ∃ contact.ContactData (a)ContactData ⊑ ∃ telephone.string (a)ContactData ⊑ ∃ address.string (a)Department ⊑ ∃ project.Project (a)
Gerd Grö[email protected]
ISWC 20107
WeST
Analyze and Describe Changes
Observation:
Is the set of axioms (V and V') helpful to recognize changes?
How can we communicate about changes?
(domain knowledge, modeling details)
Idea:
➔ Categorize Changes by Refactorings
Gerd Grö[email protected]
ISWC 20108
WeST
Refactoring Pattern
Refactoring Pattern
E.g., extract properties address and telephone
Refactoring
13 refactoring pattern
Example: Extract Class
Some properties p1, …, pn of class C should be extracted to a new class D
Gerd Grö[email protected]
ISWC 20109
WeST
Refactoring: Extract ClassV V'
Employee ⊑ PersonEmployee ⊑ ∃ project.Project (d)Employee ⊑ ∃ department.DepartmentEmployee ⊑ ∃=1 SSN.string (d)Person ⊑ ∃ name.stringPerson ⊑ ∃ address.string (d)Person ⊑ ∃ telephone.string (d)
Employee ⊑ PersonEmployee ⊑ ∃ department.DepartmentEmployee ⊑ ∃≥1 SSN.string (a)Person ⊑ ∃ name.string Person ⊑ ∃≤1 SSN.string (a)
Person ⊑ ∃ contact.ContactData (a)ContactData ⊑ ∃ telephone.string (a)ContactData ⊑ ∃ address.string (a)Department ⊑ ∃ project.Project (a)
Gerd Grö[email protected]
ISWC 201010
WeST
Refactoring: Pull-Up Property
V V'
Employee ⊑ PersonEmployee ⊑ ∃ project.Project (d)Employee ⊑ ∃ department.DepartmentEmployee ⊑ ∃=1 SSN.string (d)Person ⊑ ∃ name.stringPerson ⊑ ∃ address.string (d)Person ⊑ ∃ telephone.string (d)
Employee ⊑ PersonEmployee ⊑ ∃ department.DepartmentEmployee ⊑ ∃≥1 SSN.string (a)Person ⊑ ∃ name.string Person ⊑ ∃≤1 SSN.string (a)Person ⊑ ∃ contact.ContactData (a)ContactData ⊑ ∃ telephone.string (a)ContactData ⊑ ∃ address.string (a)Department ⊑ ∃ project.Project (a)
Gerd Grö[email protected]
ISWC 201011
WeST
Refactoring: Move Of Property
V V'
Employee ⊑ PersonEmployee ⊑ ∃ project.Project (d)Employee ⊑ ∃ department.DepartmentEmployee ⊑ ∃=1 SSN.string (d)Person ⊑ ∃ name.stringPerson ⊑ ∃ address.string (d)Person ⊑ ∃ telephone.string (d)
Employee ⊑ PersonEmployee ⊑ ∃ department.DepartmentEmployee ⊑ ∃≥1 SSN.string (a)Person ⊑ ∃ name.string Person ⊑ ∃≤1 SSN.string (a)Person ⊑ ∃ contact.ContactData (a)ContactData ⊑ ∃ telephone.string (a)ContactData ⊑ ∃ address.string (a)Department ⊑ ∃ project.Project (a)
Gerd Grö[email protected]
ISWC 201012
WeST
Recognition: Difficulties
1. (syntactical) comparison of axioms or triples in V and V'
2. purely structural comparison
➔ Semantic comparison
Gerd Grö[email protected]
ISWC 201013
WeST
Agenda
Problem Motivation and Ontology Refactoring
Reasoning for Comparison of Ontology Versions
Comparison Problem
Solution➔ Combining Knowledge Bases➔ Version Comparison
Refactoring Recognition
Discussion and Conclusion
Gerd Grö[email protected]
ISWC 201014
WeST
The Comparison Problem
Situation: Conceptual relations in each ontology (version) Same classes, e.g., Person
Goal:➔ Conceptual relation across versions
Person ⊑ ∃ address.string
V V'
Person ⊑ ∃ address.string ?
Gerd Grö[email protected]
ISWC 201015
WeST
Structural and semantic comparison: class subsumption checking to compare their extensions➔ Joint reasoning on two ontology versions to identify
conceptual relations
Problems:
How to connect them?
How to compare them?
Comparison Methods
Matching: compare class and property names and types
Gerd Grö[email protected]
ISWC 201016
WeST
Connecting two Versions
1. Matching between classes
2. Renaming of classes that appear in both versions
Person1 ⊑ ⊤Person2 ⊑ ⊤
3. Introduce a common superclass
Person1 ⊑ PersonPerson2 ⊑ Person
4. Relax range
ContactData ⊑ ∃ person . Person1 ⇒ ContactData ⊑ ∃ person . Person
Gerd Grö[email protected]
ISWC 201017
WeST
Comparison – affected axioms
Variety of modeling principles in OWL➔ Only some need to be considered:
Property restrictions:
Person ⊑ ∃ address.string
Corresponding axioms:
Person ⊑ ∃ contact.ContactData ContactData ⊑ ∃ address.string
→ Analyzes: Class expressions of property restrictions
Gerd Grö[email protected]
ISWC 201018
WeST
Comparison – affected axioms (2)
Sub- and superclasses:
➔ Only certain kinds of axioms are relevant! ➔ Next Step: Normalization to ease version comparison
Employee ⊑ PersonEmployee ⊑ ∃=1 SSN.string
Employee ⊑ PersonEmployee ⊑ ∃≥1 SSN.stringPerson ⊑ ∃≤1 SSN.string
Corresponding axioms:
→ Analyzes: Subclass axioms and property restrictions
Gerd Grö[email protected]
ISWC 201019
WeST
Normalization
Analyze axioms of class definitions of class C:
Conjunctive normal form of C:
Ĉ ≡ C1 ⊓ … ⊓ Cn ∀ i = 1 … n: C ⊑ Ci
Reduced conjunctive normal form: Ċ• Flattened nested conjunctions: A ⊓ (B ⊓ C) → A ⊓ B ⊓ C• Normalized negation: ¬D → D is a named class• B ⊑ A and A ⊔ B : A ⊔ B → A
Gerd Grö[email protected]
ISWC 201020
WeST
Reduced Conjunctive Normal Form
Uniqueness of the normal form Ċ
Ċ is reduced conjunctive normal form of Ĉ ≡ C1 ⊓ … ⊓ Cn
for each Ci one of the following condition holds:
Ci is a named class
Ci is a data type or object property restriction
Ci is a complex class definition that is neither a named superclass of C nor a property restriction
Gerd Grö[email protected]
ISWC 201021
WeST
Using the Normalization
Exploit two results
1. Only certain types of axioms are affected by the refactoring➔ Other axioms can be neglected
2. Representation in the normal form● Axioms are covered by the normal form representation● Uniqueness: class expressions Ci of C can be extracted
● Each Ci of C subsumes C
➔ Analyze changes by comparing class expressions Ci of C and C' using subsumption checking
Gerd Grö[email protected]
ISWC 201022
WeST
DiffDiff and Common Common Algorithm
Diff: Compute class expressions (superclasses) from C and C'
1. Class expressions of C in version V' but not in V
E.g.,
For each class expression A of Ċ'
If the subsumption ( A ⊑ C ) does not hold then
Class expression A belongs to the difference
2. Likewise the expressions of C in version V but not in V'
➔ Difference is computed in two steps (invert V and V'):
Reduced conjunctive normal form applies to the class expressions of the result
Gerd Grö[email protected]
ISWC 201023
WeST
Agenda
Problem Motivation and Ontology Refactoring
Reasoning for Comparison of Ontology Versions
Refactoring Recognition
Discussion and Conclusion
Gerd Grö[email protected]
ISWC 201024
WeST
Refactoring Recognition
Each pattern: specification of differences for comparing two versions description of conditions on these differences
Comparison algorithms: determining the different and common parts of a class in two versions Comparing class expressions of Ċ Using subsumption checking to test the conditions on the
differences
Gerd Grö[email protected]
ISWC 201025
WeST
Extract Class
D1 = { ∃ contact.ContactData } D2 = { ∃ address.string, ∃ telephone.string }
Difference (C = Person):
RC = ContactData (range of ∃ contact.ContactData)
V V'
Extracted Class:
Condition:ContactData ⊑ ∃ address.stringContactData ⊑ ∃ telephone.string are inferred in V'
Gerd Grö[email protected]
ISWC 201026
WeST
Conclusion
Described Solution:
Adopted 13 refactoring patterns and described the recognition
Realization:
Class comparison using subsumption checking Connect versions (V and V' are unaffected) Compare classes and class expressions of Ċ Only certain class expressions are relevant in the refactoring
Future Work:
Consider further refactoring patterns