Package com.stardog.stark.query
Class BindingSets
- java.lang.Object
-
- com.stardog.stark.query.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BindingSets.Builder
Builder forBindingSet
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BindingSets.Builder
builder()
Return a newBindingSets.Builder
for aBindingSet
static boolean
compatible(BindingSet bs1, BindingSet bs2)
Check whether twoBindingSet
s are compatible.static BindingSet
empty()
Return an emptyBindingSet
static BindingSet
of(Binding theBinding, Binding... theOtherBindings)
Create aBindingSet
comprised if the given bindingsstatic BindingSet
of(java.lang.String theVar, Value theValue)
Create aBindingSet
comprised 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 ofbindings
static java.util.function.Function<BindingSet,Statement>
toStatement()
static BindingSet
union(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 aFunction
that will transform aBindingSet
into 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 aBindingSet
comprised 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 aBindingSet
comprised 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 twoBindingSet
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 newBindingSets.Builder
for aBindingSet
- Returns:
- a new `Builder`
-
-