W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2011

Re: Fed query ... more comments

From: Carlos Buil Aranda <cbuil@fi.upm.es>
Date: Wed, 27 Jul 2011 16:04:15 -0400
Message-ID: <CABdcz9Ej8hwzCZN=_SmQP4aWBudDFV_Lp1XtY6qKCz7m_jt_2w@mail.gmail.com>
To: "Polleres, Axel" <axel.polleres@deri.org>
Cc: public-rdf-dawg@w3.org
sorry Axel, I overlooked the email. I uploaded a new version with your
example. It is much clearer. I added BINDINGS ?s { (:b) (:c) }

Carlos

2011/7/26 Polleres, Axel <axel.polleres@deri.org>

> Hi Carlos, all,
>
> I wonder whether my comments in
>  http://lists.w3.org/Archives/Public/public-rdf-dawg/2011JulSep/0025.html
> were potentially overlooked?
>
> For convenience I post them again:
> I looked at the example in Section 2.6 of
> http://www.w3.org/2009/sparql/docs/fed/service.xml
> i.e.
> http://www.w3.org/2009/sparql/docs/fed/service.xml#bindings
>
> I assume that's the new part.
>
> Comments:
>
> 1) Firstly, I would suggest to rename the section from
>
>  2.6 BINDINGS
>
> to
>
>  2.6 Interplay of SERVICE and BINDINGS
>
> 2) Frankly, I am not sure the example is covers the intuition. In that
> example, I guess one would just write
>
> PREFIX : <http://example.org/>
> PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
> SELECT ?s ?o1 ?o2
> {
>  ?s ?p1 ?o1
>  OPTIONAL { SERVICE <http://example.org/sparql> {?s foaf:knows :b }}
> } }
>
> So, maybe it's just me who doesn't get BINDINGS, but I'd suggest, that the
> example is modified is follows:
>
>
> I would first add information in the default graph, stating that
> these are foaf:person. (just to avoid duplicate rows and make the result
> table simpler
>
>
> Data in default graph:
>
>  <http://example.org/a>  a <http://xmlns.com/foaf/0.1/Person> ;
>                          <http://xmlns.com/foaf/0.1/name>     "Alan" ;
>                          <http://xmlns.com/foaf/0.1/mbox>     "
> alan@example.org" .
>  <http://example.org/b>  a <http://xmlns.com/foaf/0.1/Person> ;
>                          <http://xmlns.com/foaf/0.1/name>     "Bob" ;
>                          <http://xmlns.com/foaf/0.1/mbox>     "
> bob@example.org" .
>  <http://example.org/c>  a <http://xmlns.com/foaf/0.1/Person> ;
>                          <http://xmlns.com/foaf/0.1/name>     "Alice" ;
>                          <http://xmlns.com/foaf/0.1/mbox>     "
> alice@example.org" .
>
>
> and then
>
> "The following example shows how SERVICE and BINDINGS are combined. The
> query asks for all foaf:Persons in the default graph and optionally
> obtaining their known people in the remote endpoint <
> http://example.org/sparql>.
>
> When the original query
>
> PREFIX : <http://example.org/>
> PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
> SELECT ?s ?o
> {
>  ?s a foaf:Person
>  OPTIONAL { SERVICE <http://example.org/sparql> {?s foaf:knows ?o }}
> } }
>
> is executed naively, with an unconstrained service call
>
>  SELECT * {?s foaf:knows ?o }
>
> to <http://example.org/sparql>, the endpoint may not return all results:
> many existing SPARQL endpoints have restrictions in the number of results
> they return and may miss the ones matching subjects ?s from the default
> graph.
>
> Thus, an implementation of a query planner for federated queries, may
> decide to decompose the query into two queries instead, where first the
> bindings from the default graph are evaluated:
>
> PREFIX : <http://example.org/>
> PREFIX foaf:   <http://xmlns.com/foaf/0.1/>
> SELECT ?s ?o1 ?o2
> {
>  ?s a foaf:Person
> }
>
> obtaining results for ?s :
>
>  +------+
>  |  ?s  |
>  +------+
>  |  :a  |
>  |  :b  |
>  |  :c  |
>  +------+
>
> and then, instead of issuing an unconstrained Query, dispatch the
> constrained query
>
>  SELECT * {?s foaf:knows ?o } BINDINGS ?s {  (:a) (:b) (:c) }
>
> to <http://example.org/sparql> .
>
>
>
>
> Does that make sense?
>
> Axel
>
> --
> Dr. Axel Polleres
> axel.polleres@deri.org    http://www.polleres.net/
>
>
Received on Wednesday, 27 July 2011 20:05:01 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:46 GMT