- From: Eric Prud'hommeaux <eric@w3.org>
- Date: Mon, 7 Jun 2010 11:49:57 -0400
- To: RDB2RDF WG <public-rdb2rdf-wg@w3.org>
In order to get some common terminology, I've created a draft of a
Direct Mapping. This defines a Direct Graph and demonstrates how this
definition can be extended.
The crux of it is still:
directDB(db) ≝ { directR(r) ∀ r ∈ db }
directR(R) ≝ { directT(R, T) ∀ T ∈ R.Body }
directT(R, T) ≝ { directL(R, S, A) ∀ A ∈ scalar(T) }
∪ { directN(R, S, A) ∀ A ∈ reference(T) }
∣ S = nodemap(R, pk(T))
directL(R, S, A) ≝ triple(S, predicatemap(R, A), literalmap(A))
directN(R, S, A) ≝ triple(S, predicatemap(R, A), nodemap(R, A))
nodemap(R, A) ≝ IRI(stem + "/" + R.name "/" A.name + "." + A.value + "#_")
predicatemap(R, A) ≝ IRI(stem + "/" + R.name "#" A.name)
I'm still playing with the notation. It's currently a pretty classic
notation:
3.1 Notation for Types
A : a type
A ⊔ B : disjoint union of A and B
( A, B ) : tuple (Cartesian product) of types A and B
[ A ] : list of elements of type A
{ A } : set of elements of type A
{ A→B } : map of elements of type A to elements of type B
3.2 Notation for Injectors
a : an instance of an A
( a1, b1 ) : a tuple with elements a1 and b1
[ a1, a2 ] : list with elements a1 and a2
{ a1, a2 } : set with elements a1 and a2
{ a1→b1, a2→b2 } : map with elements with key a1 mapped to b1 and key a2 mapped to b2
3.3 Supporting Functions
AB[a] : in a map of A to B, the instance of B for a given A*
We can get more type-safety if we use something like a scala notation,
but I'm not sure how to tersely express things like disjoint union.
3.1 Notation for Types
x:X : x is an element in the set X
A ?? B : disjoint union of A and B (normally case classes
extending an abstract class, e.g.:
abstract class AB; A extends AB; B extends AB;
)
( A, B ) : tuple (Cartesian product) of types A and B
List[ A ] : list of elements of type A
Set[ A ] : set of elements of type A
Map[ A, B ] : map of elements of type A to elements of type B
3.2 Notation for Injectors
a : an instance of an A
( a1, b1 ) : a tuple with elements a1 and b1
List( a1, a2 ) : list with elements a1 and a2
Set( a1, a2 ) : set with elements a1 and a2
Map( a1→b1, a2→b2 ) : map with elements with key a1 mapped to b1 and key a2 mapped to b2
3.3 Supporting Functions
AB(a) : in a map of A to B, the instance of B for a given A*
--
-ericP
Received on Monday, 7 June 2010 16:16:09 UTC