SparqlEndpointResponseProvider

Creates a SPARQL Endpoint Provider which manages treating SPARQL endpoint responses and events for a specific SPARQL Endpoint. Also contains helper functions for manipulating RDF data.

Constructor

new SparqlEndpointResponseProvider(configSparqlServer)

Creates a SPARQL Endpoint Provider

Parameters:
NameTypeDescription
configSparqlServerobject

The sparqlModule configuration.

Properties
NameTypeDescription
urlstring

The SPARQL server url.

url_parametersstring

The SPARQL endpoint url parameters.

optionsobject

The default options to be sent in a fetch request header.

Classes

SparqlEndpointResponseProvider

Methods

getFetch(full_url, query, options) → {Promise.<Response>}

Get the fetch request in function of the SPARQL endpoint query type.

Parameters:
NameTypeDescription
full_urlstring

The full URL for the SPARQL endpoint.

querystring

The query content to be sent to the SPARQL endpoint.

optionsobject

optional fetch options.

Returns:

The fetch request.

Type: 
Promise.<Response>

getFullUrl(query) → {string}

Get the full URL for the SPARQL endpoint in function of the SPARQL endpoint query type.

Parameters:
NameTypeDescription
querystring

The query to be sent to the SPARQL endpoint.

Returns:

the full URL for the SPARQL endpoint.

Type: 
string

(async) querySparqlEndpointService(query, options) → {Promise.<object>|null}

Perform a SPARQL Query. Cache and return the response

Parameters:
NameTypeDescription
querystring

The query to be sent to the SPARQL endpoint.

optionsobject

optional fetch options

Returns:

If the request is not successful, it throws an error. If successful, it returns the request.

Type: 
Promise.<object> | null