Package org.aksw.jenax.arq.util.triple
Class TripleFilter
java.lang.Object
org.aksw.jenax.arq.util.triple.TripleFilter
- All Implemented Interfaces:
Predicate<org.apache.jena.graph.Triple>
A single triple pattern combined with a filter and a direction.
Corresponds to a specification of a set of triples which can be executed via
Stream.stream(graph.find(triplePattern)).filter(filter::test).-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.jena.sparql.expr.ExprListA conjunction of expressionsprotected booleanIf isForward is true then the subject acts as the source and the object as the target.protected org.apache.jena.graph.Triple -
Constructor Summary
ConstructorsConstructorDescriptionTripleFilter(org.apache.jena.graph.Triple triplePattern, org.apache.jena.sparql.expr.ExprList exprs, boolean isForward) -
Method Summary
Modifier and TypeMethodDescriptionbind(org.apache.jena.sparql.engine.binding.Binding binding) Create a new TripleFilter with the variables in the triple pattern and the expression substituted w.r.t.bindSource(org.apache.jena.graph.Node value) bindTarget(org.apache.jena.graph.Node value) static TripleFiltercreate(org.apache.jena.graph.Node source, org.apache.jena.graph.Node predicate, boolean isForward) evalExpr(org.apache.jena.graph.Triple triple) org.apache.jena.sparql.expr.ExprListgetExprs()org.apache.jena.graph.Nodeorg.apache.jena.graph.Nodeorg.apache.jena.graph.Triplebooleanbooleantest(org.apache.jena.graph.Triple triple) A convenience shorthand for toConstraint().test(triple)Convert this object to a slightly simplified representation which loses the 'direction' information.toString()
-
Field Details
-
triplePattern
protected org.apache.jena.graph.Triple triplePattern -
exprs
protected org.apache.jena.sparql.expr.ExprList exprsA conjunction of expressions -
isForward
protected boolean isForwardIf isForward is true then the subject acts as the source and the object as the target. otherwise its vice versa.
-
-
Constructor Details
-
TripleFilter
public TripleFilter(org.apache.jena.graph.Triple triplePattern, org.apache.jena.sparql.expr.ExprList exprs, boolean isForward)
-
-
Method Details
-
create
public static TripleFilter create(org.apache.jena.graph.Node source, org.apache.jena.graph.Node predicate, boolean isForward) -
getSource
public org.apache.jena.graph.Node getSource() -
getTarget
public org.apache.jena.graph.Node getTarget() -
getTriplePattern
public org.apache.jena.graph.Triple getTriplePattern() -
getExprs
public org.apache.jena.sparql.expr.ExprList getExprs() -
isForward
public boolean isForward() -
evalExpr
-
bind
Create a new TripleFilter with the variables in the triple pattern and the expression substituted w.r.t. the given binding. -
bindSource
-
bindTarget
-
toConstraint
Convert this object to a slightly simplified representation which loses the 'direction' information.- Returns:
-
test
public boolean test(org.apache.jena.graph.Triple triple) A convenience shorthand for toConstraint().test(triple) -
toString
-