@metreeca/wire-sparql-http
v0.12.0
Published
SPARQL connector for @metreeca/wire backed by a SPARQL 1.1 Protocol endpoint.
Maintainers
Readme
@metreeca/wire-sparql-http
SPARQL connector for @metreeca/wire backed by a SPARQL 1.1 Protocol endpoint.
Exposes any SPARQL 1.1 Protocol compliant endpoint through the common
@metreeca/wire-sparql Repository interface, issuing each query and update as a single HTTP request. For RDF4J
Server repositories with server-managed transactions, use the companion
@metreeca/wire-sparql-rdf4j connector.
Installation
npm install @metreeca/wire-sparql # the SPARQL query API
npm install @metreeca/wire-sparql-http # this connector[!WARNING]
TypeScript consumers must use
"moduleResolution": "nodenext"/"node16"/"bundler"intsconfig.json. The legacy"node"resolver is not supported.
Usage
Connect to a SPARQL 1.1 Protocol endpoint with createHTTPRepository, then issue queries and updates through the
@metreeca/wire-sparql Repository API:
import { createHTTPRepository } from "@metreeca/wire-sparql-http";
const repository = createHTTPRepository({
query: "https://example.org/sparql",
update: "https://example.org/sparql/statements"
});The optional graphs setting names a Graph Store Protocol endpoint,
where merge and store upload their triples in bulk. Without it, they run as SPARQL updates on the update endpoint,
with the same effect on the store, but with the data parsed as SPARQL text and sent as a single update request.
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 provides no transaction isolation: the SPARQL 1.1 Protocol exposes no transaction primitives, so each query and update is dispatched eagerly as a single HTTP request and
executeruns its task directly, without bracketing. A multi-statement update is atomic only insofar as the endpoint applies it atomically.
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.
