Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Statement<S, P, O, G>

A Statement represents an RDF Triple or Quad.

Type parameters

Hierarchy

  • Statement

Implements

  • Quad<S, P, O, G | DefaultGraph>

Index

Constructors

constructor

  • new Statement(subject: S, predicate: P, object: O, graph?: G | DefaultGraph): Statement
  • Construct a new statement

    Parameters

    • subject: S

      The subject of the triple. What the fact is about

    • predicate: P

      The relationship which is asserted between the subject and object

    • object: O

      The thing or data value which is asserted to be related to the subject

    • Optional graph: G | DefaultGraph

      The document where the triple is or was or will be stored on the web.

      The graph param is a named node of the document in which the triple when it is stored on the web. It exists because when you have read data from various places in the web, the “graph” tells you why you have the triple. (At the moment, it is just the document, in future it could be an inference step)

      When you do UpdateManager.update() then the graph’s of all the statements must be the same, and give the document you are patching. In future, we may have a more powerful update() which can update more than one document.

    Returns Statement

Properties

graph

graph: G | DefaultGraph

The graph param is a named node of the document in which the triple when it is stored on the web.

object

object: O

The thing or data value which is asserted to be related to the subject

predicate

predicate: P

The relationship which is asserted between the subject and object

subject

subject: S

The subject of the triple. What the Statement is about.

Accessors

why

  • get why(): DefaultGraph | G
  • set why(g: DefaultGraph | G): void
  • Alias for graph, favored by Tim

    Returns DefaultGraph | G

  • Alias for graph, favored by Tim

    Parameters

    • g: DefaultGraph | G

    Returns void

Methods

equals

  • equals(other: Quad): boolean

substitute

toCanonical

  • toCanonical(): string
  • Creates a canonical string representation of this statement.

    Returns string

toNQ

  • toNQ(): string
  • Creates a n-quads string representation of this statement

    Returns string

toNT

  • toNT(): string
  • Creates a n-triples string representation of this statement

    Returns string

toString

  • toString(): string