@metreeca/wire
    Preparing search index...

    Module @metreeca/wire-sparql-rdf4j - v0.12.0

    RDF4J REST API endpoint connector for the @metreeca/wire storage connector collection.

    Exposes any RDF4J Server repository through the common Repository API, bracketing each task in a server-managed transaction and applying optional inference and timeout settings.

    Important

    Transaction Isolation — Determined by the target RDF4J repository.

    @metreeca/wire-sparql-rdf4j

    npm

    SPARQL connector for @metreeca/wire backed by an RDF4J Server repository.

    Exposes any RDF4J Server repository through the common @metreeca/wire-sparql Repository interface, bracketing each task in a server-managed transaction. One-off operations outside a transaction are delegated to the SPARQL 1.1 Protocol through the companion @metreeca/wire-sparql-http connector.

    Installation

    npm install @metreeca/wire-sparql         # the SPARQL query API
    npm install @metreeca/wire-sparql-rdf4j # this connector
    Warning

    TypeScript consumers must use "moduleResolution": "nodenext"/"node16"/"bundler" in tsconfig.json. The legacy "node" resolver is not supported.

    Usage

    Connect to an RDF4J Server repository with createRDF4JRepository, then issue queries and updates through the @metreeca/wire-sparql Repository API:

    import { createRDF4JRepository } from "@metreeca/wire-sparql-rdf4j";

    const repository = createRDF4JRepository({
    server: "https://example.org/rdf4j-server",
    repository: "my-repo"
    });

    The optional infer and timeout settings apply to every operation: infer: false restricts operations to explicit statements, and timeout bounds the execution time of each operation, in seconds. RDF4J Server ignores timeout on updates issued within an execute task, so an update that needs a time bound has to run outside a transaction.

    See @metreeca/wire-sparql for the Repository API: ask, select and construct query the store, update, merge and store write to it, and execute and close manage transactions and resources.

    Important

    This connector defers transaction isolation to the configured RDF4J repository: server-managed transactions bracket each task for atomic commit and rollback, achieving the isolation level of the underlying store (RDF4J's MemoryStore and NativeStore both default to SNAPSHOT_READ). The REST API exposes no isolation-level parameter on the start-transaction call.

    Support

    • open an issue to report a problem or to suggest a new feature
    • start a discussion to ask a how-to question or to share an idea

    License

    This project is licensed under the Apache 2.0 License – see LICENSE file for details.

    Functions

    createRDF4JRepository

    Creates a Repository backed by an RDF4J REST API endpoint.