Query Class
Defined in:
src/sparql/query.js:10
The Query is the root object for all SPARQL requests
Constructor
Query
(
-
endpoint
Parameters:
-
endpoint
String- URL of the SPARQL endpoint
Item Index
Methods
addPrefix
(
-
content
Add a prefix to the query
Parameters:
-
content
Prefix | String | Array- A single Prefix string or object
base
(
-
content
Sets the base IRI
Parameters:
-
content
String- BASE string
clearDatasetClauses
()
Clear current dataset clauses
clearPrefixes
()
Remove all Prefixes from the Query
construct
(
Query
-
triples
Set the current query to CONSTRUCT
Parameters:
-
triples
Triple | Array- One or more Triples to be used for a DESCRIBE GraphPattern
Returns:
Query:
- Returns current instance (chainable)
describe
(
Query
-
content
Set the current query to DESCRIBE
Parameters:
-
content
String- Arguments given to the DESCRIBE statement
Returns:
Query:
- Returns current instance (chainable)
exec
()
Promise
Execute query
Returns:
Promise:
- Returns a Promise with will yield a Result object
from
(
Query
-
content
-
named
Set dataset clause
Parameters:
-
content
String | Array- One or more strings with dataset clauses (without FROM or NAMED)
-
named
Boolean- Optional flag to set clause to NAMED
Returns:
Query:
- Returns current instance (chainable)
getDatasetClauses
()
Array
Get current dataset clauses
Returns:
Array:
getPrefixes
()
Array
Get the Prefix objects of the Query
Returns:
Array:
limit
(
Query
-
count
Set limit for query
Parameters:
-
count
Number- Limit count
Returns:
Query:
- Returns current instance (chainable)
offset
(
Query
-
count
Set limit for offset
Parameters:
-
count
Number- Offset count
Returns:
Query:
- Returns current instance (chainable)
order
(
Query
-
content
Set order for query
Parameters:
-
content
String- Order string without ORDER BY
Returns:
Query:
- Returns current instance (chainable)
prefix
(
Query
-
content
Sets the prefix(es) for the query
Parameters:
-
content
Prefix | String | Array- A single Prefix string or object or an array of Prefix objects or strings
Returns:
Query:
- Returns current instance (chainable)
reset
()
Reset query (endpoint setting stays)
select
(
Query
-
content
-
modifier
Set the current query to SELECT
Parameters:
-
content
String- Arguments given to the SELECT statement
-
modifier
String- Optional modifier to be added (e.g. DISTINCT)
Returns:
Query:
- Returns current instance (chainable)
toString
(
String
-
isSubquery
Retrieves the SPARQL string representation of the current instance, adding the FILTER keyword.
Parameters:
-
isSubquery
Boolean- If set, skips the BASE and PREFIX parts for inclusion as a subquery
Returns:
String: