user1754019
user1754019

Reputation: 21

Jena ARQ querying local N3 datastore returns no results. ARQ command line works

I have a problem with Jena ARQ that maybe you could help me with. I have a local N3 file and I want to do a select on it using ARQ from Java. problem is that I get 0 results back.

This is the code I use:

FileManager.get().addLocatorClassLoader(SomeClass.class.getClassLoader());
Model model = FileManager.get().loadModel("props/temp.n3");
QueryExecution qexec = QueryExecutionFactory.create(query, model);
queryResultSet = qexec.execSelect();

...

I have full logging turned on (not shown above) but it doesn't report any error.

Now, the funny thing is that if I try the command line version of arq I get results. So it's not a problem with the query. I've tried creating FileManagers, Datasets and LocationMappings but to no avail. I've even debugged the arq command line utility to see where all the parameters are put together to create the query execution object but I didn't get far. I'm out of ideas. Any clues? I know it must be something in the creation of the query execution object. I'm using the latest version of ARQ (2.9.3).

model.size()  

reports 173.

Query:

SELECT *

WHERE {
    ?Node ?property ?object .  

}  

Upvotes: 2

Views: 183

Answers (1)

Ian Dickinson
Ian Dickinson

Reputation: 13315

Two pieces of information would be helpful: log the result of model.size(), and show us your query. Basically, your code looks OK, so either the data in your model is not what you expect, or there is a problem with the query, notwithstanding the fact that it runs from the command line.

Upvotes: 0

Related Questions