Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DataFactory<FactoryTypes, IndexType>

Defines a DataFactory as used in rdflib, based on the RDF/JS: Data model specification, but with additional extensions

bnIndex is optional but useful.

Type parameters

  • FactoryTypes

  • IndexType

Hierarchy

Index

Properties

blankNode

blankNode: function

Returns a new instance of BlankNode. If the value parameter is undefined a new identifier for the blank node is generated for each call.

Type declaration

    • Parameters

      • Optional value: undefined | string

      Returns BlankNode

Optional Private bnIndex

bnIndex: undefined | number

BlankNode index

defaultGraph

defaultGraph: function

Returns an instance of DefaultGraph.

Type declaration

Optional fromQuad

fromQuad: undefined | function

Returns a new instance of Quad, such that newObject.equals(original) returns true. Not implemented in RDFJS, so optional.

Optional fromTerm

fromTerm: undefined | function

Returns a new instance of the specific Term subclass given by original.termType (e.g., NamedNode, BlankNode, Literal, etc.), such that newObject.equals(original) returns true. Not implemented in RDFJS, so optional.

namedNode

namedNode: function

Returns a new instance of NamedNode.

Type declaration

supports

supports: SupportTable

Optional variable

variable: undefined | function

Returns a new instance of Variable. This method is optional.

Methods

equals

id

  • id(obj: Term | FactoryTypes): IndexType
  • Generates a unique session-idempotent identifier for the given object.

    example

    NQ serialization (reversible from value)

    example

    MD5 hash of termType + value (irreversible from value, map needed)

    Parameters

    • obj: Term | FactoryTypes

    Returns IndexType

    A unique value which must also be a valid JS object key type.

isQuad

  • isQuad(obj: any): obj is Statement

literal

  • literal(value: string, languageOrDatatype?: string | TFNamedNode): Literal

quad

quadToNQ

termToNQ

  • termToNQ(term: Term): string

toNQ

  • toNQ(term: Term | FactoryTypes): string