LDkit

method Lens.prototype.deleteData
import { Lens } from "https://deno.land/x/ldkit/mod.ts";

Deletes raw RDF quads from the data store.

This method is useful when you need to delete data that is not covered by the data schema.

Examples

Example 1

import { createLens } from "ldkit";
import { schema } from "ldkit/namespaces";
import { DataFactory } from "ldkit/rdf";

// Create a schema
const PersonSchema = {
  "@type": schema.Person,
  name: schema.name,
} as const;

// Create a resource using the data schema and context above
const Persons = createLens(PersonSchema);

// Create a custom quad to insert
const df = new DataFactory();
const quad = df.quad(
  df.namedNode("http://example.org/Alan_Turing"),
  df.namedNode("http://schema.org/name"),
  df.literal("Alan Turing"),
);

// Delete the quad
await Persons.deleteData(quad);

Parameters

...quads: RDF.Quad[]

Quads to delete from the data store

Returns

Promise<void>

Nothing