1

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?

mschenk74
  • 3,561
  • 1
  • 21
  • 34
  • Question also asked on [OpenLink's support forums](http://boards.openlinksw.com/phpBB3/viewtopic.php?f=12&t=6342). – TallTed Jul 07 '14 at 19:34
  • @Tallted Yes, I also posted it in the support forum but the answer there took longer than my own research and the answer there is more like a workaround since it requires using vendor specific libs. – mschenk74 Jul 07 '14 at 19:40

1 Answers1

2

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.

mschenk74
  • 3,561
  • 1
  • 21
  • 34