@faubulous/mentor-rdf
    Preparing search index...

    Class DataFactory

    An RDF/JS compliant DataFactory implementation.

    This factory provides methods to create RDF terms (named nodes, blank nodes, literals, variables) and quads according to the RDF/JS specification.

    Implements

    • DataFactory<rdfjs.Quad, rdfjs.Quad>
    Index

    Constructors

    Properties

    blankNodeCounter: number = 0

    Methods

    • Creates a new blank node with the given identifier. If no identifier is provided, a unique one will be generated.

      Parameters

      • Optionalvalue: string

        Optional blank node identifier.

      Returns BlankNode

      A new BlankNode instance.

    • Returns the singleton default graph instance.

      Returns DefaultGraph

      The default graph instance.

    • Creates a copy of an existing quad.

      Parameters

      • original: Quad

        The quad to copy.

      Returns Quad

      A new quad instance with the same values.

    • Creates a copy of an existing term.

      Type Parameters

      • T extends Term

      Parameters

      • original: T

        The term to copy.

      Returns T

      A new term instance with the same value.

    • Creates a new literal with the given value and optional language tag or datatype.

      Parameters

      • value: string

        The lexical value of the literal.

      • OptionallanguageOrDatatype: string | NamedNode<string>

        Either a language tag (string) or a datatype (NamedNode).

      Returns Literal

      A new Literal instance.

    • Creates a new named node with the given IRI.

      Type Parameters

      • Iri extends string = string

      Parameters

      • value: Iri

        The IRI of the named node.

      Returns NamedNode<Iri>

      A new NamedNode instance.

    • Creates a new quad with the given subject, predicate, object, and optional graph.

      Parameters

      • subject: Quad_Subject

        The subject of the quad.

      • predicate: Quad_Predicate

        The predicate of the quad.

      • object: Quad_Object

        The object of the quad.

      • Optionalgraph: Quad_Graph

        The graph of the quad (defaults to the default graph).

      Returns Quad

      A new Quad instance.

    • Creates a new variable with the given name.

      Parameters

      • value: string

        The name of the variable (without the leading '?').

      Returns Variable

      A new Variable instance.