Download presentation
Presentation is loading. Please wait.
Published bySuparman Kurniawan Modified over 6 years ago
1
On Directly Mapping Relational Databases to RDF and OWL
Juan F. Sequeda Marcelo Arenas Daniel P. Miranker
2
Agenda Direct Mapping and Property Direct Mapping DM Properties of DM
Extended DM Conclusion
3
Direct Mapping A direct mapping is a default and automatic way of translating a relational database to RDF. A direct mapping M is a total function from RC to G. RC is the set of all triples of the form(R,Σ,I) R is relational schema Σ is a set of PKs and FKs over R I is an instance of R G is the set of all RDF graph
4
Fundamental Properties
Information Preservation If direct mapping does not lose any information about the relational instance being translated. Query Preservation if every query over a relational database can be translated into an equivalent query over the RDF graph resulting from the mapping.
5
Desirable Properties Monotonicity Semantics Preservation
if we insert new data to the database, then the elements of the mapping that are already computed are unaltered. Semantics Preservation A direct mapping is semantics preserving if the satisfaction of a set of PKs and FKs by a relational database is encoded in the translation process.
6
Direct Mapping DM Storing relational databases Storing an ontology
Translating relational schemas into OWL Translating database instances into RDF Example
7
Storing relational databases
REL(r) e.g. REL("STUDENT") ATTR(a,r) e.g. ATTR("NAME","STUDENT") PK(a,r) e.g. PK("SID","STUDENT") FK(a,r,b,s) e.g. FK("CODE","COURSE","DID","DEPT") VALUE(v,a,t,r) e.g. VALUE("1","SID","id1","STUDENT")
8
Storing an ontology Class(c) OPn(p1,…,pn,d,r) DTP(p,d) c is a class
p1,...,pn (n ≥ 1) form an object property with domain d and range r. DTP(p,d) p is a data type property with domain d.
9
Storing an ontology(cont'd)
Identifying binary relations: BINREL(R,A,B,S,C,T,D)← PK(A,B,R),¬THREEATTR(R), FK(A,R,C,S),R≠S, FK(B,R,D,T),R≠T, ¬TWOFK(A,R),¬TWOFK(B,R), ¬ONEFK(A,B,R),¬FKTO(R) BINREL("ENROLLED","SID","CID", "STUDENT","SID","COURSE","CID")
10
Storing an ontology(cont'd)
Identifying class: CLASS(X) ← REL(X),¬ISBINREL(X) ISBINREL(X) ← BINREL(X,A,B,S,C,T,D) E.g. CLASS("DEPT") CLASS("STUDENT")
11
Storing an ontology(cont'd)
Identifying object properties: OP(X,Y,S,T) ← FK(X,S,Y,T), ¬ ISBINREL(S) E.g. OP("CODE","DID","COURSE","DEPT")
12
Storing an ontology(cont'd)
Identifying data type properties: DTP(A,R) ← ATTR(A,R), ¬ISBINREL(R) E.g. DTP("NAME","STUDENT")
13
Translating schemas into OWL
Generating IRI Class CLASSIRI(R,X) ← CLASS(R),CONCAT(base,R,X) E.g. Data type property DTP_IRI(A,R,X) ← DTP(A,R), CONCAT(base,R,"#",A,X)
14
Translating schemas into OWL(cont’d)
Generating IRI Object property OP_IRI(R,A,B,S,C,T,D,X) ← BINREL(R,A,B,S,C,T,D), CONCAT(base,R,"#",A,",",B,",",C,",",D,X) E.g. OP_IRI(X,Y,S,T,X) ← OP(X,Y,S,T), CONCAT(base,S,",",T,"#",X,",",Y,X)
15
Translating schemas into OWL(cont’d)
Translating relational schemas Class TRIPLE(U,"rdf:type","owl:Class") ← CLASS(R),CLASSIRI(R,U) Data type property TRIPLE(U,"rdf:type","owl:DatatypeProperty") ← DTP(A,R), DTP_IRI(A,R,U) TRIPLE(U,"rdfs:domain",W) ← DTP(A,R), DTP_IRI(A,R,U), CLASSIRI(R,W)
16
Translating schemas into OWL(cont’d)
Translating relational schemas Object property TRIPLE(U,"rdf:type","owl:ObjectProperty") ← OP(X,Y,S,T),OP_IRI(X,Y,S,T,U) TRIPLE(U, "rdfs:domain",W) ← OP(X,Y,S,T),OP_IRI(X,Y,S,T,U),CLASSIRI(S,W) TRIPLE(U, "rdfs:range",W) ← OP(X,Y,S,T),OP_IRI(X,Y,S,T,U),CLASSIRI(T,W)
17
Translating instances into RDF
Generating IRI ROWIRI(V,A,T,R,X) ← PK(A,R), VALUE(V,A,T,R), CONCAT(base,R,"#",A,"=",V,X) E.g. Given VALUE("1","SID","id1","STUDENT") and PK("SID","STUDENT"),the IRI is: BLANKNODE(T,R,X) ← VALUE(V,A,T,R), CONCAT("_:",R,T,X)
18
Translating instances into RDF(cont’d)
Translating relational instances CLASS TUPLEID(T,R,X) ← CLASS(R),PK(A,R), VALUE(V,A,T,R),ROWIRI(V,A,T,R,X) CLASS(R),¬HASPK(R), VALUE(V,A,T,R),BLANKNODE(T,R,X) TRIPLE(U,"rdf:type",W) ← VALUE(V,A,T,R),TUPLEID(T,R,U),CLASSIRI(R,W) E.g. TRIPLE(" "rdf:type", "
19
Translating instances into RDF(cont’d)
Translating relational instances Object Property(from BINREL) TRIPLE(U,V,W) ← BINREL(R,A,B,S,C,T,D), VALUE(V1,A,T1,R),VALUE(V1,C,T2,S), VALUE(V2,B,T1,R),VALUE(V2,D,T3,T), TUPLEID(T2,S,U), OP_IRI(R,A,B,S,C,T,D,V), TUPLEID(T3,T,W) E.g. TRIPLE(" " "
20
Translating instances into RDF(cont’d)
Translating relational instances Object Property(from FK) TRIPLE(U,V,W) ← OP(A,B,S,T), VALUE(V1,A,T1,S),VALUE(V1,B,T2,T), TUPLEID(T1,S,U), OP_IRI(A,B,S,T,V), TUPLEID(T2,T,W) E.g. TRIPLE(" " "
21
Translating instances into RDF(cont’d)
Translating relational instances Data type Property TRIPLE(U,V,W) ← DTP(A,R),VALUE(W,A,T,R), W≠NULL,TUPLEID(T,R,U),DTP_IRI(A,R,V) E.g. TRIPLE(" " "John")
22
Properties of DM Information preservation Query preservation
Monotonicity Semantics preservation
23
Query Preservation of DM
Translate relational algebra into equivalent SPARQL query selection projection rename join union difference SPARQL query generated by
24
Semantics Preservation of DM
Example of PK violation T1.SID = 1, T1.NAME = John T2.SID = 1, T2.NAME = Peter Database is inconsistent Resulting RDF graph is consistent DM is not semantics preserving.
25
Extended DM: DMpk Extended rules Properties of DMpk
TRIPLE(a,"owl:differentFrom",a) ← PK(X,R), VALUE(V,X,T1,R),VALUE(V,X,T2,R),T1 ≠ T2 TRIPLE(a,"owl:differentFrom",a) ← PK(X,R),VALUE(V,X,T,R),V = NULL Properties of DMpk Information preservation Query preservation Monotonicity Semantic preservation if considers only PKs
26
Extended DM: DMpk+fk Extended rules Properties of DMpk+fk
VIOLATION(S) ← FK(X,S,Y,T), VALUE(V,X,T,S),V ≠ NULL, ¬ISVALUE(V,Y,T) TRIPLE(a,"owl:differentFrom", a) ← VIOLATION(S) Properties of DMpk+fk Information preservation Query preservation Monotonicity Semantic preservation
27
Conclusion Direct mapping DM Extended DM
Information preservation Query preservation Monotocity Extended DM DMpk DMpk+fk “No monotone direct mapping is semantics preserving”
28
The End Thank You!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.