Re: RDF vocabulary for relational algebra

* Richard Cyganiak <richard@cyganiak.de> [2014-01-15 08:29+0000]
> SPIN defines an RDF representation for SPARQL queries. It's SPARQL-specific though, and not as abstract as relational algebra.

The spin:Triples in the spin:ElementList have exactly three slots (s,p,o) where you'd want n.

SPIN uses an n-ary join implied by membership in a spin:ElementList (and I don't know how to nest one inside another without the full ceremony of a subquery).

If you converted the SQL operators like JOIN to an n-ary analog, you'd still have to:

- either invent some indentifier for NULL which didn't unify with itself (NULL=NULL fails in SQL, NULL doesn't exist in SPARQL) or invent your own join anyways.

- rename all of the column names so there is not intersection and implement the JOIN ON tests (e.g. JOIN ON a.c1=b.c2 AND a.c3=b.c4) as FILTERs, (or rename all column equivalences to have the same variable names and let SPARQL join do it for you).

If you roll your own, you could still use SPIN's n-ary join semantics which make all of the SPARQL graph operators be something that you can add to a join constraint vs. their usual definition as a binary tree. It would be pretty trivial to apply this to SQL operators:

    JOIN(t1, t2, MINUS(t3), OUTER(t4))
  vs.
    OUTER(MINUS(JOIN(t1, t2), t3), t4)




> Richard
> 
> [1] http://spinrdf.org/
> 
> 
> > On 15 Jan 2014, at 08:20, Miguel <miguel.ceriani@gmail.com> wrote:
> > 
> > Hi,
> > I'm not aware of such a vocabulary but I'm interested in the problem too.
> > 
> > As a syntax to represent the SPARQL algebra (that seems to me a subset of your problem), Jena provides SSE[1].
> > SSE could be mapped to a RDF vocabulary (there is also a SSE-to-RDF mapping in [2] but it doesn't convey semantics cause everything is represented as lists).
> > 
> > Best,
> > Miguel
> > 
> > [1] http://jena.apache.org/documentation/notes/sse.html
> > [2] http://jena.apache.org/documentation/notes/sse.html#mapping-to-rdf
> > 
> > 
> >> On Wed, Jan 15, 2014 at 5:52 AM, Paul Tyson <phtyson@sbcglobal.net> wrote:
> >> Does anyone know of a published RDF vocabulary for relational algebra
> >> concepts and operators?
> >> 
> >> Use case is for abstract specification of a query, which could be cast
> >> into SQL, SPARQL, or some other RA implementation language.
> >> 
> >> Regards,
> >> --Paul
> > 

-- 
-ericP

office: +1.617.599.3509
mobile: +33.6.80.80.35.59

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

There are subtle nuances encoded in font variation and clever layout
which can only be seen by printing this message on high-clay paper.

Received on Wednesday, 15 January 2014 15:00:22 UTC