Class BindingSets


  • public final class BindingSets
    extends java.lang.Object

    Utilities for working with BindingSet

    Since:
    1.0
    Version:
    1.0
    Author:
    Michael Grove
    See Also:
    Binding, BindingSet
    • Method Detail

      • empty

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

        public static java.util.function.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
                                    java.lang.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 java.util.function.Function<BindingSet,​Value> select​(@Nonnull
                                                                                 java.lang.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.