Class: QueryPayload

(abstract) QueryPayload()

Base class from which all query payload classes derives. Subclasses must implement #getSupportedContentTypes and may override #validatePayload if additional validation is needed according to the subclass.

Constructor

(abstract) new QueryPayload()

Does basic initialization.

Author:
  • Mihail Radkov
  • Svilen Velikov
Source:

Members

contentType :string

Holds the content type value to be used in the request to the query endpoint. This value will be set as the HTTP 'Content-Type' header when sending the request. The value is one of the QueryContentType enum values.

Type:
  • string
Source:

params :Object

Holds common request parameters applicable to the query endpoint.

Type:
  • Object
Source:

query :string|undefined

Holds the SPARQL query to be used in the request to the query endpoint.

Type:
  • string | undefined
Source:

Methods

getContentType() → {string}

Source:
Returns:

content type which was populated in this payload. The value is one of the QueryContentType enum values.

Type
string

getParams() → {Object}

Source:
Returns:

the query payload that contains all parameters.

Type
Object

getQuery() → {string}

Retrieves the current SPARQL query string.

Source:
Returns:

The currently set SPARQL query string.

Type
string

setContentType(contentTypeopt) → {QueryPayload}

An optional parameter which is used for defining the request Content-Type.

Parameters:
Name Type Attributes Description
contentType string <optional>

The value is one of the QueryContentType enum values.

Source:
Returns:
Type
QueryPayload

setInference(inferenceopt) → {QueryPayload}

Parameters:
Name Type Attributes Description
inference boolean <optional>

Specifies whether inferred statements should be included in the query evaluation.

Source:
Returns:
Type
QueryPayload

setQuery(query) → {QueryPayload}

Sets the SPARQL query string to be used.

Parameters:
Name Type Description
query string

The query string to set.

Source:
Returns:
Type
QueryPayload

setTimeout(timeoutopt) → {QueryPayload}

Parameters:
Name Type Attributes Description
timeout number <optional>

Specifies a maximum query execution time, in whole seconds.

Source:
Returns:
Type
QueryPayload

validatePayload()

Validates payload for mandatory and invalid parameters.

Source:
Throws:

if the payload is misconfigured

Type
Error