Server URL and repository identifier
Readonlyserver: stringRDF4J Server base URL, for example http://localhost:8080/rdf4j-server
Readonlyrepository: stringRepository identifier within the RDF4J Server instance
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
A Repository instance
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
executetask are dispatched to the canonical SPARQL 1.1 Protocol endpoints (/repositories/{id}for query,/repositories/{id}/statementsfor update) by delegating to a createHTTPRepository instance, so a one-offask/updatedoes not pay the start-and-commit roundtrip cost.Transaction Isolation — Determined by the target RDF4J repository.
Error handling — every HTTP exchange is funnelled through createFetch, so:
status: 0statusTextasdetail, and the parsed body (RFC 7807 JSON, plain text, or omitted) asreportask/selectresponse rejects with a synthesised Problem carrying the response status and a parse-failuredetailconstructresponse whoseContent-Typeis not N-Triples rejects with a synthesised ProblemLocationheader on the start-transaction response rejects with a synthesised ProblemSyntaxErrorfor ill-formed N-Triples, or aRangeErrorfor an unexpected SPARQL Results JSON termRollback (
DELETEon the transaction URL) is best-effort: a network or 5xx failure on rollback is swallowed so the original task error propagates; without best-effort handling a transient network glitch on the rollback would mask the real cause of the task failure.