Thanks for you answer Tommaso. But somehow I sense that this is not the right solution for me. This is for a few reasons: 1) A UnionMGraph constructor needs all (sub) Graphs in advance. I could not find a way to dynamically add another graph after construction. As a result I have to recreate the union every time after a new named graph is created. 2) The graph name is lost when added to the union. 3) If I am correct a UnioinMGraph is treated as a single graph. Somehow I fear that using queries on the UnionMGraph do not take the sparql GRAPH keyword into account properly. 4) Creating unions all the time does not seem to scale very well. In my case I will have a large number of named graphs.
Looking at Apache Jena, I read the following: "An RDF Dataset <http://www.w3.org/TR/sparql11-query/#rdfDataset> is a collection of one, unnamed, default graph and zero, or more named graphs. In a SPARQL query, a query pattern is matched against the default graph unless the GRAPH keyword is applied to a pattern." ( http://jena.apache.org/documentation/tdb/datasets.html ) According to CLEREZZA-467 it seams this Jena feature is lost when using Clerezza's sparql capabilities. The way I see it, and please correct me if I am wrong, I have the following options: 1) Go native Jena for doing queries over named graphs. According to CLEREZZA-467 I probably have to go native as well for storing graphs. This is due to MGraphs being stored in isolated datasets. In my case this is almost equal to abondoning clerezza. 2) Wait for sparql fastlane, CLEREZZA-468, to be completed. Is anyone actually working on this? Besides I do not have the luxury to wait :-( 3) Start working on sparql fastlane. For this I fear the amount of work heading my way, but more importantly the amount of time it would take. Does anyone have a vague idea how much time this would take? I favour option 3 but am afraid that I will end up with option 1 :-( Are there any other options? Related Jira issues: https://issues.apache.org/jira/browse/CLEREZZA-466 https://issues.apache.org/jira/browse/CLEREZZA-467 https://issues.apache.org/jira/browse/CLEREZZA-468 Regards, Minto Op 8-1-2013 8:53, Tommaso Teofili schreef: > 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 <[email protected]> > >> 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
