Class OpUtils

java.lang.Object
se.liu.ida.hefquin.jenaext.sparql.algebra.OpUtils

public class OpUtils extends Object
This class provides useful functionality related to Jena's Op interface and the classes that implement it.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addVariablesFromPattern(Set<org.apache.jena.sparql.core.Var> acc, org.apache.jena.sparql.algebra.Op op)
    Adds all variables mentioned in the graph pattern represented by the given operator to the given set of variables, except for the variables that occur only in expressions (in FILTER or in BIND).
    static void
    addVariablesFromPattern(Set<org.apache.jena.sparql.core.Var> acc, org.apache.jena.sparql.algebra.op.Op2 op)
    Adds all variables mentioned in the graph pattern represented by the given operator to the given set of variables, except for the variables that occur only in expressions (in FILTER or in BIND).
    static int
    getNumberOfTermMentions(org.apache.jena.sparql.algebra.Op op)
    Returns the number of times any RDF term is mentioned in the graph pattern represented by the given operator (if the same term is mentioned multiple times, then each of these mentions is counted), but ignores terms mentioned in expressions (in FILTER or in BIND).
    static int
    getNumberOfTermMentions(org.apache.jena.sparql.algebra.op.Op2 op)
    Returns the number of times any RDF term is mentioned in the graph pattern represented by the given operator (if the same term is mentioned multiple times, then each of these mentions is counted), but ignores terms mentioned in expressions (in FILTER or in BIND).
    protected static int
    getNumberOfTermMentionsFromNode(org.apache.jena.graph.Node node)
    Returns the number of times any RDF term is mentioned in the given RDF node (if the same term is mentioned multiple times, then each of these mentions is counted).
    protected static int
    getNumberOfTermMentionsFromPath(org.apache.jena.sparql.path.Path path)
    Returns the number of times any RDF term is mentioned in the given property path expression (if the same term is mentioned multiple times, then each of these mentions is counted).
    static int
    getNumberOfVarMentions(org.apache.jena.sparql.algebra.Op op)
    Returns the number of times any variable is mentioned in the graph pattern represented by the given operator (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).
    static int
    getNumberOfVarMentions(org.apache.jena.sparql.algebra.op.Op2 op)
    Returns the number of times any variable is mentioned in the graph pattern represented by the given operator (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).
    protected static int
    getNumberOfVarMentionsFromNode(org.apache.jena.graph.Node node)
    Returns the number of times any variable is mentioned in the given RDF node (if the same variable is mentioned multiple times, then each of these mentions is counted).
    static Set<org.apache.jena.sparql.core.Var>
    getVariablesInPattern(org.apache.jena.sparql.algebra.Op op)
    Returns the set of all variables mentioned in the graph pattern represented by the given operator, except for the variables that occur only in expressions (in FILTER or in BIND).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OpUtils

      public OpUtils()
  • Method Details

    • getVariablesInPattern

      public static Set<org.apache.jena.sparql.core.Var> getVariablesInPattern(org.apache.jena.sparql.algebra.Op op)
      Returns the set of all variables mentioned in the graph pattern represented by the given operator, except for the variables that occur only in expressions (in FILTER or in BIND).
    • addVariablesFromPattern

      public static void addVariablesFromPattern(Set<org.apache.jena.sparql.core.Var> acc, org.apache.jena.sparql.algebra.Op op)
      Adds all variables mentioned in the graph pattern represented by the given operator to the given set of variables, except for the variables that occur only in expressions (in FILTER or in BIND).
    • addVariablesFromPattern

      public static void addVariablesFromPattern(Set<org.apache.jena.sparql.core.Var> acc, org.apache.jena.sparql.algebra.op.Op2 op)
      Adds all variables mentioned in the graph pattern represented by the given operator to the given set of variables, except for the variables that occur only in expressions (in FILTER or in BIND).
    • getNumberOfVarMentions

      public static int getNumberOfVarMentions(org.apache.jena.sparql.algebra.Op op)
      Returns the number of times any variable is mentioned in the graph pattern represented by the given operator (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).
    • getNumberOfVarMentions

      public static int getNumberOfVarMentions(org.apache.jena.sparql.algebra.op.Op2 op)
      Returns the number of times any variable is mentioned in the graph pattern represented by the given operator (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

      public static int getNumberOfTermMentions(org.apache.jena.sparql.algebra.Op op)
      Returns the number of times any RDF term is mentioned in the graph pattern represented by the given operator (if the same term is mentioned multiple times, then each of these mentions is counted), but ignores terms mentioned in expressions (in FILTER or in BIND).
    • getNumberOfTermMentions

      public static int getNumberOfTermMentions(org.apache.jena.sparql.algebra.op.Op2 op)
      Returns the number of times any RDF term is mentioned in the graph pattern represented by the given operator (if the same term is mentioned multiple times, then each of these mentions is counted), but ignores terms mentioned in expressions (in FILTER or in BIND).
    • getNumberOfTermMentionsFromPath

      protected static int getNumberOfTermMentionsFromPath(org.apache.jena.sparql.path.Path path)
      Returns the number of times any RDF term is mentioned in the given property path expression (if the same term is mentioned multiple times, then each of these mentions is counted).
    • getNumberOfVarMentionsFromNode

      protected static int getNumberOfVarMentionsFromNode(org.apache.jena.graph.Node node)
      Returns the number of times any variable is mentioned in the given RDF node (if the same variable is mentioned multiple times, then each of these mentions is counted). If the node is a triple term, variables mentioned in the nested triple are counted recursively.
    • getNumberOfTermMentionsFromNode

      protected static int getNumberOfTermMentionsFromNode(org.apache.jena.graph.Node node)
      Returns the number of times any RDF term is mentioned in the given RDF node (if the same term is mentioned multiple times, then each of these mentions is counted). If the node is a triple term, terms mentioned in the nested triple are counted recursively.