1. Web Science & Technologies
University of Koblenz ▪ Landau, Germany
Semantic Recognition of Ontology
Refactoring
Gerd Gröner
Fernando Silva Parreiras
Steffen Staab
ISWC2010, Shanghai
2. Distributed Development of Ontologies
Ontology Ontology Ontology
Version V1 Change Version V2 Change Version V3 Change ...
Ontology
Change Version V4 Change ...
No change logs!
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 2
3. What has changed?
ontology version V ontology version V'
Compare
∆? Recognize,
analyze and explain!
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 3
4. Agenda
Problem Description and Ontology Refactoring
Analyze and describe Changes
Recognize Changes
Reasoning for Comparison of Ontology Versions
Refactoring Recognition
Discussion and Conclusion
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 4
5. Refactoring Scenario
ontology
version V'
ontology
version V
Change
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 5
6. Comparison: What has changed?
ontology version V ontology version V'
Employee ⊑ Person
Employee ⊑ Person Employee ⊑ ∃ department.Department
Employee ⊑ ∃ project.Project (d) Employee ⊑ ∃≥1 SSN.string (a)
Employee ⊑ ∃ department.Department Person ⊑ ∃ name.string
Employee ⊑ ∃=1 SSN.string (d) Person ⊑ ∃≤1 SSN.string (a)
Person ⊑ ∃ name.string Person ⊑ ∃ contact.ContactData (a)
Person ⊑ ∃ address.string (d) ContactData ⊑ ∃ telephone.string (a)
Person ⊑ ∃ telephone.string (d) ContactData ⊑ ∃ address.string (a)
Department ⊑ ∃ project.Project (a)
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 6
7. 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
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 7
8. Refactoring Pattern
13 refactoring pattern
Example: Extract Class
Refactoring Pattern
Some properties p1, …, pn of class C should be extracted to a new class D
Refactoring
E.g., extract properties address and telephone
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 8
9. Refactoring: Extract Class
V V'
Employee ⊑ Person
Employee ⊑ ∃ department.Department
Employee ⊑ Person
Employee ⊑ ∃≥1 SSN.string (a)
Employee ⊑ ∃ project.Project (d)
Employee ⊑ ∃ department.Department Person ⊑ ∃ name.string
Employee ⊑ ∃=1 SSN.string (d) Person ⊑ ∃≤1 SSN.string (a)
Person ⊑ ∃ name.string Person ⊑ ∃ contact.ContactData (a)
Person ⊑ ∃ address.string (d) ContactData ⊑ ∃ telephone.string (a)
Person ⊑ ∃ telephone.string (d) ContactData ⊑ ∃ address.string (a)
Department ⊑ ∃ project.Project (a)
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 9
10. Refactoring: Pull-Up Property
V V'
Employee ⊑ Person
Employee ⊑ Person Employee ⊑ ∃ department.Department
Employee ⊑ ∃ project.Project (d) Employee ⊑ ∃≥1 SSN.string (a)
Employee ⊑ ∃ department.Department Person ⊑ ∃ name.string
Employee ⊑ ∃=1 SSN.string (d) Person ⊑ ∃≤1 SSN.string (a)
Person ⊑ ∃ name.string Person ⊑ ∃ contact.ContactData (a)
Person ⊑ ∃ address.string (d) ContactData ⊑ ∃ telephone.string (a)
Person ⊑ ∃ telephone.string (d) ContactData ⊑ ∃ address.string (a)
Department ⊑ ∃ project.Project (a)
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 10
11. Refactoring: Move Of Property
V V'
Employee ⊑ Person
Employee ⊑ Person Employee ⊑ ∃ department.Department
Employee ⊑ ∃ project.Project (d) Employee ⊑ ∃≥1 SSN.string (a)
Employee ⊑ ∃ department.Department Person ⊑ ∃ name.string
Employee ⊑ ∃=1 SSN.string (d) Person ⊑ ∃≤1 SSN.string (a)
Person ⊑ ∃ name.string Person ⊑ ∃ contact.ContactData (a)
Person ⊑ ∃ address.string (d) ContactData ⊑ ∃ telephone.string (a)
Person ⊑ ∃ telephone.string (d) ContactData ⊑ ∃ address.string (a)
Department ⊑ ∃ project.Project (a)
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 11
12. Recognition: Difficulties
1. (syntactical) comparison
of axioms or triples in V
and V'
2. purely structural
comparison
➔ Semantic comparison
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 12
13. 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
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 13
14. The Comparison Problem
V V'
Situation:
Conceptual relations in each ontology (version)
Same classes, e.g., Person
Person ⊑ ∃ address.string Person ⊑ ∃ address.string ?
Goal:
➔ Conceptual relation across versions
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 14
15. Comparison Methods
Matching: compare class and property names and types
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?
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 15
16. Connecting two Versions
1. Matching between classes
2. Renaming of classes that appear in both versions
Person1 ⊑ ⊤
Person2 ⊑ ⊤
3. Introduce a common superclass
Person1 ⊑ Person
Person2 ⊑ Person
4. Relax range
ContactData ⊑ ∃ person . Person1
⇒ ContactData ⊑ ∃ person . Person
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 16
17. Comparison – affected axioms
Variety of modeling principles in OWL
➔ Only some need to be considered:
Property restrictions:
Corresponding axioms:
Person ⊑ ∃ contact.ContactData
Person ⊑ ∃ address.string ContactData ⊑ ∃ address.string
→ Analyzes: Class expressions of property restrictions
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 17
18. Comparison – affected axioms (2)
Sub- and superclasses:
Corresponding axioms:
Employee ⊑ Person
Employee ⊑ Person
Employee ⊑ ∃≥1 SSN.string
Employee ⊑ ∃=1 SSN.string
Person ⊑ ∃≤1 SSN.string
→ Analyzes: Subclass axioms and property restrictions
➔ Only certain kinds of axioms are relevant!
➔ Next Step: Normalization to ease version comparison
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 18
19. 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
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 19
20. 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
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 20
21. 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 C of C can be extracted
i
● Each Ci of C subsumes C
➔ Analyze changes by comparing class expressions Ci of C
and C' using subsumption checking
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 21
22. Diff and 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
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 22
23. Agenda
Problem Motivation and Ontology Refactoring
Reasoning for Comparison of Ontology Versions
Refactoring Recognition
Discussion and Conclusion
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 23
24. 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
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 24
25. Extract Class
V V'
Difference (C = Person):
D2 = { ∃ address.string, D1 = { ∃ contact.ContactData }
∃ telephone.string }
Extracted Class: RC = ContactData
(range of ∃ contact.ContactData)
Condition:
ContactData ⊑ ∃ address.string
ContactData ⊑ ∃ telephone.string are inferred in V'
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 25
26. 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
WeST Gerd Gröner ISWC 2010
groener@uni-koblenz.de 26