Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Bindings

A set of mappings from a variable to a RDF Term.

abstract
author

Thomas Minier

Hierarchy

Index

Constructors

constructor

Properties

Private _properties

_properties: Map<string, any>

Accessors

isEmpty

  • get isEmpty(): boolean
  • Returns True if the set is empty, False otherwise

    Returns boolean

    True if the set is empty, False otherwise

size

  • get size(): number
  • The number of mappings in the set

    Returns number

    The number of mappings in the set

Methods

bound

  • bound(triple: TripleObject): TripleObject
  • Bound a triple pattern using the set of mappings, i.e., substitute variables in the triple pattern

    Parameters

    • triple: TripleObject

      Triple pattern

    Returns TripleObject

    An new, bounded triple pattern

Abstract clear

  • clear(): void

clone

difference

  • Performs a set difference with another set of mappings, i.e., A.difference(B) returns all mappings that are in A and not in B.

    Parameters

    Returns Bindings

    The results of the set difference

Abstract empty

equals

  • Test the equality between two sets of mappings

    Parameters

    Returns boolean

    True if the two sets are equal, False otherwise

every

  • every(predicate: function): boolean
  • Test if every mappings in the set pass a predicate function

    Parameters

    • predicate: function

      Function to test for each mapping

        • (variable: string, value: string): boolean
        • Parameters

          • variable: string
          • value: string

          Returns boolean

    Returns boolean

    True if every mappings in the set some the predicate function, False otheriwse

extendMany

  • extendMany(values: Array<[string, string]>): Bindings
  • Creates a new bindings with additionnal mappings

    Parameters

    • values: Array<[string, string]>

      Pairs [variable, value] to add to the set

    Returns Bindings

    A new Bindings with the additionnal mappings

filter

  • Filter mappings from the set of mappings using a predicate function

    Parameters

    • predicate: function

      Predicate function

        • (variable: string, value: string): boolean
        • Parameters

          • variable: string
          • value: string

          Returns boolean

    Returns Bindings

    A new set of mappings

Abstract forEach

  • forEach(callback: function): void
  • Invoke a callback on each mapping

    Parameters

    • callback: function

      Callback to invoke

        • (variable: string, value: string): void
        • Parameters

          • variable: string
          • value: string

          Returns void

    Returns void

Abstract get

  • get(variable: string): string | null
  • Get the RDF Term associated with a SPARQL variable

    Parameters

    • variable: string

      SPARQL variable

    Returns string | null

    The RDF Term associated with the given SPARQL variable

getProperty

  • getProperty(key: string): any
  • Get metadata attached to the set using a key

    Parameters

    • key: string

      Metadata key

    Returns any

    The metadata associated with the given key

Abstract has

  • has(variable: string): boolean
  • Test if mappings exists for a SPARQL variable

    Parameters

    • variable: string

      SPARQL variable

    Returns boolean

    True if a mappings exists for this variable, False otherwise

hasProperty

  • hasProperty(key: string): boolean
  • Check if a metadata with a given key is attached to the set

    Parameters

    • key: string

      Metadata key

    Returns boolean

    Tur if the metadata exists, False otherwise

intersection

isSubset

  • Test if the set of bindings is a subset of another set of mappings.

    Parameters

    Returns boolean

    Ture if the set of bindings is a subset of another set of mappings, False otherwise

map

  • Creates a new set of mappings using a function to transform the current set

    Parameters

    • mapper: function

      Transformation function (variable, value) => [string, string]

        • (variable: string, value: string): [string | null, string | null]
        • Parameters

          • variable: string
          • value: string

          Returns [string | null, string | null]

    Returns Bindings

    A new set of mappings

mapValues

  • Same as map, but only transform values

    Parameters

    • mapper: function

      Transformation function

        • (variable: string, value: string): string | null
        • Parameters

          • variable: string
          • value: string

          Returns string | null

    Returns Bindings

    A new set of mappings

mapVariables

  • mapVariables(mapper: function): Bindings
  • Same as map, but only transform variables

    Parameters

    • mapper: function

      Transformation function

        • (variable: string, value: string): string | null
        • Parameters

          • variable: string
          • value: string

          Returns string | null

    Returns Bindings

    A new set of mappings

reduce

  • reduce<T>(reducer: function, start: T): T
  • Reduce the set of mappings to a value which is the accumulated result of running each element in collection thru a reducing function, where each successive invocation is supplied the return value of the previous.

    Type parameters

    • T

    Parameters

    • reducer: function

      Reducing function

        • (acc: T, variable: string, value: string): T
        • Parameters

          • acc: T
          • variable: string
          • value: string

          Returns T

    • start: T

      Value used to start the accumulation

    Returns T

    The accumulated value

Abstract set

  • set(variable: string, value: string): void
  • Add a mapping SPARQL variable -> RDF Term to the set

    Parameters

    • variable: string

      SPARQL variable

    • value: string

      RDF Term

    Returns void

setProperty

  • setProperty(key: string, value: any): void
  • Attach metadata to the set

    Parameters

    • key: string

      Key associated to the value

    • value: any

      Value to attach

    Returns void

some

  • some(predicate: function): boolean
  • Test if some mappings in the set pass a predicate function

    Parameters

    • predicate: function

      Function to test for each mapping

        • (variable: string, value: string): boolean
        • Parameters

          • variable: string
          • value: string

          Returns boolean

    Returns boolean

    True if some mappings in the set some the predicate function, False otheriwse

toObject

  • toObject(): Object
  • Serialize the set of mappings as a plain JS Object

    Returns Object

    The set of mappings as a plain JS Object

toString

  • toString(): string
  • Serialize the set of mappings as a string

    Returns string

    The set of mappings as a string

union

Abstract values

  • values(): IterableIterator<string>
  • Get an iterator over the RDF terms in the set

    Returns IterableIterator<string>

    An iterator over the RDF terms in the set

Abstract variables

  • variables(): IterableIterator<string>
  • Get an iterator over the SPARQL variables in the set

    Returns IterableIterator<string>

    An iterator over the SPARQL variables in the set

Generated using TypeDoc