Package com.stardog.stark.query
Class BindingSets
- java.lang.Object
-
- com.stardog.stark.query.BindingSets
-
public final class BindingSets extends java.lang.ObjectUtilities 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 classBindingSets.BuilderBuilder forBindingSet
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BindingSets.Builderbuilder()Return a newBindingSets.Builderfor aBindingSetstatic booleancompatible(BindingSet bs1, BindingSet bs2)Check whether twoBindingSets are compatible.static BindingSetempty()Return an emptyBindingSetstatic BindingSetof(Binding theBinding, Binding... theOtherBindings)Create aBindingSetcomprised if the given bindingsstatic BindingSetof(java.lang.String theVar, Value theValue)Create aBindingSetcomprised if the given bindingstatic java.util.function.Function<BindingSet,Value>select(java.lang.String theVar)Function to select the values for the given variable in a series ofbindingsstatic java.util.function.Function<BindingSet,Statement>toStatement()static BindingSetunion(BindingSet theBindings1, BindingSet theBindings2)
-
-
-
Method Detail
-
empty
@Nonnull public static BindingSet empty()
Return an emptyBindingSet- Returns:
- empty bindings
-
union
@Nonnull public static BindingSet union(@Nonnull BindingSet theBindings1, @Nonnull BindingSet theBindings2)
-
toStatement
public static java.util.function.Function<BindingSet,Statement> toStatement()
Return aFunctionthat will transform aBindingSetinto aStatement. 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 aBindingSetcomprised if the given bindings- Parameters:
theBinding- a bindingtheOtherBindings- additional bindings- Returns:
- the new `BindingSet`
-
of
@Nonnull public static BindingSet of(@Nonnull java.lang.String theVar, @Nonnull Value theValue)
Create aBindingSetcomprised if the given binding- Parameters:
theVar- the variabletheValue- 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 ofbindings- Parameters:
theVar- the variable to select- Returns:
- the function
-
compatible
public static boolean compatible(@Nonnull BindingSet bs1, @Nonnull BindingSet bs2)Check whether twoBindingSets 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 newBindingSets.Builderfor aBindingSet- Returns:
- a new `Builder`
-
-