incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reto Bachmann-Gmuer <reto.bachm...@trialox.org>
Subject Re: SPARQL query performance/scalability
Date Tue, 15 Jun 2010 12:57:55 GMT
On Tue, Jun 15, 2010 at 1:32 PM, Bertrand Delacretaz <bdelacretaz@apache.org
> wrote:

> How should I apply a sparql query to the complete set of triples of a
> given TcManager efficiently?
>
> IIUC it's something like
>
>  MGraph defaultGraph = new UnionMGraph(...)
>  ResultSet rs = tcManager.executeSparqlQuery(query, defaultGraph);
>
> but I'm not sure what the defaultGraph exactly means - could I use
> null if the sparql query contains a FROM clause, and would that be
> better?
>
> The default graph in section 8.2.1 of the sparql spec, it can be defined
with a FROM clause, if there is no such clause in the query the one passed
to the method is used. So yes it should be possible to set that argument to
null. A query may also provide multiple FROM clauses yielding to the same
result as with the union graph.

Performance-wise it should make no difference, but with the implementation
of the fastlane the approach with the from-clause(s) is potentially more
performant.


> >
> > The clerezza sparql endpoint doesn't need to have the triples in memory.
> You
> > can have a UnionGraph of multiple graphs even from different backends
> > without any data actually being copied around...
>
> Ok, so I guess what I'm missing is how to construct that UnionGraph
> efficiently, while allowing all triples to be queried.
>
> new UnionMGraph(tcm.getGraph(x), tcm.getGraph(y),....)

reto

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message