Hi,
I create a dataset with a unnamed default model and a named model
mDataset = TDBFactory.createDataset(tdbDirectory);
mDefaultModel = mDataset.getDefaultModel();
mDefaultModel = FileManager.get().loadModel(coreOntologyFile);
Model rtmodel = FileManager.get().loadModel("ontology/data1221.rdf");
if (mDataset.containsNamedModel("r1221"))
{
mDataset.getNamedModel("r1221");
} else {
mDataset.getDataSet().addNamedModel("rt1221", rtmodel);
}
>From what I read, passing a dataset and not specifying "FROM NAMED" in the
sparql query, should query both the unnamed model and named model, but it
only queries the default data set, e.g.
QueryExecution qe1 = QueryExecutionFactory.create( "SELECT * WHERE { ?s ?p
?o }", mDataset );
only returns data from the defaultmodel, unless if I explicitly pass the
named model
QueryExecution qe1 = QueryExecutionFactory.create( "SELECT * WHERE { ?s ?p
?o }", mDataset.getNamedModel("r1221") );
then I get triples from the named model. Adding FROM NAMED <e1221>
"SELECT * FROM NAMED <r1221> WHERE { ?s ?p ?o> }", mDataset
Does not help. Has anyone had the same problem?
best
J