Download presentation
Presentation is loading. Please wait.
Published byAlison Sarah Newman Modified over 9 years ago
1
LDK R Logics for Data and Knowledge Representation Semantic Matching
2
Outline Introduction Matching Problems Graphs Matching Syntactic vs. Semantic Semantic Relations Semantic Matching in ClassL 2
3
Introduction An important problem on graphs that we will apply to richer representations like concept hierarchies, classifications, schemas and ontologies is “matching.” This problem is also popular in semantic networks, where one may want to check whether a particular concept is present. E.g. 3
4
Date: a matching for marriage? 4
5
Introduction (cont’) Some popular situations that can be modeled as a matching problem are: - Concept matching in semantic networks. - Schema matching in distributed databases. - Ontology matching (ontology “alignment”) in the Semantic Web. -... 5
6
The Semantic Matching Problem (Example) 6 ? ? ?
7
Outline Introduction Matching Problems Graphs Matching Syntactic vs. Semantic Semantic Relations Classification matching L.O. and ClassL Semantic Matching in ClassL 7
8
Matching Problems There are two kinds of matching: Syntactic: matching of nodes as objects or strings (so, as such, without meaning). Semantic: matching of nodes as concepts. A Matching Problem (syntactic or semantic) is a problem on graphs summarized as: Given two finite graphs, is there a matching between the (nodes of the) two graphs? 8
9
Matching Problems A problem of matching can be decomposed in two steps: 1. Extract the graphs from the conceptual models under consideration; 2. Match the resulting graphs. Below we show some examples of step 1. (We follow [Giunchiglia & Shvaiko, 2007].) 9
10
Relational DB Schemas Let us consider the following relational database (RDB) model, say “BANK”: 10 (Giunchiglia & Shvaiko, 2007)
11
Relational DB Schemas: Representation 1 We can represent the RDB model “BANK” as a graph (a tree) with root “BANK”: The RDB model is first partitioned into relations, then attributes and data instances. 11 (Giunchiglia & Shvaiko, 2007)
12
Relational DB Schemas: Representation 2 We can represent the RDB model “BANK” as a graph (a tree) with root “BANK”: The model is partitioned into relations, then into tuples, attributes and data instances. 12 (Giunchiglia & Shvaiko, 2007)
13
Relational DB Schemas: NOTEs Which of the two representations is more preferable depends on the concrete task? It is always possible to transform one representation into the other. In contrast to the example of RDB “BANK”, DB schemas are seldom trees. More often, DB schemas are translated into Directed Acyclic Graphs (DAG’s). 13
14
OODB Schemas Let us consider the RDB “BANK” in terms of an object-oriented DB (OODB) schema: BRANCH (Street, City, Zip) PERSON (F_Name, L_Name) STAFF : PERSON (Position, Salary, Manager) The resulting graph is: 14 (Giunchiglia & Shvaiko, 2007)
15
OODB Schemas: NOTEs OODB schemas capture more semantics than the relational DBs. In particular, an OODB schema: explicitly expresses subsumption relations between elements; admits special types of arcs for part/whole relationships in terms of aggregation and composition. 15
16
RDB vs. OODB 16
17
Semi-structured Data Neither RDBs nor OODBs capture all the features of semi-structured or unstructured data (Buneman, 1997): semi-structured data do not possess a regular structure (schemaless); the “structure” of semi-structured data could be partial or even implicit. Typical examples are: HTML and XML. 17
18
XML Schemas XML schemas can be represented as DAGs. The graph from the RDB “BANK” could also be obtained from an XML schema. 18 (Giunchiglia & Shvaiko, 2007)
19
XML Schemas: NOTEs Often XML schemas represent hierarchical data models. In this case the only relationships between the elements are {is-a}. Attributes in XML are used to represent extra information about data. There are no strict rules telling us when data should be represented as elements, or as attributes. 19
20
Concept Hierarchies Def. A concept hierarchy is a semi-formal conceptualization of an application domain in terms of concepts and relationships. 20 (Giunchiglia & Shvaiko, 2007)
21
Concept Hierarchies: NOTEs Examples are classification hierarchies, e.g., anddirectories (catalogs). Classification hierarchies / Web directories are sometimes referred to as lightweight ontologies ( Uschold & Gruninger, 2004 ). However: They are not ontologies, as they lack of a formal semantics (semi-formal vs formal.) They don’t formalize class instances. 21
22
Semantic Matching Introduction Matching Problems Graphs Matching Syntactic vs. Semantic Semantic Relations Semantic Matching via SAT in ClassL 22
23
How to deal with these heterogeneity? Matching: given two graph-like structures (e.g., concept hierarchies or ontologies), produce a mapping between the nodes of the graphs that semantically correspond to each other 23
24
Syntactic vs. Semantic 24 Matching Semantic Matching Syntactic Matching Relations are computed between labels at nodes R = {x [0,1]} Relations are computed between concepts at nodes R = { =, ⊑, ⊒, , ⊓ } Note: all previous systems are syntactic… Note: needed for proper labeling of context mappings
25
Semantic Matching Mapping element is a 4-tuple, where ID ij is a unique identifier of the given mapping element; n 1 i is the i-th node of the first graph; n 2 j is the j-th node of the second graph; R specifies a semantic relation between the concepts at the given nodes 25 Semantic Matching: Given two graphs G1 and G2, for any node n 1 i G1, find the strongest semantic relation R’ holding with node n 2 j G2 Computed R’s, listed in the decreasing binding strength order: equivalence { = }; more general/specific { ⊒, ⊑ }; mismatch { }; overlapping { ⊓ }.
26
Example ? = ? ? Ste p 4 4 Images Europe Italy Austria 2 3 4 1 Italy Europe Wine and Cheese Austria Pictures 1 2 3 5
27
S-Match Algorithm Four Macro Steps Given two labeled trees T1 and T2, do: 1. For all labels in T1 and T2 compute concepts at labels 2. For all nodes in T1 and T2 compute concepts at nodes 3. For all pairs of labels in T1 and T2 compute relations between concepts at labels 4. For all pairs of nodes in T1 and T2 compute relations between concepts at nodes Steps 1 and 2 constitute the preprocessing phase, and are executed once and each time after the schema/ontology is changed (OFF- LINE part) Steps 3 and 4 constitute the matching phase, and are executed every time the two schemas/ontologies are to be matched (ON - LINE part)
28
Step 1: compute concepts at labels The idea: Translate natural language expressions into internal formal language Compute concepts based on possible senses of words in a label and their interrelations Preprocessing: Tokenization. Labels (according to punctuation, spaces, etc.) are parsed into tokens. E.g., Wine and Cheese ; Lemmatization. Tokens are morphologically analyzed in order to find all their possible basic forms. E.g., Images Image; Building atomic concepts. An oracle (WordNet) is used to extract senses of lemmatized tokens. E.g., Image has 8 senses, 7 as a noun and 1 as a verb; Building complex concepts. Prepositions, conjunctions, etc. are translated into logical connectives and used to build complex concepts out of the atomic concepts E.g., C Wine and Cheese = ⊔, where ⋃ is a union of the senses that WordNet attaches to lemmatized tokens
29
Step 2: compute concepts at nodes The idea: extend concepts at labels by capturing the knowledge residing in a structure of a graph in order to define a context in which the given concept at a label occurs Computation (basic case): Concept at a node for some node n is computed as an intersection of concepts at labels located above the given node, including the node itself 29 Wine and Cheese Italy Europe Austria Pictures 1 23 45 C 4 = C europe ⊓ C Pictures ⊓ C Italy
30
Step 3: compute relations between concepts at labels The idea: Exploit a priori knowledge, e.g., lexical, domain knowledge with the help of element level semantic matchers Results of step 3: 30 Italy Europe Wine and Cheese Austria Pictures 1 23 45 Europe Italy Austria 2 34 1 Images T1T2 = C Italy = C Austria = C Europe = C Images C Austria C Italy C Pictures C Europe T1 C Wine C Cheese
31
Step 4? Wait! What we have done in Step 3? Find semantic relations. What for? To build the semantic relation bases for further matching. What is a ‘relation base’ in the logic sense? TBox! We are building the TBox! 31
32
Step 4: compute relations between concepts at nodes 32 The idea: Reduce the matching problem to a validity problem Context: the relations between concepts at labels (from step 3) Wffrel (C1i, C2j): relation to be proved (with: C1i in Tree1 and C2j in Tree2) Translate into propositional logic: C1i = C2j is translated into C1i C2j C1i subsumes C2j is translated into C1i C2j C1i C2j is translated into ¬ (C1i C2j) Prove Context Wffrel ( C1 i, C2 j ) is valid with Rel={=, ⊑,⊒,⊥,⊓ } A propositional formula is valid iff its negation is unsatisfiable (SAT deciders are sound and complete … )
33
Pseudo code of Step4 CHANGE LINE15 1. i, j, N1, N2: int; 2. context, goal: wff; 3. n1, n2: node; 4. T1, T2: tree of (node); 5. relation = {=, ⊑, ⊒, }; 6. ClabMatrix(N1, N2), CnodMatrix(N1, N2), relation: relation 7. function mkCnodMatrix(T1, T2, ClabMatrix) { 8. for (i = 0; i < N1; i++) do 9. for (j = 0; j < N2; j++) do 10. CnodMatrix(i, j):=NodeMatch(T1(i),T2(j), ClabMatrix)} 11. function NodeMatch(n1, n2, ClabMatrix) { 12. context:=mkcontext(n1, n2, ClabMatrix, context); 13. foreach (relation in ) do { 14. goal:= w2r(mkwff(relation, GetCnod(n1), GetCnod(n2)); 15. if VALID(mkwff( , context, goal)) 16. return relation;} 17. return IDK;} Validity Reasoning Contex|=goal?
34
Example Example. Suppose we want to check if C1 2 = C2 2 34 T2 = C1 4 C1 3 = C1 2 C1 1 C2 5 C2 4 C2 3 C2 2 C2 1 T1 (C1 Images C2 Pictures ) (C1 Europe C2 Europe ) (C1 2 C2 2 ) Context Goal
35
Examples 35 Italy Europe Wine and Cheese Austria Pictures 1 23 45 Europe Italy Austria 2 34 1 Images T1T2 = Italy Europe Wine and Cheese Austria Pictures 1 23 45 Europe Italy Austria 2 34 1 Images T1T2 Italy Europe Wine and Cheese Austria Pictures 1 23 45 Europe Italy Austria 2 34 1 Images T1T2 Italy Europe Wine and Cheese Austria Pictures 1 23 45 Europe Italy Austria 2 34 1 Images T1T2
36
Another Example: Concept Hierarchies 36 (Serafini et. al., 2003)
37
Example (cont’) Suppose we want to discover the relation R between Chat and Forum in the Google directory (left) and Chat and Forum in the Yahoo directory (right): 37
38
Example (cont’) Step 1 : transformation of nodes n 1 = Chat and Forum and n 2 = Chat and Forum to propositions, P and Q; selection of the portion T of knowledge (background theory) relevant to the application of a SAT solver. WordNet is used at this step to build T. Step 2 : select the relation R between n 1 and n 2 among the semantic relations of interest. 38
39
Example (cont’) Step 3 : The question “Is Chat and Forum less general than Chat and Forum?” becomes the SAT problem “Is T |= P ⊑ Q?” where: P = (art#1 ⊓ literature#2 ⊓ (chat#1 ⊔ forum#1)), Q = (art#1 ⊔ humanities#1) ⊓ humanities#1 ⊓ (chat#1 ⊔ forum#1), T = { art#1 ⊑ humanities#1, humanities#1 ⊒ literature#2 } 39
40
References ( Preprints available at http://dit.unitn.it/~ldkr/#Biblio )http://dit.unitn.it/~ldkr/#Biblio F. Giunchiglia, P. Shvaiko, “Semantic matching.” Knowledge Engineering Review, 18(3):265-280, 2003. L. Serafini, P. Bouquet, B. Magnini, S. Zanobini, “An Algorithm for Matching Contextualized Schemas via SAT.” IRST Technical Report 0301-06, ITC, January 2003. F. Giunchiglia, M. Marchese, I. Zaihrayeu. “Encoding Classifications into Lightweight Ontologies.” J. of Data Semantics VIII, Springer-Verlag LNCS 4380, pp 57-81, 2007. 40
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.