You can run SPARQL queries over a Dataset instance, you will need to first call DatasetFactory.create() passing your DatasetGraph instance in to wrap it as a Dataset and then call the QueryExecutionFactory.create() method as normal e.g.
// Assuming you already have a DatasetGraph in the variable dsg Dataset ds = DatasetFactory.create(dsg); // And assuming you have your query in the variable query QueryExecution qe = QueryExecutionFactory.create(query, deg); Rob On 28/05/2014 15:03, "Boris Pelakh" <[email protected]> wrote: >Hey, have a question regarding the quad api (DatasetGraph) > >I am inserting quads, and can retrieve them w/o problems (via find() or >iteration) > >But I want to run graph-aware SPARQL queries over the data > >How do I get a handle on a Model (or equivalent) that will let me do that? > >(obviously getDefaultModel() doesn't see any of the data in the named >graphs) > > > >By graph-aware queries I mean something like: > > > >select ?p ?o { GRAPH <http://updated/test> >{<http://model.com/people/Mike> ?p ?o . }} > > > >Thank you for your help, > >Boris >
