On 08/01/13 15:05, Minto van der Sluis wrote:
Hi Reto,

Thanks for your answer.

It's not that I want to merge multiple named graphs together to perform
a query. I already achieved that as a workaround by adding new triples
to both a named graph and a default graph. Like this I can query the
default graph.

What I actually try to achieve is find all named graphs the meet certain
requirements. For instance the following simple query to return then
names of all named graph.

|SELECT DISTINCT ?g
WHERE {
   GRAPH ?g {
     ?s ?p ?o
   }
}|


a better query is:

SELECT ?g { GRAPH ?g {} }

        Andy



This query contains no FROM clause. So I guess the supplied graph
(second argument) is still used.

The workaround I currently use is satisfactory for the time being, but
does not meet the requirements I have for the near future. So I have to
come up with something one way or another.

Regards,

Minto

Op 8-1-2013 14:16, Reto Bachmann-Gmür schreef:
Hi Minto,

The defaultGraph passed as second argument is ignered if a FROM clause is
present in your query, otherwise this is used as default Graph and other
graphs can be access using "FROM NAMED".

If you want to rund your query about afainst the union of several graphs
you should use UnionMGraph as Tommaso pointed out. If this is your usecase
we should keep this in mind for the fast-lane to be implemented.

Cheers,
Reto

On Tue, Jan 8, 2013 at 8:53 AM, Tommaso Teofili
<tommaso.teof...@gmail.com>wrote:

Hi Minto,

I think that you should use a union graph (UnionMGraph) over your
underlying named graphs and that should work as expected.

I hope this helps,
Tommaso


2013/1/6 Minto van der Sluis <mi...@xup.nl>

Hi folks,

Currently I am using clerezza with a Jena TDB storage backend to store
multiple named graphs.

Now I wonder how to perform a query over these named graphs. I can use
the following command:

     TcManager.executeSparqlQuery( query, ? )

But what should be used as the triple collection? If the default graph,
how do I specify that?

Regards,

Minto van der Sluis
Software innovator / renovator
Xup BV




Reply via email to