On Tue, Jun 15, 2010 at 1:32 PM, Bertrand Delacretaz <[email protected] > 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
