On 11/06/13 16:06, Andy Seaborne wrote:
On 10/06/13 21:52, Cindy A McMullen wrote:
I'm using the in-memory Jena implementation (not TDB).  How do I
query across the union of named graphs?

Union of named graphs is really a feature of the storage and not as
uniformly treated as I would like.

For an in-memory dataset, this works:

     Graph g = GraphView.createNamedGraph(dsg, Quad.unionGraph) ;
     Model m = ModelFactory.createModelForGraph(g) ;

If you are using a DatasetGraph.createMem, this works:

    Dataset ds = DatasetFactory.createMem() ;
    Graph g = GraphView.createNamedGraph(dsg, Quad.unionGraph) ;
    Model m = ModelFactory.createModelForGraph(g) ;
    ds.setDefaultModel(m) ;

although you don't have the original default model around anymore.


(latest version)

It'll work on on any dataset, maybe not optimally though (but not bad
either).

     Andy

Reply via email to