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:
  • 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 BindingSets 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`