Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Collection<T>

A collection of other RDF nodes

Use generic T to control the contents of the array.

Type parameters

Hierarchy

Implements

  • Term

Index

Constructors

constructor

  • new Collection<T>(initial?: readonly ValueType[]): Collection<T>

Properties

classOrder

classOrder: number = ClassOrder.Collection

The class order for this node

closed

closed: boolean = false

compareTerm

compareTerm: (other: BlankNode) => number = RdflibBlankNode.prototype.compareTerm

Type declaration

elements

elements: T[] = []

The nodes in this collection

isVar

isVar: number = 0

termType

termType: "Collection" = CollectionTermType

The type of node

value

value: string

The node's value

Static fromValue

fromValue: <T>(value: ValueType) => T

Type declaration

    • <T>(value: ValueType): T
    • Type parameters

      • T: FromValueReturns<any>

      Parameters

      • value: ValueType

      Returns T

Static termType

termType: "Collection" = CollectionTermType

Static toJS

toJS: (term: any) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

Type declaration

    • (term: any): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
    • Parameters

      • term: any

      Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

Accessors

id

  • get id(): string
  • set id(value: string): void

Methods

append

  • append(element: T): number
  • Appends an element to this collection

    Parameters

    • element: T

      The new element

    Returns number

close

  • close(): boolean

equals

  • equals(other: Term): boolean
  • Compares whether the two nodes are equal

    Parameters

    • other: Term

      The other node

    Returns boolean

hashString

  • hashString(): string

sameTerm

  • sameTerm(other: Node): boolean

shift

  • shift(): undefined | T
  • Removes the first element from the collection (and return it)

    Returns undefined | T

substitute

  • substitute(bindings: Bindings): any
  • Creates a new Collection with the substituting bindings applied

    Parameters

    • bindings: Bindings

      The bindings to substitute

    Returns any

toCanonical

  • toCanonical(): string

toNQ

  • toNQ(): string

toNT

  • toNT(): string

toString

  • toString(): string

unshift

  • unshift(element: T): number
  • Prepends the specified element to the collection's front

    Parameters

    • element: T

      The element to prepend

    Returns number

Static toNT

  • toNT(collection: any): string

Generated using TypeDoc