mschenk74
mschenk74

Reputation: 3591

Enable Reasoning for SPARQL request via Jena?

Problem environment:

I have to access some RDF data stored in a virtuoso server via SPARQL. Reasoning has to be enabled for that graph I want to access. On the client side jena 2.11.x has to be used.

Now the problem:

To enable reasoning I have to add the line define input:inference „http://examplegraphIRI“ as first line of the SPARQL query according to http://docs.openlinksw.com/virtuoso/rdfsparqlrule.html. If I use Jena QueryExecutionFactory to execute the Query, it will be rejected since ARQ cannot parse the given line.

Now the questions:

Am I required to use the Virtuoso Jena Provider (http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtJenaProvider#Bypass%20Jena/ARQ%20parser)? Will it work for my problem (the latest version (http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VOSDownload#Jena%20Provider) states it is intended for jena 2.10.x)?

Are there other possibilities to enable reasoning for a SPARQL endpoint?

Upvotes: 1

Views: 403

Answers (1)

mschenk74
mschenk74

Reputation: 3591

I found the solution by browsing through the source-code of Jena and ARQ:

instead of using the final QueryEngineHTTP request = QueryExecutionFactory.createServiceRequest(String,Query) I could bypass the parser by using final QueryEngineHTTP request = new QueryEngineHTTP (this.endpoint, fullQueryString) directly.

Upvotes: 2

Related Questions