Previous topic  Top  Next topic  Print this Topic
 

SPARQL Connectors

 

_sparqlaccess(<endpoint>, [default graphs], [named graphs], [map with output])

The lists of default and named graphs can be empty.

The output map is: [context->?C,subject->?S,predicate->?P,object->?O].

When working with _sparqlaccess, the SPAQRL query is generated automatically. If you set concrete values instead of variables in the output map, they are used as restrictions for the query. The default graph is imported as default module. Only SPARQL Protocol services with HTTP bindings (REST-like) are supported, no SOAP bindings.

Examples:

_sparqlaccess(<http://localhost:8267/services/sparql/query>, [<my:defaultGraph>], [<my:namedGraph>], [<context->?C,subject->?S,predicate->?P,object->?O>])

 

_sparqlaccess(<http://localhost:8267/services/sparql/query>, [], [], [<context->?C,subject->?S,predicate->?P,object->?O>])

 

_sparqlaccess(<http://dbpedia.org/sparql>, [<http://dbpedia.org>], [<http://dbpedia.org>], [context->?C, subject->?S, predicate-><http://xmlns.com/foaf/0.1/name>, object->?O])

_sparqlquery(<endpoint>, [default graphs], [named graphs], sparql query, [output map]).

The lists of default and named graphs can be empty. The output map must reference all variables occurring in the sparql query. Only SELECT queries are supported. Only SPARQL Protocol services with HTTP bindings (REST-like) are supported, no SOAP bindings.

Example:

_sparqlquery(<http://localhost:8267/services/sparql/query>, [<my:defaultGraph>], [<my:namedGraph>], "SELECT * {?s ?p ?o}", [<"?S"->?S, "?P"->?P, "?O"->?O>])