@metreeca/wire
    Preparing search index...
    • Creates a Repository backed by an RDF4J REST API endpoint.

      Brackets every execute task in a server-managed RDF4J transaction, committed when the task completes and rolled back if it throws or any transactional operation fails.

      Operations issued outside an enclosing execute task are dispatched to the canonical SPARQL 1.1 Protocol endpoints (/repositories/{id} for query, /repositories/{id}/statements for update) by delegating to a createHTTPRepository instance, so a one-off ask / update does not pay the start-and-commit roundtrip cost. A Dataset is honoured both inside and outside execute tasks, as the same protocol parameters.

      merge and store upload their triples as N-Triples without parsing them as SPARQL text: outside execute tasks to the Graph Store Protocol service of the repository (/repositories/{id}/rdf-graphs/service), within them as transaction ADD operations, which a store precedes with a DROP SILENT update clearing the target graph. The default graph is the RDF4J null context.

      Important

      Transaction Isolation — Determined by the target RDF4J repository.

      Error handling — every HTTP exchange is funnelled through createFetch, so:

      • Network failures (DNS, refused connection, TLS, abort) reject with a Problem carrying status: 0
      • Non-2xx responses reject with a Problem carrying the wire status, the response statusText as detail, and the parsed body (RFC 7807 JSON, plain text, or omitted) as report
      • Malformed JSON in a 2xx ask/select response rejects with a synthesised Problem carrying the response status and a parse-failure detail
      • A 2xx construct response whose Content-Type is not N-Triples rejects with a synthesised Problem
      • A missing Location header on the start-transaction response rejects with a synthesised Problem
      • A malformed result payload surfaces the decoder's own error: a SyntaxError for ill-formed N-Triples, or a RangeError for a term component either syntax admits but the RDF data model rejects (a relative IRI, a lexical form holding an isolated surrogate, a non-conforming language tag), as well as for an unexpected SPARQL Results JSON term

      Rollback is best-effort: a network or 5xx failure on rollback is swallowed, so the original task error propagates.

      Warning

      RDF4J Server does not apply timeout to updates issued within an execute task, so they always run to completion. Aborting the exchange through a custom fetch does not stop them either: the update keeps running on the server, and the rollback waits for it to finish. Updates issued outside execute honour timeout, so an update that needs a time bound has to run there, giving up transactional atomicity.

      Parameters

      • options: {
            server: string;
            repository: string;
            infer?: boolean;
            timeout?: number;
            fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
        }

        Server URL, repository identifier and the operation settings applied to every exchange

        • Readonlyserver: string

          RDF4J Server base URL, for example http://localhost:8080/rdf4j-server

        • Readonlyrepository: string

          Repository identifier within the RDF4J Server instance

        • Optional Readonlyinfer?: boolean

          Whether operations take inferred statements into account; when omitted, RDF4J includes them wherever the repository computes them, so set it to false to restrict operations to explicit statements

        • Optional Readonlytimeout?: number

          Maximum execution time of each operation, as a positive integer number of seconds; when omitted, operations run under the execution limit configured on the server, if any

        • Optional Readonlyfetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

          Custom fetch implementation used for every HTTP exchange, enabling header, auth, and exchange customisation; defaults to the global fetch

      Returns Repository

      A Repository instance

      TypeError if timeout is not a positive integer