Class RelationMapBuilder
- java.lang.Object
-
- org.eclipse.rdf4j.spring.dao.support.RelationMapBuilder
-
public class RelationMapBuilder extends Object
- Since:
- 4.0.0
- Author:
- Florian Kleedorfer
-
-
Field Summary
Fields Modifier and Type Field Description static Variable
_relObject
static Variable
_relSubject
-
Constructor Summary
Constructors Constructor Description RelationMapBuilder(RDF4JTemplate rdf4JTemplate, IRI predicate)
RelationMapBuilder(RDF4JTemplate rdf4JTemplate, RdfPredicate predicate)
-
Method Summary
-
-
-
Constructor Detail
-
RelationMapBuilder
public RelationMapBuilder(RDF4JTemplate rdf4JTemplate, RdfPredicate predicate)
-
RelationMapBuilder
public RelationMapBuilder(RDF4JTemplate rdf4JTemplate, IRI predicate)
-
-
Method Detail
-
constraints
public RelationMapBuilder constraints(GraphPattern... constraints)
Constrains the result iff theGraphPattern
contains the variables_relSubject
and/or_relObject
, which are the variables in the triple with theRdfPredicate
specified in the constructor.
-
relationIsOptional
public RelationMapBuilder relationIsOptional()
Indicates that the existence of the triple is not required, allowing to use the constraints to select certain subjects and to answer the mapping to an empty Set in thebuildOneToMany()
case andNOTHING
in thebuildOneToOne()
case.- Returns:
- the builder
-
useRelationObjectAsKey
public RelationMapBuilder useRelationObjectAsKey()
Indicates that the builder should use the triple's object for the key in the resultingMap
instead of the subject (the default).
-
buildOneToOne
public Map<IRI,IRI> buildOneToOne()
Builds a One-to-One Map using the configuration of this builder. Throws an Exception if more than one values are found for a given key. IfisRelationOptional
istrue
and no triple is found for the key,NOTHING
is set as the value.
-
buildOneToMany
public Map<IRI,Set<IRI>> buildOneToMany()
Builds a One-to-Many Map using the configuration of this builder.
-
withBinding
public RelationMapBuilder withBinding(Variable key, Value value)
-
withBinding
public RelationMapBuilder withBinding(String key, Value value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(Variable key, Value value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(String key, Value value)
-
withBinding
public RelationMapBuilder withBinding(Variable key, IRI value)
-
withBinding
public RelationMapBuilder withBinding(String key, IRI value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(Variable key, IRI value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(Variable key, String value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(String key, IRI value)
-
withBinding
public RelationMapBuilder withBinding(Variable key, String value)
-
withBinding
public RelationMapBuilder withBinding(String key, String value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(String key, String value)
-
withBinding
public RelationMapBuilder withBinding(Variable key, Integer value)
-
withBinding
public RelationMapBuilder withBinding(String key, Integer value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(Variable key, Integer value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(String key, Integer value)
-
withBinding
public RelationMapBuilder withBinding(Variable key, Boolean value)
-
withBinding
public RelationMapBuilder withBinding(String key, Boolean value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(Variable key, Boolean value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(String key, Boolean value)
-
withBinding
public RelationMapBuilder withBinding(Variable key, Float value)
-
withBinding
public RelationMapBuilder withBinding(String key, Float value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(Variable key, Float value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(String key, Float value)
-
withBinding
public RelationMapBuilder withBinding(Variable key, Double value)
-
withBinding
public RelationMapBuilder withBinding(String key, Double value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(Variable var, Double value)
-
withBindingMaybe
public RelationMapBuilder withBindingMaybe(String key, Double value)
-
-