Class: GetQueryPayload

GetQueryPayload()

Payload object holding common request parameters applicable for the query endpoint and SPARQL query as well.

The SPARQL query and parameters "queryType" and "responseType" are mandatory

The content type parameter, which is used for setting the HTTP Content-Type header, can be one of the following:

  • application/x-www-form-urlencoded
  • application/sparql-query

Constructor

new GetQueryPayload()

Author:
  • Mihail Radkov
  • Svilen Velikov
Source:

Methods

addBinding(bindingopt, valueopt) → {GetQueryPayload}

Populates an optional $key:value binding in the payload. Existing bindings will be overridden.

Parameters:
Name Type Attributes Description
binding string <optional>

A variable binding name which may appear in the query and can be bound to a specific value provided outside of the actual query.

value string <optional>

A variable's binding value. See the binding comment

Source:
Throws:

if the binding or the value is not a string

Type
Error
Returns:
Type
GetQueryPayload

getQueryType() → {string}

Source:
Returns:

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

Type
string

getResponseType() → {string}

Source:
Returns:

response type which was populated in this payload.

Type
string

getSupportedContentTypes()

Source:

setDistinct(distinctopt) → {GetQueryPayload}

Parameters:
Name Type Attributes Description
distinct boolean <optional>

Specifies if only distinct query solutions should be returned.

Source:
Throws:

if the parameter is not a boolean

Type
Error
Returns:
Type
GetQueryPayload

setLimit(limit) → {GetQueryPayload}

Parameters:
Name Type Description
limit number

specifies the maximum number of query solutions to return.

Source:
Throws:

if the limit is not a non negative number

Type
Error
Returns:
Type
GetQueryPayload

setOffset(offsetopt) → {GetQueryPayload}

Parameters:
Name Type Attributes Description
offset number <optional>

Specifies the number of query solutions to skip.

Source:
Throws:

if the offset is not a non negative number

Type
Error
Returns:
Type
GetQueryPayload

setQueryLn(queryLnopt) → {GetQueryPayload}

Parameters:
Name Type Attributes Description
queryLn string <optional>

the query language that is used for the query.

Source:
Throws:

if the query language is not one of QueryLanguage

Type
Error
Returns:
Type
GetQueryPayload

setQueryType(queryType) → {GetQueryPayload}

A mandatory parameter used for resolving request headers and resolving the response parsers.

Parameters:
Name Type Description
queryType QueryType
Source:
Throws:

if the query type is not one of QueryType

Type
Error
Returns:
Type
GetQueryPayload

setResponseType(responseType) → {GetQueryPayload}

A mandatory parameter which is used for resolving the Accept http header required by the RDF store.

Parameters:
Name Type Description
responseType string
Source:
Throws:

if the response type is not one of RDFMimeType

Type
Error
Returns:
Type
GetQueryPayload

validatePayload()

Source: