Class TripleUtils
java.lang.Object
se.liu.ida.hefquin.jenaext.graph.TripleUtils
This class provides useful functionality
related to Jena's
Triple
class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getNumberOfTermMentions
(org.apache.jena.graph.Triple tp) Assuming the givenTriple
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 givenTriple
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 givenTriple
is a triple pattern, this function returns the set of variables contained in this triple pattern.
-
Constructor Details
-
TripleUtils
public TripleUtils()
-
-
Method Details
-
getNumberOfVarMentions
public static int getNumberOfVarMentions(org.apache.jena.graph.Triple tp) Assuming the givenTriple
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 givenTriple
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 givenTriple
is a triple pattern, this function returns the set of variables contained in this triple pattern.
-