Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ldkit/rdf.ts>DataFactory

LDkit - Linked Data query toolkit for TypeScript developers
Go to Latest
class DataFactory
implements [RDF.DataFactory]<Q>
Re-export
import { DataFactory } from "https://deno.land/x/ldkit@v0.6.0/rdf.ts";

A factory for instantiating RDF terms and quads.

Constructors

new
DataFactory(options?: IDataFactoryOptions)

Properties

private
blankNodeCounter
private
readonly
blankNodePrefix

Methods

blankNode(value?: string): BlankNode
defaultGraph(): DefaultGraph
fromQuad(original: Q): Q

Create a deep copy of the given quad using this data factory.

fromTerm<T extends RDF.Term>(original: T): (T extends RDF.NamedNode ? NamedNode : (T extends RDF.BlankNode ? BlankNode : (T extends RDF.Literal ? Literal : (T extends RDF.Variable ? Variable : (T extends RDF.DefaultGraph ? DefaultGraph : (T extends Q ? Q : unknown))))))

Create a deep copy of the given term using this data factory.

literal(value: string, languageOrDatatype?: string | RDF.NamedNode): Literal
namedNode<Iri extends string = string>(value: Iri): NamedNode<Iri>
quad(
subject: Q["subject"],
predicate: Q["predicate"],
object: Q["object"],
graph?: Q["graph"],
): Q & Quad

Reset the internal blank node counter.

variable(value: string): Variable

This method is optional.