I'm having strange behaviour with QueryExecution create(Query query, Model model)
I created a named model and add triples to it as follows
Dataset ds = dg.toDataset();
ds.addNamedModel("urn:x-arq:LearningRecord", ModelFactory.createDefaultModel());
Model model = ds.getNamedModel("urn:x-arq:LearningRecord");
\\ read triples into model
Now, using Mark Logic query console, I can confirm that has been created with triples in it.
But now if I query with QueryExecutionFactory like this
I'm having strange behaviour with QueryExecution create(Query query, Model model)
I created a named model and add triples to it as follows
Now, using Mark Logic query console, I can confirm that has been created with triples in it.
But now if I query with QueryExecutionFactory like this
then
resultSet.hasNext() is false
But if I query without getNamedModel like thisthen I can retrieve expected results. From IntelliJ debugger, I can also see that is part of the DatasetGraph
Is it possible to query triples in a specific named model? seems like the query will return triples from the union of all models.
FYI, Jena or Virtuoso doesn't have such issue.
Thanks