Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BindingBase

A set of mappings from a variable to a RDF Term, implements using a HashMap

author

Thomas Minier

Hierarchy

Index

Constructors

constructor

Properties

Private _content

_content: Map<string, string>

Accessors

isEmpty

  • get isEmpty(): boolean

size

  • get size(): number

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

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

empty

equals

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

forEach

  • forEach(callback: function): void
  • Parameters

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

          • variable: string
          • value: string

          Returns void

    Returns void

get

  • get(variable: string): string | null

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

has

  • has(variable: string): boolean

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

set

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

setProperty

  • setProperty(key: string, value: any): 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

toString

  • toString(): string

union

values

  • values(): IterableIterator<string>

variables

  • variables(): IterableIterator<string>

Static fromObject

  • Creates a set of mappings from a plain Javascript Object

    Parameters

    • obj: Object

      Source object to turn into a set of mappings

    Returns Bindings

    A set of mappings

Generated using TypeDoc