Re: documenting a default mapping

* Juan Sequeda <juanfederico@gmail.com> [2010-06-01 00:34-0500]
> Hi Eric
> 
> I definitely agree that it would be very useful to write down base case
> transformations from relations (rdb) to RDF, analogous to D2R's minimal
> configuration.
> 
> However I want to make a quick reminder, that this is what I have been
> standing up and stating since day one: Direct mapping is needed because it
> is the first step and it can be automated. I have recommended several times
> to read our paper where we show a formal framework based on datalog on how
> to create the transformations from RDB to OWL. Here is the paper again. I
> really hope everybody can read it, because honestly, the work has already
> been done:
> 
> Translating SQL Applications to the Semantic Web
> http://www.springerlink.com/content/mv58805364k31734/
> http://userweb.cs.utexas.edu/~jsequeda/rdb2rdf/sql2sw_dexa2008.pdf
> 
> My bachelors thesis a while back was on surveying all the different Direct
> Mapping approaches. I have just finished writing this up as a journal
> submission. In this survey, we create an evaluation framework in order to
> compare all the approaches and determine a notion of completeness.
> 
> http://userweb.cs.utexas.edu/~jsequeda/rdb2rdf/Survey-DO-NOT-DISTRIBUITE.pdf

oops, uploaded it as a "Downfall" parody. should i issue a take-down?

> I'd appreciate it if this is not massively distributed. (btw, we survey the
> work of Astrova et al that you were mentioning).
> 
> Eric, I'm a bit fuzzy on the algebra and explanation that you are
> presenting. However I insist that you take a look at our work because I
> believe we are on the same page, and we shouldn't re-invent the wheel.

I think the principle difference is that sql2sw maps to OWL where the
directGraph stuff maps to RDF. As an illustration, sql2sw states that

┌┤Employee├──┬──────┐  ┌┤Address├────┬────────┐
│ ID │ name  │ addr │  │ ID │ street │ number │
│ 11 │ Alice │   18 │  │ 18 │ Elm    │    353 │
└────┴───────┴──────┘  └────┴────────┴────────┘

defines an ontology with e.g. an object property implied by the addr
attribute and datatype properties implied by the name street and
number attributes, directGraph takes a more pedestrian approach of
emitting triples, e.g.

  <stem+Employee/ID.11#_> <stem+Employee#name> "Alice" .
  <stem+Employee/ID.11#_> <stem+Employee#addr> <stem+Address/ID.18#_> .
  <stem+Address/ID.18#_> <stem+Employee#street> "Elm" .
  <stem+Address/ID.18#_> <stem+Employee#number> 353 .

In effect, sql2sw produces an ontology that describes the output of
directGraph.

> BTW, in the charter, aren't we suppose to have a RIF representation of the
> mapping language. We should be able to easily translate datalog to RIF, so
> this should be a done deal.
> 
> Cheers,
> 
> Juan Sequeda
> +1-575-SEQ-UEDA
> www.juansequeda.com
> 
> 
> On Mon, May 31, 2010 at 1:45 AM, Eric Prud'hommeaux <eric@w3.org> wrote:
> 
> > Noting Irina Astrova's "Rules for Mapping SQL Relational Databases to
> > OWL Ontologies", I suspect it would be useful to write down a base
> > case transformation from relations to RDF, analogous to D2R's minimal
> > configuration for relations with single primary keys. Following is an
> > algebra and an explaination for that:
> >
> > Suppose we want to RDF-ize a relation R:
> >  R:relation := (name:string, data:set(T:tuple))†
> >  T := set (A:attribute)
> >  attributes := (name:string, value:string,
> > function:null|pk|reference|scalar)
> > meaning attributes are SQL NULL, a primary key, a foreign key, or
> > scalar values. (Yes, this minimal mapping precludes attributes from
> > being both primary AND foreign keys.)
> >
> > RDFr(R)    := set (RDFt(T) for each T in R.data)
> > RDFt(T)    := set (RDFl(S, A) for each scalar A in T)
> >            + set (RDFn(S, A) for each reference A in T) | S =
> > nodemap(pk(T))
> > RDFl(S, A) := triple (S, predicatemap(A), literalmap(A))
> > RDFn(S, A) := triple (S, predicatemap(A), nodemap(A))
> >
> > literalmap produces RDF literal with XSD datatypes with this type
> > mapping TM:
> >  SQL           XSD
> >  INT           http://www.w3.org/TR/xmlschema-2/#integer
> >  FLOAT         http://www.w3.org/TR/xmlschema-2/#float
> >  DATE          http://www.w3.org/TR/xmlschema-2/#date
> >  TIME          http://www.w3.org/TR/xmlschema-2/#time
> >  TIMESTAMP     http://www.w3.org/TR/xmlschema-2/#dateTime
> >  CHAR          http://www.w3.org/TR/xmlschema-2/#string
> >  VARCHAR       http://www.w3.org/TR/xmlschema-2/#string
> >  STRING        http://www.w3.org/TR/xmlschema-2/#string
> >
> > literalmap := rdfLiteral(A,value, TM(A.type))
> >
> > nodemap and predicate map are lexical transformations producing IRIs,
> > either hash
> >  nodemap(A):IRI = IRI(stemURI + "/" + R.name "/" A.name + "." + A.value +
> > "#_")
> >  predicatemap(A):IRI = IRI(stemURI + "/" + R.name "#" A.name)
> > or slash-compatible:
> >  nodemap(A):IRI = IRI(stemURI + "/" + R.name "/" A.name + "/" + A.value)
> >  predicatemap(A):IRI = IRI(stemURI + "/" + R.name "/" A.name)
> >
> > † A variant of this algebra with the traditional relation definition
> >    R:relation := (name:string, header:set(D:definition),
> > data:multiset(T:tuple))
> >  was implemented in scala
> >
> > https://dvcs.w3.org/hg/stemGraph/file/4ace3eb848d4/src/main/scala/Main.scala
> >  but the extra rigor ensuring consistent attributes provides more noise
> >  than value to this application.
> >
> >
> > I'd like to get this into a forum for disucssion with rdb2rdf WG and
> > the broader community. If folks here are interested in this material,
> > I'll draw up a WG-publishable document. If not, I can make it available
> > elsewhere. Either way, the feedback will be useful to us.
> > --
> > -ericP
> >
> >

-- 
-ericP

Received on Tuesday, 1 June 2010 13:52:01 UTC