[Mulgara-dev] ITQL

Seaborne, Andy andy.seaborne at hp.com
Mon Jul 14 08:45:27 UTC 2008



> -----Original Message-----
> From: mulgara-dev-bounces at mulgara.org [mailto:mulgara-dev-
> bounces at mulgara.org] On Behalf Of Paul Gearon
> Sent: 12 July 2008 22:18
> To: Mulgara Developers
> Subject: Re: [Mulgara-dev] ITQL
>
> On Sat, Jul 12, 2008 at 3:51 PM, Seaborne, Andy <andy.seaborne at hp.com>
> wrote:
> >> > Just query with
> >> >
> >> > SELECT ?g { GRAPH ?g { ?s ?p ?o } }
> >> >
> >> > All names of graphs.
> >>
> >> It's interesting you would say this. I wondered about this in the
> >> past, and wasn't satisfied that it was allowed. Also, when I wrote my
> >> email this morning, then I looked it up again (so I didn't look like
> >> an idiot - as I am wont to do) and again, I wasn't satisfied that it
> >> was allowed.
> >
> > Paul,
> >
> > Examples can't be exhaustive!  We tried to put in as much as we could but
> not every single case can be an example.
>
> Sure. I suppose I was expecting this one to be in there, as I was
> trying to work out how to implement it. From that perspective it
> looked like an obvious one that was missing. I didn't see any
> discussion on the point either, so I made the (incorrect) call that it
> wasn't allowed.
>
> > There are tests in the test suite: graph/graph-02 to -09 or thereabouts
> >
> > Section 12 gives the definition of the evaluation of a graph pattern.
>
> I take it that 12.5 is the area of most relevance here? Specifically,
> the definition of:
>   eval(D(G), Graph(var,P)) = .....
> ???

Yes - that's it: the example in section 8.3.4 is:

  1 PREFIX  dc:   <http://purl.org/dc/elements/1.1/>
  2 PREFIX  foaf: <http://xmlns.com/foaf/0.1/>
  3
  4 SELECT  ?name ?mbox ?date
  5 WHERE
  6   { ?g  dc:publisher  ?name ;
  7         dc:date       ?date .
  8     GRAPH ?g
  9       { ?person  foaf:name  ?name ;
 10                  foaf:mbox  ?mbox .
 11       }
 12   }

which is the algebra expression:

  1 (base <file:///c:/home/afs/Q.rq>
  2   (prefix ((dc: <http://purl.org/dc/elements/1.1/>)
  3            (foaf: <http://xmlns.com/foaf/0.1/>))
  4     (project (?name ?mbox ?date)
  5       (join
  6         (BGP
  7           (triple ?g dc:publisher ?name)
  8           (triple ?g dc:date ?date)
  9         )
 10         (graph ?g
 11             (BGP
 12               (triple ?person foaf:name ?name)
 13               (triple ?person foaf:mbox ?mbox)
 14             ))
 15         ))))

And being a applicative-order evaluation (graph ?g ... ) is evaluated as in 12.5 " Evaluation of a Graph Pattern " then participates in the join.  That ?g is unconstrained at the point of evaluating the (graph ...).

D, the dataset, can come from the protocol, the query or the execution environment (in that order of priority).

        Andy


More information about the Mulgara-dev mailing list