Skip to content
metreecaPublic

About

Turnkey model-driven storage for linked data resources.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@metreeca/keep

npm

Turnkey model-driven storage for linked data resources.

@metreeca/keep stores and retrieves linked data resources independently of the backend holding them, driven by the resource models that describe them:

  • Model-Driven Storage: data models defined with @metreeca/blue drive storage and validation
  • Declarative Operations: CRUD operations on linked data resources without handwritten queries
  • Pluggable Connectors: one storage API over every supported backend, through interchangeable connector packages
Layer Package Description
Components @metreeca/keep Core model-driven storage API
@metreeca/keep-flake Shape-driven traversal trees
@metreeca/keep-suite Connector conformance test suite
Connectors @metreeca/keep-rest REST/JSON proxy connector
upcoming SQL:2011 database connector
upcoming GQL:2024 graph connector
@metreeca/keep-sparql SPARQL 1.1 repository connector

Installation

Pick the connector for your backend from the table above and install it. The connector pulls in the framework packages it needs, so you don't install them yourself.

Some connectors also need a separate backend library, such as a driver, runtime or client. The connector README lists any such requirement.

npm install @metreeca/keep-<connector>    # connector from the table above
npm install <backend-package>             # backend library, if the connector requires one

Warning

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

Usage

Note

Each package documents its own API in its README and API reference; for complete coverage, see the API reference.

An application obtains a store from a backend connector, then reads and writes resources against the models describing them, whatever the backend. For example, with the SPARQL connector over an RDF4J Server repository:

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

const store = createSPARQLStore(createRDF4JRepository({
	server: "http://localhost:8080/rdf4j-server",
	repository: "products"
}));

const product = await store.lookup({
	entry: "http://example.com/products/1",
	shape: ProductShape,
	model: {
		name: {},
		price: {},
		vendor: { id: {}, name: {} }
	}
});

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.

About

Turnkey model-driven storage for linked data resources.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages