2

I am trying to specify a configuration file that sets up a SPARQL endpoint in dotNetRDF. Before integrating it in an application, I am testing the configuration file by loading it to run a local server in the rdfServer GUI tool and then trying to access that server from the Store Manager tool, both from the dotNetRDF Tools (though that shouldn't be relevant to the issue).

I am following the manual by using the minimal configuration code for setting up a SPARQL handler:

@prefix dnr: <http://www.dotnetrdf.org/configuration#> .

<dotnetrdf:/sparql> a dnr:HttpHandler ;
  dnr:type "VDS.RDF.Web.QueryHandler" ;
  dnr:queryProcessor _:proc .

_:proc a dnr:SparqlQueryProcessor ;
  dnr:type "VDS.RDF.Query.LeviathanQueryProcessor" ;
  dnr:usingStore _:store .

_:store a dnr:TripleStore ;
  dnr:type "VDS.RDF.TripleStore" .

The documentation says:

This specifies configuration for a Handler which responds to requests on the URI /sparql by providing a SPARQL Query endpoint.

I load this configuration and run it on localhost:1987. However, when trying to access it as described, by sending a simple query (SELECT * WHERE { ?a ?b ?c . } LIMIT 10) to http://localhost:1987/sparql without a default graph, the log output from the server invariably contains the remark:

ERROR There are No Handlers registered which can process this request


I have also tried building on top of the provided example by loading a graph from a local file, taking into account the information on how to define a graph from the respective manual page (for the sake of the test, by loading the pizza ontology, the file of which I have placed in the same directory as the configuration file):

@prefix dnr: <http://www.dotnetrdf.org/configuration#> .

<dotnetrdf:/graph> a dnr:HttpHandler ;
  dnr:type "VDS.RDF.Web.QueryHandler" ;
  dnr:queryProcessor _:proc .

_:proc a dnr:SparqlQueryProcessor ;
  dnr:type "VDS.RDF.Query.LeviathanQueryProcessor" ;
  dnr:usingStore _:store .

_:store a dnr:TripleStore ;
  dnr:type "VDS.RDF.TripleStore" ;
  dnr:usingGraph <http://example.org/graph> .

<http://example.org/graph> a dnr:Graph ;
  dnr:type "VDS.RDF.Graph" ;
  dnr:fromFile "pizza.owl" .

I have tried the following variants of sending the aforementioned simple query:

  1. http://localhost:1987/graph (because that seemed like the logical choice based on the bit of the configuration saying <dotnetrdf:/graph>)
  2. http://localhost:1987/graph/sparql (in case the sparql suffix gets automatically added after the configured URL)
  3. http://localhost:1987/sparql (in case the sparql suffix actually replaces the graph-specific URL for some reason)

I tried all of these without a default graph, and with http://example.org/graph as the default graph.

For 2) and 3), I got the same result as above:

ERROR There are No Handlers registered which can process this request

For 1), on the other hand, the server says:

ERROR Unexpected error from Handler VDS.RDF.Utilities.Server.SparqlServerHandler

The fact the 1) yields a different message somehow makes it look like I'm on the right track for the URL there, but it still does not provide me with any hint on how to properly set up the configuration file.


How can I configure a simple SPARQL endpoint for a graph loaded from a local file?

Is there some kind of a minimal configuration example somewhere?

1
  • It looks like this might be a bug in rdfServer and not anything wrong with your configuration per-se
    – RobV
    Jun 1, 2015 at 9:55

1 Answer 1

1

So the cause of the problem is partly a documentation failure and partly a bug in rdfServer.

rdfServer is much more limited than our ASP.Net integration and only supports configuring SPARQL Servers. However it fails to inform you of this and tries to configure SPARQL servers anyway for any defined HTTP Handlers in your configuration file. This causes the failures you see when trying to access the handler because SPARQL Servers make some assumptions about how they are accessed.

The primary assumption is they are mapped to a wildcard path so you need to have a URI of the form <dotnetrdf:/path/*> as your subject for your HTTP handler declaration like so:

@prefix dnr: <http://www.dotnetrdf.org/configuration#> .

<dotnetrdf:/sparql/*> a dnr:HttpHandler ;
  dnr:type "VDS.RDF.Web.SparqlServer" ;
  dnr:queryProcessor _:proc .

_:proc a dnr:SparqlQueryProcessor ;
  dnr:type "VDS.RDF.Query.LeviathanQueryProcessor" ;
  dnr:usingStore _:store .

_:store a dnr:TripleStore ;
  dnr:type "VDS.RDF.TripleStore" .

If you change your configuration to do this it will then allow you to access the endpoints at /sparql/query and /sparql/update. Note that the SPARQL Graph Store Protocol is not supported via rdfServer.

We'll make sure future versions of rdfServer enforce these restrictions more clearly and give appropriate error messages when trying to use unsupported configurations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.