SparqlService
sparql
Service for querying a SPARQL endpoint.
new SparqlService(configuration);
Param | Type | Details |
---|---|---|
configuration | Objectstring | object or the SPARQL endpoit URL as a string. The object has the following properties:
|
var endpoint = new SparqlService({ endpointUrl: 'http://dbpedia.org/sparql', usePost: false }); // Or using just a string parameter: endpoint = new SparqlService('http://dbpedia.org/sparql'); var qry = 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> '; 'SELECT * WHERE { ' + ' ?id a <http://dbpedia.org/ontology/Writer> . ' + ' OPTIONAL { ?id rdfs:label ?label . } ' + '}'; var resultPromise = endpoint.getObjects(qry);