The results as variable bindings, for a SELECT query.
Runs the query and writes its results to a file.
Where to write. Any existing file is overwritten.
Optionalopts: { compressed?: boolean }
Set compressed to gzip the output as it is written. Defaults to gzipping when
destinationPath ends in .gz.
The results of an ad-hoc SPARQL query, in whichever form the query asks for.
Remarks
Returned by Dataset.sparqlQuery and Service.sparqlQuery. Never constructed directly.
Nothing is sent until you pick a form:
bindings()for a SELECT,statements()for a CONSTRUCT or DESCRIBE,boolean()for an ASK, or toFile to write the results out. Asking for a form the query cannot answer in is rejected rather than coerced.Every failure arrives as a rejected promise from one of those, including a query that does not parse — obtaining this object never throws on its own.
Each form is a single request that returns the whole result set, so — unlike the paginated collections elsewhere in this library — this object can be used more than once, and every call runs the query again.
Example: Run a SELECT query against a dataset