Adding SPARQL Endpoint Capabilities Interrogation to Virtuoso SPARQL-FED functionality

What?

Discover the capabilities of a SPARQL endpoint en route to enhancing SPARQL-FED usage from Virtuoso instances by granting special roles to "SPARQL".

Why?

Virtuoso service endpoints can interact with the Virtuoso compiler and in case of errors, for example when using SPARQL LOAD SERVICE <http://example.com/sparql> DATA , it can execute the appropriate LOAD SERVICE ... DATA by itself and retry the failed query.

How?

Adding SPARQL Endpoint Capabilities Interrogation to Virtuoso SPARQL-FED functionality can be achieved by:

  1. Granting ROLE privileges to the SPARQL user ;
  2. Using SPARQL-FED as per usual via SPARQL-Protocol, HTML based Query UI, or SPASQL.

Grant the SPARQL_LOAD_SERVICE_DATA ROLE privilege to the SPARQL user to enable the capabilities of external Virtuoso SPARQL endpoint to be determined by executing the following command from the Conductor or command line iSQL interfaces:


GRANT SPARQL_LOAD_SERVICE_DATA to "SPARQL" ;

Once executed when running SPARQL-FED queries the source SPARQL endpoint will interrogate the remote source en route to best understanding its capabilities for optimum execution of the SPARQL-FED queries. The "best effort" determination of capabilities is done by a combination of the following:

  1. Service Description Document
  2. SPARQL 1.1 queries.

The following curl command can be used to obtain the service description for a given SPARQL endpoint:


curl -iLH "Accept: text/turtle" http://linkeddata.uriburner.com/sparql

Example usage:

  1. Execute from iSQL:

    SQL> grant SPARQL_LOAD_SERVICE_DATA to "SPARQL"; Done. -- 3 msec. SQL> grant SPARQL_SPONGE to "SPARQL"; Done. -- 3 msec.

  2. From the http://host:port/sparql endpoint execute as an anonymous user the following query:

    SELECT DISTINCT ?Entity WHERE {SERVICE <http://dbmi-icode-01.dbmi.pitt.edu:8080/sparql> {SELECT * WHERE { ?Entity ?Relation ?EntityType} limit 50 } }

Related