Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Statement<S, P, O, G>

A Statement represents an RDF Triple or Quad.

Type parameters

  • S: SubjectType = SubjectType

  • P: PredicateType = PredicateType

  • O: ObjectType = ObjectType

  • G: GraphType = GraphType

Hierarchy

  • Statement

Implements

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

Index

Constructors

constructor

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

    Type parameters

    • S: SubjectType = SubjectType

    • P: PredicateType = PredicateType

    • O: ObjectType = ObjectType

    • G: GraphType = GraphType

    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<S, P, O, G>

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(): G | DefaultGraph
  • set why(g: G | DefaultGraph): void
  • Alias for graph, favored by Tim

    Returns G | DefaultGraph

  • Alias for graph, favored by Tim

    Parameters

    • g: G | DefaultGraph

    Returns void

Methods

equals

  • equals(other: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>): boolean
  • Checks whether two statements are the same

    Parameters

    • other: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

      The other statement

    Returns boolean

substitute

  • substitute(bindings: Bindings): Statement<SubjectType, PredicateType, ObjectType, GraphType>
  • Creates a statement with the bindings substituted

    Parameters

    • bindings: Bindings

      The bindings

    Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>

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

Generated using TypeDoc