Skip to main content
Module

x/ldkit/mod.ts>QueryEngine

LDkit - Linked Data query toolkit for TypeScript developers
Latest
class QueryEngine
implements IQueryEngine
import { QueryEngine } from "https://deno.land/x/ldkit@2.0.0/mod.ts";

A query engine that can query a SPARQL endpoint.

Implements IQueryEngine interface.

This engine is used by default if no other engine is configured. See Options for more details.

If you need to query other data sources, or multiple SPARQL endpoints, you can use Comunica instead, extend this engine, or implement your own.

Methods

protected
getFetch(context?: QueryContext): fetch
protected
getSparqlEndpoint(context?: QueryContext): string
protected
query(
query: string,
responseType: string,
context?: QueryContext,
): Promise<Response>
protected
queryAndResolve<T extends ResolverType>(
type: T,
query: string,
context?: QueryContext,
)
queryBindings(query: string, context?: QueryContext): Promise<RDF.ResultStream<RDF.Bindings>>

Executes a SPARQL SELECT query and returns a stream of bindings.

queryBoolean(query: string, context?: QueryContext): Promise<boolean>

Executes a SPARQL ASK query and returns a boolean result.

queryQuads(query: string, context?: QueryContext): Promise<RDF.ResultStream<RDF.Quad>>

Executes a SPARQL CONSTRUCT query and returns a stream of quads.

queryVoid(query: string, context?: QueryContext): Promise<void>

Executes a SPARQL UPDATE query and returns nothing.