Class TriplePatternImpl
java.lang.Object
se.liu.ida.hefquin.base.query.impl.TriplePatternImpl
- All Implemented Interfaces:
Query
,SPARQLGraphPattern
,TriplePattern
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTriplePatternImpl
(org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o) TriplePatternImpl
(org.apache.jena.graph.Triple jenaObject) -
Method Summary
Modifier and TypeMethodDescriptionApplies 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.org.apache.jena.graph.Triple
Returns a representation of this triple pattern as an object of the classTriple
of the Jena API.boolean
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.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.int
hashCode()
static SPARQLGraphPattern
merge
(TriplePattern tp, org.apache.jena.sparql.syntax.Element elmt) Merges the given triple pattern into the given graph pattern.Return a BGP that contains this triple pattern plus all triple patterns of the given BGP.mergeWith
(SPARQLGraphPattern other) Merges this graph pattern with the given graph pattern, using join semantics, and returns the resulting, merged pattern.mergeWith
(TriplePattern other) Returns a BGP that contains this triple pattern plus all triple patterns of the given BGP.int
Returns the number of distinct variables in this triple pattern.toString()
Returns a string representation of the tripleMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface se.liu.ida.hefquin.base.query.SPARQLGraphPattern
getExpectedVariables, mergeWith, mergeWith
-
Field Details
-
jenaObj
protected final org.apache.jena.graph.Triple jenaObj
-
-
Constructor Details
-
TriplePatternImpl
public TriplePatternImpl(org.apache.jena.graph.Triple jenaObject) -
TriplePatternImpl
public TriplePatternImpl(org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
-
-
Method Details
-
asJenaTriple
public org.apache.jena.graph.Triple asJenaTriple()Description copied from interface:TriplePattern
Returns a representation of this triple pattern as an object of the classTriple
of the Jena API.- Specified by:
asJenaTriple
in interfaceTriplePattern
-
numberOfVars
public int numberOfVars()Description copied from interface:TriplePattern
Returns the number of distinct variables in this triple pattern.- Specified by:
numberOfVars
in interfaceTriplePattern
-
toString
Description copied from interface:TriplePattern
Returns a string representation of the triple- Specified by:
toString
in interfaceTriplePattern
- Overrides:
toString
in classObject
-
equals
-
hashCode
-
getAllMentionedTPs
Description copied from interface:SPARQLGraphPattern
Returns a set of all triple patterns that are contained within this graph pattern.- Specified by:
getAllMentionedTPs
in interfaceSPARQLGraphPattern
-
getCertainVariables
Description copied from interface:SPARQLGraphPattern
Returns the variables that are guaranteed to be bound in every solution mapping produced for this graph pattern.- Specified by:
getCertainVariables
in interfaceSPARQLGraphPattern
-
getPossibleVariables
Description copied from interface:SPARQLGraphPattern
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.- Specified by:
getPossibleVariables
in interfaceSPARQLGraphPattern
-
getAllMentionedVariables
Description copied from interface:SPARQLGraphPattern
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).- Specified by:
getAllMentionedVariables
in interfaceSPARQLGraphPattern
-
getNumberOfVarMentions
public int getNumberOfVarMentions()Description copied from interface:SPARQLGraphPattern
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).- Specified by:
getNumberOfVarMentions
in interfaceSPARQLGraphPattern
-
getNumberOfTermMentions
public int getNumberOfTermMentions()Description copied from interface:SPARQLGraphPattern
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).- Specified by:
getNumberOfTermMentions
in interfaceSPARQLGraphPattern
-
applySolMapToGraphPattern
public TriplePattern applySolMapToGraphPattern(SolutionMapping sm) throws VariableByBlankNodeSubstitutionException Description copied from interface:SPARQLGraphPattern
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.- Specified by:
applySolMapToGraphPattern
in interfaceSPARQLGraphPattern
- Specified by:
applySolMapToGraphPattern
in interfaceTriplePattern
- Throws:
VariableByBlankNodeSubstitutionException
- if one of the variables would be replaced by a blank node
-
mergeWith
Description copied from interface:SPARQLGraphPattern
Merges this graph pattern with the given graph pattern, using join semantics, and returns the resulting, merged pattern.- Specified by:
mergeWith
in interfaceSPARQLGraphPattern
-
mergeWith
Description copied from interface:TriplePattern
Returns a BGP that contains this triple pattern plus all triple patterns of the given BGP. This method is a more specific version ofSPARQLGraphPattern.mergeWith(SPARQLGraphPattern)
.- Specified by:
mergeWith
in interfaceTriplePattern
-
mergeWith
Description copied from interface:TriplePattern
Return a BGP that contains this triple pattern plus all triple patterns of the given BGP. This method is a more specific version ofSPARQLGraphPattern.mergeWith(SPARQLGraphPattern)
.- Specified by:
mergeWith
in interfaceTriplePattern
-
merge
public static SPARQLGraphPattern merge(TriplePattern tp, org.apache.jena.sparql.syntax.Element elmt) Merges the given triple pattern into the given graph pattern. If the given graph pattern is also a triple pattern or a BGP, then the resulting graph pattern is a BGP to which the triple pattern was added. Otherwise, the resulting graph pattern is the given graph pattern with the triple pattern joined into it.
-