Endpoint URLs and the optional fetch override
Readonlyquery: stringSPARQL query endpoint URL, for example http://localhost:7200/repositories/my-repo
Optional Readonlyupdate?: stringSPARQL update endpoint URL; defaults to query when omitted
Optional Readonlygraphs?: stringGraph Store Protocol endpoint URL, for example
http://localhost:7200/repositories/my-repo/rdf-graphs/service; when omitted, graph store writes run as SPARQL
updates on the update endpoint, with the same effect on the store but no bulk upload of the data
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
An immutable Repository backed by the configured endpoints
Creates an HTTP-based Repository backed by a SPARQL 1.1 Protocol endpoint.
Each query and update is dispatched eagerly as a single HTTP request. A Dataset is sent as protocol parameters added to any the endpoint URL already carries:
default-graph-uriandnamed-graph-urion queries,using-graph-uriandusing-named-graph-urion updates. An endpoint rejecting an update that declares its own dataset as well fails like any other non-2xx response, rejecting with a Problem carrying the wire status.merge and store upload their triples as N-Triples to the Graph Store Protocol endpoint, when one is configured. Without one, they run as
INSERT DATAupdates on the update endpoint, preceded byDROP SILENTforstore. Every SPARQL 1.1 Protocol endpoint supports this fallback, at the price of parsing the data as SPARQL text. Amergeof no triples issues no request to either endpoint.Transaction Isolation — None. The SPARQL 1.1 Protocol exposes no transaction primitives.
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 ProblemSyntaxErrorfor ill-formed N-Triples, or aRangeErrorfor 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 unrecognised SPARQL Results JSON binding