Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @rdfdev/delta

js.rdf.dev/delta

Read the Docs npm (tag) npm bundle size

Utilities to quickly create linked deltas, an rdf-native way to express and process changes in state.

Example

import rdf from "@ontologies/core";
import schema from "@ontologies/schema";
import { add, replace } from "@rdfdev/delta";
import { RDFStore } from "link-lib";

const myProfile = rdf.namedNode("https://example.com/profile/card#me");

const updateName = [
  replace(myProfile, schema.name, rdf.literal("Douglas Engelbart")),
  add(myProfile, schema.comment, rdf.literal("Update from today")),
];

new RDFStore().processDelta(updateName) // Changes applied

Getting started

Just install the package and its peer dependencies.

npm i @rdfdev/delta @ontologies/core @ontologies/ld

yarn add @rdfdev/delta @ontologies/core @ontologies/ld

Documentation

See the js.rdf.dev/delta documentation

See the complete js.rdf.dev documentation

Need help with linked data?

This package is brought to you by Ontola. We build production-grade linked data solutions and can help you from advice to building custom web services.

Index

Variables

Const add

add: (Anonymous function) = buildQuadCreator(addGraph)

Create a delta statement adding ({s}, {p}, {o}) to {g} or the default graph

Const addGraph

addGraph: (Anonymous function) = buildGraph("add")

Const purge

purge: (Anonymous function) = buildQuadCreator(purgeGraph)

Create a delta statement purging ({s}, {p}, {o}) to {g} or the default graph

Const purgeGraph

purgeGraph: (Anonymous function) = buildGraph("purge")

Const remove

remove: (Anonymous function) = buildQuadCreator(removeGraph)

Create a delta statement removing ({s}, {p}, {o}) to {g} or the default graph

Const removeGraph

removeGraph: (Anonymous function) = buildGraph("remove")

Const replace

replace: (Anonymous function) = buildQuadCreator(replaceGraph)

Create a delta statement replacing ({s}, {p}, {o}) to {g} or the default graph

Const replaceGraph

replaceGraph: (Anonymous function) = buildGraph("replace")

Const slice

slice: (Anonymous function) = buildQuadCreator(sliceGraph)

Create a delta statement slicing ({s}, {p}, {o}) to {g} or the default graph

Const sliceGraph

sliceGraph: (Anonymous function) = buildGraph("slice")

Const supplant

supplant: (Anonymous function) = buildQuadCreator(supplantGraph)

Create a delta statement supplanting ({s}, {p}, {o}) to {g} or the default graph

Const supplantGraph

supplantGraph: (Anonymous function) = buildGraph("supplant")

Generated using TypeDoc