Class TripleUtils

java.lang.Object
se.liu.ida.hefquin.jenaext.graph.TripleUtils

public class TripleUtils extends Object
This class provides useful functionality related to Jena's Triple class.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getNumberOfTermMentions(org.apache.jena.graph.Triple tp)
    Assuming the given Triple is a triple pattern, this function returns the number of times any RDF term is mentioned in this triple pattern.
    static int
    getNumberOfVarMentions(org.apache.jena.graph.Triple tp)
    Assuming the given Triple is a triple pattern, this function returns the number of times any variable is mentioned in this triple pattern.
    static Set<org.apache.jena.sparql.core.Var>
    getVariablesInPattern(org.apache.jena.graph.Triple tp)
    Assuming the given Triple is a triple pattern, this function returns the set of variables contained in this triple pattern.

    Methods inherited from class java.lang.Object

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

    • TripleUtils

      public TripleUtils()
  • Method Details

    • getNumberOfVarMentions

      public static int getNumberOfVarMentions(org.apache.jena.graph.Triple tp)
      Assuming the given Triple is a triple pattern, this function returns the number of times any variable is mentioned in this triple pattern. If the same variable is mentioned multiple times, then each of these mentions is counted.
    • getNumberOfTermMentions

      public static int getNumberOfTermMentions(org.apache.jena.graph.Triple tp)
      Assuming the given Triple is a triple pattern, this function returns the number of times any RDF term is mentioned in this triple pattern. If the same term is mentioned multiple times, then each of these mentions is counted.
    • getVariablesInPattern

      public static Set<org.apache.jena.sparql.core.Var> getVariablesInPattern(org.apache.jena.graph.Triple tp)
      Assuming the given Triple is a triple pattern, this function returns the set of variables contained in this triple pattern.