Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • RepresentationMetadata

Index

Constructors

constructor

Properties

Private id

id: NamedNode | BlankNode

Protected Readonly logger

logger: Logger = getLoggerFor(this)

Private store

store: Store

Accessors

contentType

  • get contentType(): string | undefined
  • set contentType(input: undefined | string): void

identifier

  • get identifier(): NamedNode | BlankNode
  • set identifier(id: NamedNode | BlankNode): void

Methods

add

  • add(predicate: NamedNode | string, object: NamedNode | Literal | string): this
  • Adds a value linked to the identifier. Strings get converted to literals.

    Parameters

    • predicate: NamedNode | string

      Predicate linking identifier to value.

    • object: NamedNode | Literal | string

      Value to add.

    Returns this

addQuads

  • addQuads(quads: Quad[]): this

get

  • get(predicate: NamedNode | string): Term | undefined
  • throws

    Error If there are multiple matching values.

    Parameters

    • predicate: NamedNode | string

      Predicate to get the value for.

    Returns Term | undefined

    The corresponding value. Undefined if there is no match

getAll

  • getAll(predicate: NamedNode | string): Term[]

quads

  • quads(): Quad[]

remove

  • remove(predicate: NamedNode | string, object: NamedNode | Literal | string): this
  • Removes the given value from the metadata. Strings get converted to literals.

    Parameters

    • predicate: NamedNode | string

      Predicate linking identifier to value.

    • object: NamedNode | Literal | string

      Value to remove.

    Returns this

removeAll

  • removeAll(predicate: NamedNode | string): this

removeQuads

  • removeQuads(quads: Quad[]): this

set

  • set(predicate: NamedNode | string, object?: NamedNode | Literal | string): this
  • Sets the value for the given predicate, removing all other instances. In case the object is undefined this is identical to removeAll(predicate).

    Parameters

    • predicate: NamedNode | string

      Predicate linking to the value.

    • Optional object: NamedNode | Literal | string

      Value to set.

    Returns this

setMetadata

Private setOverrides