P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

31
Resolving Schematic Discrepancy in the Integration of Entity- Relationship Schemas (Implementation) P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Transcript of P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Page 1: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Resolving Schematic Discrepancy in the Integration

of Entity-Relationship Schemas(Implementation)

P15Lai Xiaoni             (U077151L)Qiao Li                 (U077194E)Saw Woei Yuh     (U077146X)Wang Yong          (U077138Y)

Page 2: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Introduction and Motivationo Ontology Approach

• Implementationo Data Structure o Parser o Algorithms

• Evaluation o Resultso Limitation and Challenges

• Conclusion

Content

Page 3: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Schema integration

• Occurrence of Schematic Discrepancies • Implement existence algorithm

o Resolve schematic discrepancies by transforming meta-data into entities   

o Keep the information and constraints of original schemas

  

Introduction and Motivation

Page 4: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

DB1:

An example of schematic disprepancies

Page 5: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

An example of schematic discrepancies

DB2:

Page 6: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

DB3:

An example of schematic discrepancies

Page 7: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Define ontology

Ontology Approach

Page 8: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Data Structure

Page 9: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Input : Elevated Schema• modified version of original ER schema that are constructed using

representation of ontology symbols. 

•  Users have to specify the discrepant meta-attributes, cardinality constraints and attribute types• Need for a more detailed definition

Elevated schema

Page 10: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

JAN_BANK = bank[month='jan']{  B#(2) = b#       BANK_NAME(2) = name       COUNTRY1_REVENUE(0) = revenue[country='c1', inherit ALL]       COUNTRY2_REVENUE(0) = revenue[country='c2', inherit ALL]    COUNTRY3_REVENUE(0) = revenue[country='c3', inherit ALL]    }

Our Elevated Schema

Ontology Type

0 -> m: 11 -> m: m2-> 1:13-> 1:m

Page 11: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

*EARN = earn<COUNTRY(0)BANK(0)MONTH(0)>{REVENUE(0) = revenue}

Our Elevated Schema

EARN

Entities

0 -> m1 -> 1

Page 12: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Input Fileo Contains two database schema to be integratedo No duplicated entities or relationshipso Entities come before relationships

• Identification of Discrepancieso Indicated by meta-attributeso COUNTRY1_REVENUE(0) = revenue[country='c1', inherit ALL]

• No general context for a Databaseo Contexts of database are represented by ontology of entity and

relationship types

Assumptions

Page 13: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Four Major algorithms

Page 14: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Input: Database object• Output: a new Database object containing entities

(without discrepant contexts) and relationships.

Three Major Operations:1. Discrepant Inherited Contexts of each Entity --> Entities, linked by a newly

constructed Relationship2. Attributes of each Entity --> Entities, linked by a newly constructed

Relationship || Discrepant Contexts of Attributes waiting to be resolved later

3. Entities involved in original Relationships are replaced, according to the similarity of contexts.

  

TRANS_ENT

Page 15: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)
Page 16: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• This algorithm deals with discrepant relationships.

• The steps are very similar to the TRANS_ENT except that the third major operation is omitted.

TRANS_REL

Page 17: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)
Page 18: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Implemented in Trans_ent.py

• This algorithm examines the discrepant attributes of all entities in the database.

• It goes through two major operations:1.Self Contexts of each attribute --> Entities, linked by a newly

constructed Relationship2.each attribute --> Entity || added into the new Relationship as its

Attribute

TRANS_ENT_ATTR

Page 19: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• This algorithm examines the discrepant attributes of all relationships in the database.

• It goes through two major operations:1.Self Contexts of each attribute --> Entities, linked by a newly

constructed Relationship2.each attribute --> Entity || added into the new Relationship as its

Attribute

TRANS_REL_ATTR

Page 20: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• In the last step, duplicate entities and relationships are merged together

• Detect: Same ontology, same attributes, Same meta-attributes

• Action: Remove Duplicate; Merging Domain.

• Written in two functions called unionEntities and unionRelationships.

Union of Entities and Relationship

Page 21: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Examples given in An ontology based approach to the integration of entity-relationship schemas. 

Demostrations

Page 22: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Union

• Resolved discrepancies in relationship type with Trans_rel. 

Demonstration – DB1 & DB3

Page 23: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

• Resolved discrepancies in relationship type with Trans_ent

Demonstration – DB1 & DB2

Page 24: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Demonstration – DB1 & DB2• Resolved discrepancies in relationship type with

Trans_rel_attr. 

R2

R2

R2

R2

Page 25: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Demonstration – DB1 & DB2• Resolved discrepancies in relationship type with

Trans_rel_attr. 

Desired Our Result

Page 26: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

1. Correct Translation to elevated schema

Users have to define precisely on every entity, relationships, attributes and their contexts according to our definition.

eg. if we do not specify JAN_EARNS is related with EARNS using the ontology type of earn with discrepant meta-attributes

Limitations and Challenges

*EARN = earn<COUNTRY(0)BANK(0)MONTH(0)>{REVENUE(0) = revenue}*JAN_EARNS = earn[month='jan']<BANK(0)COUNTRY(0)>{REVENUE(0) = revenue[ inherit ALL]} ...

Page 27: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

2. Remove Redundant Aggregated Relationship Types

    Our assumption: Original schemas contain no aggregated relationship types and the end results should not contain aggregated relationship types either.

    --> Some complicated schemas may not be solved.

Limitations and Challenges

Page 28: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

3. Identification of Ontology in New Relationship Types

In the process of Trans, new Relationship objects are constructed. But...It is difficult to decide which ontology type to take for this new relationship.

-->Unable to identify duplicated relationships if any, due to the lack of ontology type

Possible Solution: • Ask the users to identify the ontology type

Limitations and Challenges

Page 29: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

4. Cases of attributes with only partial inheritance

Some attributes may only inherit some of contexts from entities or relationships. Our implementation involves this theoretic case.

Yet, no practical example is given in the report.

Limitations and Challenges

Page 30: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Our Achievements:

• Implemented the algorithms• Detailed evaluation on our implementations• Clearly guide users to solve discrepancies in database

schema integrations

Most importantly, we have thoroughly learned and understood the challenges in resolving discrepancies, features of real-life entity-relationship designs and the ontology approach.

Conclusion

Page 31: P15 Lai Xiaoni (U077151L) Qiao Li (U077194E) Saw Woei Yuh (U077146X) Wang Yong (U077138Y)

Thanks you!