Interface SPARQLGraphPattern

All Superinterfaces:
Query
All Known Subinterfaces:
BGP, SPARQLGroupPattern, SPARQLServicePattern, SPARQLUnionPattern, TriplePattern
All Known Implementing Classes:
BGPImpl, GenericSPARQLGraphPatternImpl1, GenericSPARQLGraphPatternImpl2, SPARQLGroupPatternImpl, SPARQLUnionPatternImpl, StarPattern, TriplePatternImpl

public interface SPARQLGraphPattern extends Query
This interface represents any kind of SPARQL query pattern.
  • Method Summary

    Modifier and Type
    Method
    Description
    Applies the given solution mapping to this graph pattern and returns the resulting graph pattern in which all occurrences of the variables bound by the given solution mapping are replaced by the RDF terms that the solution mappings assigns to these variables.
    Returns a set of all triple patterns that are contained within this graph pattern.
    Set<org.apache.jena.sparql.core.Var>
    Returns the set of all variables mentioned in this graph pattern, except for the variables that occur only in expressions (in FILTER or in BIND).
    Set<org.apache.jena.sparql.core.Var>
    Returns the variables that are guaranteed to be bound in every solution mapping produced for this graph pattern.
    Returns the sets of variables that can be expected in the solution mappings produced for this graph pattern.
    int
    Returns the number of times any RDF term is mentioned in this graph pattern (if the same term is mentioned multiple times, then each of these mentions is counted), but ignores terms mentions in expressions (in FILTER or in BIND).
    int
    Returns the number of times any variable is mentioned in this graph pattern (if the same variable is mentioned multiple times, then each of these mentions is counted), but ignores variable mentions in expressions (in FILTER or in BIND).
    Set<org.apache.jena.sparql.core.Var>
    Returns the variables that may be bound in solution mappings produced for this graph pattern, but that are not guaranteed to be bound in every such solution mapping.
    mergeWith(org.apache.jena.sparql.core.VarExprList exprs)
    Merges this graph pattern with BIND clauses that use the given expressions and returns the resulting, merged pattern.
    mergeWith(org.apache.jena.sparql.expr.ExprList exprs)
    Merges this graph pattern with FILTERS that use the given expressions and returns the resulting, merged pattern.
    Merges this graph pattern with the given graph pattern, using join semantics, and returns the resulting, merged pattern.
  • Method Details

    • getAllMentionedTPs

      Set<TriplePattern> getAllMentionedTPs()
      Returns a set of all triple patterns that are contained within this graph pattern.
    • getAllMentionedVariables

      Set<org.apache.jena.sparql.core.Var> getAllMentionedVariables()
      Returns the set of all variables mentioned in this graph pattern, except for the variables that occur only in expressions (in FILTER or in BIND).
    • getCertainVariables

      Set<org.apache.jena.sparql.core.Var> getCertainVariables()
      Returns the variables that are guaranteed to be bound in every solution mapping produced for this graph pattern.
    • getPossibleVariables

      Set<org.apache.jena.sparql.core.Var> getPossibleVariables()
      Returns the variables that may be bound in solution mappings produced for this graph pattern, but that are not guaranteed to be bound in every such solution mapping.
    • getExpectedVariables

      default ExpectedVariables getExpectedVariables()
      Returns the sets of variables that can be expected in the solution mappings produced for this graph pattern. It holds that the ExpectedVariables.getCertainVariables() and the ExpectedVariables.getPossibleVariables() methods of the returned object return the same sets as returned by getCertainVariables() and getPossibleVariables(), respectively.
    • getNumberOfVarMentions

      int getNumberOfVarMentions()
      Returns the number of times any variable is mentioned in this graph pattern (if the same variable is mentioned multiple times, then each of these mentions is counted), but ignores variable mentions in expressions (in FILTER or in BIND).
    • getNumberOfTermMentions

      int getNumberOfTermMentions()
      Returns the number of times any RDF term is mentioned in this graph pattern (if the same term is mentioned multiple times, then each of these mentions is counted), but ignores terms mentions in expressions (in FILTER or in BIND).
    • applySolMapToGraphPattern

      Applies the given solution mapping to this graph pattern and returns the resulting graph pattern in which all occurrences of the variables bound by the given solution mapping are replaced by the RDF terms that the solution mappings assigns to these variables.
      Throws:
      VariableByBlankNodeSubstitutionException - if one of the variables would be replaced by a blank node
    • mergeWith

      Merges this graph pattern with the given graph pattern, using join semantics, and returns the resulting, merged pattern.
    • mergeWith

      default SPARQLGraphPattern mergeWith(org.apache.jena.sparql.expr.ExprList exprs)
      Merges this graph pattern with FILTERS that use the given expressions and returns the resulting, merged pattern.
    • mergeWith

      default SPARQLGraphPattern mergeWith(org.apache.jena.sparql.core.VarExprList exprs)
      Merges this graph pattern with BIND clauses that use the given expressions and returns the resulting, merged pattern.