Class TripleFilter

java.lang.Object
org.aksw.jenax.arq.util.triple.TripleFilter
All Implemented Interfaces:
Predicate<org.apache.jena.graph.Triple>

public class TripleFilter extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.jena.sparql.expr.ExprList
    A conjunction of expressions
    protected boolean
    If isForward is true then the subject acts as the source and the object as the target.
    protected org.apache.jena.graph.Triple
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TripleFilter(org.apache.jena.graph.Triple triplePattern, org.apache.jena.sparql.expr.ExprList exprs, boolean isForward)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    bind(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)
     
    create(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.ExprList
     
    org.apache.jena.graph.Node
     
    org.apache.jena.graph.Node
     
    org.apache.jena.graph.Triple
     
    boolean
     
    boolean
    test(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.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Field Details

    • triplePattern

      protected org.apache.jena.graph.Triple triplePattern
    • exprs

      protected org.apache.jena.sparql.expr.ExprList exprs
      A conjunction of expressions
    • isForward

      protected boolean isForward
      If 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

      public Boolean evalExpr(org.apache.jena.graph.Triple triple)
    • bind

      public TripleFilter bind(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. the given binding.
    • bindSource

      public TripleFilter bindSource(org.apache.jena.graph.Node value)
    • bindTarget

      public TripleFilter bindTarget(org.apache.jena.graph.Node value)
    • toConstraint

      public TripleConstraint 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)
      Specified by:
      test in interface Predicate<org.apache.jena.graph.Triple>
    • toString

      public String toString()
      Overrides:
      toString in class Object