- From: Richard Cyganiak <richard@cyganiak.de>
- Date: Tue, 8 Jun 2010 09:56:21 +0100
- To: Eric Prud'hommeaux <eric@w3.org>
- Cc: RDB2RDF WG <public-rdb2rdf-wg@w3.org>
Hi Eric, That's a good start. On 7 Jun 2010, at 16:49, Eric Prud'hommeaux wrote: > In order to get some common terminology, I've created a draft of a > Direct Mapping. Maybe start by defining what a database is in your notation? "A database db is a set of relations R_1...R_i" etc? > 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) } What are scalar(T) and reference(T)? > ∣ S = nodemap(R, pk(T)) > directL(R, S, A) ≝ triple(S, predicatemap(R, A), literalmap(A)) What's literalmap? > 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) What's the logic for uses hashes in some places and slashes in others? Shouldn't there be an rdf:type triple somewhere? If not, then how do you SPARQL for all records in a single DB? To be really useful, this direct mapping should define a URI for the DB itself, for each relation, and for each attribute in the relations. > I'm still playing with the notation. I'd prefer classical mathematical sets, so where you have: directDB(db) ≝ { directR(r) ∀ r ∈ db } I'd rather see: directDB(db) = { directR(r) | r ∈ db } General note: "succinct" and "clear" are correlated, but not the same. The latter should be the goal, not the former. Best, Richard > 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 Tuesday, 8 June 2010 09:18:07 UTC