Package com.stardog.stark.query
Interface BindingSet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<Binding>
binding(java.lang.String theVar)
Optionally return the binding of the given variableboolean
binds(java.lang.String theVar)
Return whether or not the variable is bound in this solutiondefault java.util.Optional<BNode>
bnode(java.lang.String theVar)
Optionally return the value for the given variable as aBNode
default Value
get(java.lang.String theVar)
Get the value for the given variable in the solution.default java.util.Optional<IRI>
iri(java.lang.String theVar)
Optionally return the value for the given variable as aIRI
default java.util.Optional<Literal>
literal(java.lang.String theVar)
Optionally return the value for the given variable as aLiteral
default java.util.Optional<Resource>
resource(java.lang.String theVar)
Optionally return the value for the given variable as aResource
int
size()
Return the number ofbindings
in the solution.default java.util.stream.Stream<Binding>
stream()
Return this set ofbindings
as aStream
java.util.Optional<Value>
value(java.lang.String theVar)
Optionally return the value for the given variablejava.util.Set<java.lang.String>
variables()
Return the set of variables associated with this `BindingSet`.
-
-
-
Method Detail
-
variables
@Nonnull java.util.Set<java.lang.String> variables()
Return the set of variables associated with this `BindingSet`. Minimally, this would be thenames
of all thebindings
, however, it could be a superset of that and include the names of any variables whichare not bound
.- Returns:
- the variable names
-
size
int size()
Return the number ofbindings
in the solution.- Returns:
- the size
-
value
@Nonnull java.util.Optional<Value> value(@Nonnull java.lang.String theVar)
Optionally return the value for the given variable- Parameters:
theVar
- the name of the variable whose binding should be retrieved- Returns:
- the value, or an empty optional if the var is not bound to a value or not in the solution
-
get
@Nullable default Value get(@Nonnull java.lang.String theVar)
Get the value for the given variable in the solution.- Parameters:
theVar
- the name of the variable to get- Returns:
- the value, or `null` if it is not bound
-
literal
@Nonnull default java.util.Optional<Literal> literal(@Nonnull java.lang.String theVar)
Optionally return the value for the given variable as aLiteral
- Parameters:
theVar
- the name of the variable whose binding should be retrieved- Returns:
- the value as a `Literal`, or an empty optional if the var is not bound to a value or is not a `Literal`
-
iri
@Nonnull default java.util.Optional<IRI> iri(@Nonnull java.lang.String theVar)
Optionally return the value for the given variable as aIRI
- Parameters:
theVar
- the name of the variable whose binding should be retrieved- Returns:
- the value as a `IRI`, or an empty optional if the var is not bound to a value or is not a `IRI`
-
bnode
@Nonnull default java.util.Optional<BNode> bnode(@Nonnull java.lang.String theVar)
Optionally return the value for the given variable as aBNode
- Parameters:
theVar
- the name of the variable whose binding should be retrieved- Returns:
- the value as a `BNode`, or an empty optional if the var is not bound to a value or is not a `BNode`
-
resource
@Nonnull default java.util.Optional<Resource> resource(@Nonnull java.lang.String theVar)
Optionally return the value for the given variable as aResource
- Parameters:
theVar
- the name of the variable whose binding should be retrieved- Returns:
- the value as a `Resource`, or an empty optional if the var is not bound to a value or is not a `Resource`
-
binds
boolean binds(@Nonnull java.lang.String theVar)
Return whether or not the variable is bound in this solution- Parameters:
theVar
- the var- Returns:
- true if the variable is bound, false otherwise.
-
binding
@Nonnull java.util.Optional<Binding> binding(@Nonnull java.lang.String theVar)
Optionally return the binding of the given variable- Parameters:
theVar
- the variable name- Returns:
- the binding of the var, or an empty optional if the var is not bound or not in the solution
-
-