Skip to main content
Module

x/ldkit/rdf.ts>RDF.DatasetCore

LDkit - Linked Data query toolkit for TypeScript developers
Go to Latest
interface RDF.DatasetCore
import { type RDF } from "https://deno.land/x/ldkit@v0.5.1/rdf.ts";
const { DatasetCore } = RDF;

Type Parameters

optional
OutQuad extends BaseQuad = Quad
optional
InQuad extends BaseQuad = OutQuad

Properties

readonly
size: number

A non-negative integer that specifies the number of quads in the set.

Methods

add(quad: InQuad): this

Adds the specified quad to the dataset.

Existing quads, as defined in Quad.equals, will be ignored.

delete(quad: InQuad): this

Removes the specified quad from the dataset.

has(quad: InQuad): boolean

Determines whether a dataset includes a certain quad.

match(
subject?: Term | null,
predicate?: Term | null,
object?: Term | null,
graph?: Term | null,
): DatasetCore<OutQuad, InQuad>

Returns a new dataset that is comprised of all quads in the current instance matching the given arguments.

The logic described in Quad Matching is applied for each quad in this dataset to check if it should be included in the output dataset.

This method always returns a new DatasetCore, even if that dataset contains no quads.

Since a DatasetCore is an unordered set, the order of the quads within the returned sequence is arbitrary.

[[Symbol.iterator]](): Iterator<OutQuad>