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

Re: sample query involving disjunction

From: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
Date: Mon, 20 Sep 2004 08:39:36 +0100
To: public-rdf-dawg@w3.org
Message-ID: <20040920073936.GB3366@login.ecs.soton.ac.uk>

On Sun, Sep 19, 2004 at 02:07:05 +0100, Andy Seaborne wrote:
> >Using a capability for multiple queries in the same request
> >that would simply be
> >
> >SELECT ?X
> >WHERE  {?X a :Person . ?X a :DogOwner}
> >
> >SELECT ?X
> >WHERE  {?X a :Person . ?X :hasPet ?Y . ?Y a :Dog}
> >
> >
> >returning
> >(:Eddie) a q:Answer. 
> >(:Mitch) a q:Answer. 
> >
> >
> 
> Jos - right! - this is the way I have implemented it, like "UNION ALL" in
> SQL (no duplicate suppression).
> 
> For a query of the form of "A & ( B | C )" (shared pattern A) some
> combined query can do better than the expansion "(A&B) | (A&C)" but this
> is in the realm of compiler techniques and it would be quite
> easy to spot common patterns across the two queries because they have to
> use the same variable names.
> 
> In the local case, one query or two is, maybe, not significant.  Across
> the web it is significant: either the client needs to send two parallel
> requests (client libraries raely do provide async I/O by default) or incur
> additional latency by serialised issuing of the requests.  And the query
> engine isn't given information it might use to optimize with.

Not neccesarily, the client can issue the two queries in one request, for
eg. seperated by ;'s.

- Steve
Received on Monday, 20 September 2004 07:39:43 GMT

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