Package com.stardog.stark.query

# Class BindingSets

java.lang.Object
com.stardog.stark.query.BindingSets

public final class BindingSets extends Object

Utilities for working with `BindingSet`

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove
See Also:
  - `Binding`
  - `BindingSet`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `BindingSets.Builder`
  Builder for `BindingSet`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static BindingSets.Builder`
  `builder()`
  Return a new `BindingSets.Builder` for a `BindingSet`
  `static boolean`
  `compatible(BindingSet bs1, BindingSet bs2)`
  Check whether two `BindingSet`s are compatible.
  `static BindingSet`
  `empty()`
  Return an empty `BindingSet`
  `static BindingSet`
  `of(Binding theBinding, Binding... theOtherBindings)`
  Create a `BindingSet` comprised if the given bindings
  `static BindingSet`
  `of(String theVar, Value theValue)`
  Create a `BindingSet` comprised if the given binding
  `static Function<BindingSet,Value>`
  `select(String theVar)`
  Function to select the values for the given variable in a series of `bindings`
  `static Function<BindingSet,Statement>`
  `toStatement()`
  Return a `Function` that will transform a `BindingSet` into a `Statement`.
  `static BindingSet`
  `union(BindingSet theBindings1, BindingSet theBindings2)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### empty

    @Nonnull public static BindingSet empty()
    Return an empty `BindingSet`
    Returns:
      empty bindings

  - ### union

    @Nonnull public static BindingSet union(@Nonnull BindingSet theBindings1, @Nonnull BindingSet theBindings2)

  - ### toStatement

    public static Function<BindingSet,Statement> toStatement()
    Return a `Function` that will transform a `BindingSet` into a `Statement`. This assumes that the `BindingSet`s will have the variables, `s`, `p`, `o`, and optionally, `g`, corresponding to the `SPOC` of the `Statement` to be created. If `g` is not bound, the `Statement` will use the default graph as its context.
    Returns:
      the function to use for xform

  - ### of

    @Nonnull public static BindingSet of(@Nonnull Binding theBinding, @Nonnull Binding... theOtherBindings)
    Create a `BindingSet` comprised if the given bindings
    Parameters:
      `theBinding` - a binding
      `theOtherBindings` - additional bindings
    Returns:
      the new `BindingSet`

  - ### of

    @Nonnull public static BindingSet of(@Nonnull String theVar, @Nonnull Value theValue)
    Create a `BindingSet` comprised if the given binding
    Parameters:
      `theVar` - the variable
      `theValue` - the bound value
    Returns:
      the new `BindingSet`

  - ### select

    @Nonnull public static Function<BindingSet,Value> select(@Nonnull String theVar)
    Function to select the values for the given variable in a series of `bindings`
    Parameters:
      `theVar` - the variable to select
    Returns:
      the function

  - ### compatible

    public static boolean compatible(@Nonnull BindingSet bs1, @Nonnull BindingSet bs2)
    Check whether two `BindingSet`s are compatible. Two binding sets are compatible if they have equal values for each binding name that occurs in both binding sets.

  - ### builder

    @Nonnull public static BindingSets.Builder builder()
    Return a new `BindingSets.Builder` for a `BindingSet`
    Returns:
      a new `Builder`