@metreeca/wire
    Preparing search index...

    SPARQL repository query, update and graph store operations.

    Groups the core operations: ask, select, and construct read from the backing RDF store, update writes to it through SPARQL Update requests, and merge and store write RDF data into a graph without going through SPARQL text. Repository extends this surface for standalone use; the same operations are also handed to a task as the per-call client inside execute, where they run within the enclosing transaction.

    interface RepositoryClient {
        ask(query: string, dataset?: Dataset): Promise<boolean>;
        select(query: string, dataset?: Dataset): Promise<readonly Tuple[]>;
        construct(query: string, dataset?: Dataset): Promise<readonly Triple[]>;
        update(update: string, dataset?: Dataset): Promise<void>;
        merge(triples: readonly Triple[], graph?: string): Promise<void>;
        store(triples: readonly Triple[], graph?: string): Promise<void>;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Execute an ASK query.

      Parameters

      • query: string

        The SPARQL ASK query

      • Optionaldataset: Dataset

        The Dataset to query, overriding the FROM and FROM NAMED clauses of query; when omitted, query runs against the dataset it declares, or against the default dataset of the backend

      Returns Promise<boolean>

      A promise resolving to the boolean query result

    • Execute a SELECT query.

      Parameters

      • query: string

        The SPARQL SELECT query

      • Optionaldataset: Dataset

        The Dataset to query, overriding the FROM and FROM NAMED clauses of query; when omitted, query runs against the dataset it declares, or against the default dataset of the backend

      Returns Promise<readonly Tuple[]>

      A promise resolving to the solution tuples, in solution-sequence order

    • Execute a CONSTRUCT query.

      Parameters

      • query: string

        The SPARQL CONSTRUCT query

      • Optionaldataset: Dataset

        The Dataset to query, overriding the FROM and FROM NAMED clauses of query; when omitted, query runs against the dataset it declares, or against the default dataset of the backend

      Returns Promise<readonly Triple[]>

      A promise resolving to the constructed RDF triples

    • Execute a SPARQL UPDATE operation.

      Warning

      A dataset is admitted only for updates declaring none of their own: SPARQL 1.1 Protocol forbids combining it with USING, USING NAMED or WITH clauses, and the backend rejects such a request with its own error.

      Parameters

      • update: string

        The SPARQL UPDATE request

      • Optionaldataset: Dataset

        The Dataset matched by the WHERE clauses of update; when omitted, update runs against the dataset it declares, or against the default dataset of the backend

      Returns Promise<void>

    • Merge triples into a graph.

      Adds triples to the graph content, keeping the statements already there. Blank nodes in triples are kept apart from those already in the store, as in an INSERT DATA update, so they never correlate with existing nodes. Merging an empty array leaves the store unchanged, creating no named graph either.

      Parameters

      • triples: readonly Triple[]

        The RDF triples to add

      • Optionalgraph: string

        The IRI of the target named graph, created if missing; when omitted, the default graph

      Returns Promise<void>

    • Store triples as the content of a graph.

      Replaces the graph content with triples, discarding the statements already there. Blank nodes in triples are kept apart from those already in the store, as in merge. Storing an empty array leaves the graph empty, while the other graphs of the store are never affected.

      Parameters

      • triples: readonly Triple[]

        The RDF triples making up the new graph content

      • Optionalgraph: string

        The IRI of the target named graph, created if missing; when omitted, the default graph

      Returns Promise<void>