Skip to main content

Interface: SparqlDataProviderOptions

Options for SparqlDataProvider.

See

SparqlDataProvider

Properties

PropertyTypeDescription

chunk?

null | SparqlProviderChunkOptions

Chunk size to split each SPARQL request with multiple input IRIs into.

To disable batch splitting pass null.

Default is {maxSize: 2500, unit: 'totalLength'} when queryMethod is GET, otherwise null.

endpointUrl

string

SPARQL endpoint URL to send queries to.

factory?

DataFactory

RDF/JS-compatible term factory to create RDF terms.

imagePropertyUris?

readonly string[]

Element property type IRIs to use to get image URLs for elements.

If needed, image URL extraction can be customized via prepareImages.

prepareImages?

(elementInfo: Iterable<ElementModel>, signal: undefined | AbortSignal) => Promise<Map<ElementIri, string>>

Allows to extract/fetch image URLs externally instead of using imagePropertyUris option.

prepareLabels?

(resources: Set<string>, signal: undefined | AbortSignal) => Promise<Map<string, Literal[]>>

Allows to extract/fetch labels separately from SPARQL query as an alternative or in addition to label output binding.

queryFunction?

SparqlQueryFunction

Custom function to send SPARQL requests.

By default, a global fetch() is used with the following options:

{
...params,
credentials: 'same-origin',
mode: 'cors',
cache: 'default',
}

queryMethod?

"GET" | "POST"

Query method for SPARQL queries to use:

  • GET - more compatible, may have issues with large request URLs;
  • POST - less compatible, better on large data sets.

Default

"GET"