Interface TripleConstraint

All Superinterfaces:
Predicate<org.apache.jena.graph.Triple>
All Known Implementing Classes:
TripleConstraintImpl

public interface TripleConstraint extends Predicate<org.apache.jena.graph.Triple>
This class captures a single triple pattern with a filter expression which in algebraic terms corresponds to OpFilter(OpTriple(?s ?p ?o), expr). The expression may only refer to variables mentioned in the pattern. The pattern may make use of variables and concrete rdf terms. Hence, semantically equivalent constraints can be expressed in different ways - e.g. { ?s ?p ?o . FILTER (?p = CONST) } == { ?s CONST ?o } This class can act as a predicate that can be evaluated for given individual (concrete) triples. The sparql expression allows obtaining the set of matching triples for any a local or remote RDF graph.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.jena.sparql.expr.Expr
    An expression which only allows a subset of the variables ?s ?p and ?o
    org.apache.jena.graph.Triple
    A possibly (less selective) representation of the constraint as a match triple suitable for pre-filtering using Graph.find(Triple) Must never return null.
    boolean
    True if getMatchTriple() matches the same set of triples as getExpr().

    Methods inherited from interface java.util.function.Predicate

    and, negate, or, test
  • Method Details

    • getMatchTriple

      org.apache.jena.graph.Triple getMatchTriple()
      A possibly (less selective) representation of the constraint as a match triple suitable for pre-filtering using Graph.find(Triple) Must never return null. The most unselective triple pattern is Triple.createMatch(null, null, null).
      Returns:
    • isMatchTripleExhaustive

      boolean isMatchTripleExhaustive()
      True if getMatchTriple() matches the same set of triples as getExpr().
    • getExpr

      org.apache.jena.sparql.expr.Expr getExpr()
      An expression which only allows a subset of the variables ?s ?p and ?o