- From: David Booth <david@dbooth.org>
- Date: Thu, 23 Feb 2012 17:37:18 -0500
- To: carsten.kessler@uni-muenster.de
- Cc: Michael Brunnbauer <brunni@netestate.de>, public-lod@w3.org, Chad Hendrix <hendrix@un.org>
Hi Carsten,
On Thu, 2012-02-23 at 22:09 +0100, Carsten Keßler wrote:
[ . . . ]
> So we'd have to do (assuming all graph metadata are stored in the same graph):
>
> select ?s ?p ?o where {
> graph ?g1 { ?g <http://xmlns.com/foaf/0.1/maker>
> <http://www.brunni.de/foaf.rdf#me> .
> ?g2 <http://xmlns.com/foaf/0.1/maker>
> <http://www.brunni.de/foaf.rdf#me> .
> }
>
> graph ?g { ?s :p1 ?o .}
>
> graph ?g2 { ?s :p2 ?o .}
>
> }
>
> That's what I was planning for – not nice, but I could live with that.
> Or does that query imply ?g != ?g2 ? This would not get us the results
> where both triples happen to be in the same named graph, which would
> be a problem…
That does not imply that ?g != ?g2, so it should work fine. But I hope
you now see where this is going. Essentially, you have used a clause
like
?gN <http://xmlns.com/foaf/0.1/maker>
<http://www.brunni.de/foaf.rdf#me> .
instead of a "FROM NAMED" clause, so if you have N graphs, then you'll
need N of these clauses. But even worse, depending on how the SPARQL
server optimizes your query, it is very likely to get into a
combinatorial problem.
So again, that approach may be fine for some cases, but I don't think it
would be satisfying as a general approach.
--
David Booth, Ph.D.
http://dbooth.org/
Opinions expressed herein are those of the author and do not necessarily
reflect those of his employer.
Received on Friday, 24 February 2012 14:10:01 UTC