Class Collection<T>

A collection of other RDF nodes

Use generic T to control the contents of the array.

Type Parameters

Hierarchy (view full)

Implements

  • Term

Constructors

Properties

classOrder: number = ClassOrder.Collection

The class order for this node

closed: boolean = false
compareTerm: ((other) => number) = RdflibBlankNode.prototype.compareTerm

Type declaration

    • (other): number
    • Parameters

      Returns number

elements: T[] = []

The nodes in this collection

isVar: number = 0
termType: "Collection" = CollectionTermType

The type of node

value: string

The node's value

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

Type declaration

    • <T>(value): T
    • Type Parameters

      • T extends FromValueReturns

      Parameters

      • value: ValueType

      Returns T

termType: "Collection" = CollectionTermType
toJS: ((term) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[])

Type declaration

    • (term): 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

Methods

  • Appends an element to this collection

    Parameters

    • element: T

      The new element

    Returns number

  • Compares whether the two nodes are equal

    Parameters

    • other: Term

      The other node

    Returns boolean

  • Removes the first element from the collection (and return it)

    Returns undefined | T

  • Creates a new Collection with the substituting bindings applied

    Parameters

    • bindings: Bindings

      The bindings to substitute

    Returns any

  • Serializes the collection to a string. Surrounded by (parentheses) and separated by spaces.

    Returns string

  • Prepends the specified element to the collection's front

    Parameters

    • element: T

      The element to prepend

    Returns number