Stores the metadata triples and provides methods for easy access. Most functions return the metadata object to allow for chaining.

Hierarchy

  • RepresentationMetadata

Constructors

Properties

id: BlankNode | NamedNode<string>
logger: Logger = ...
store: Store<Quad, Quad, Quad, Quad>

Accessors

Methods

  • Helper function to simplify add/remove Runs the given function on all predicate/object pairs, but only converts the predicate to a named node once.

    Parameters

    • predicate: NamedNode<string>
    • object: MetadataValue
    • forFn: ((pred: NamedNode<string>, obj: Literal | NamedNode<string>) => void)
        • (pred: NamedNode<string>, obj: Literal | NamedNode<string>): void
        • Parameters

          • pred: NamedNode<string>
          • obj: Literal | NamedNode<string>

          Returns void

    Returns RepresentationMetadata

  • Throws

    Error If there are multiple matching values.

    Returns

    The corresponding value. Undefined if there is no match

    Parameters

    • predicate: NamedNode<string>

      Predicate to get the value for.

    • Optional graph: MetadataGraph

      Optional graph where the triple should be found.

    Returns undefined | Term

  • Finds all object values matching the given predicate and/or graph.

    Returns

    An array with all matches.

    Parameters

    • predicate: NamedNode<string>

      Optional predicate to get the values for.

    • Optional graph: MetadataGraph

      Optional graph where to get from.

    Returns Term[]

  • Verifies if a specific triple can be found in the metadata. Undefined parameters are interpreted as wildcards.

    Parameters

    • predicate: null | string | NamedNode<string> = null
    • object: null | string | BlankNode | Literal | NamedNode<string> = null
    • graph: null | MetadataGraph = null

    Returns boolean

  • Returns

    All matching metadata quads.

    Parameters

    • subject: null | string | BlankNode | NamedNode<string> = null
    • predicate: null | NamedNode<string> = null
    • object: null | string | BlankNode | Literal | NamedNode<string> = null
    • graph: null | MetadataGraph = null

    Returns Quad[]