Class GenericSPARQLGraphPatternImpl2
java.lang.Object
se.liu.ida.hefquin.base.query.impl.GenericSPARQLGraphPatternImpl2
- All Implemented Interfaces:
Query
,SPARQLGraphPattern
This class is a generic implementation of
SPARQLGraphPattern
in which this graph pattern is given as an object of the class
Op
of the Jena API.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGenericSPARQLGraphPatternImpl2
(org.apache.jena.sparql.algebra.Op jenaPatternOp) -
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.sparql.syntax.Element
Deprecated.org.apache.jena.sparql.algebra.Op
asJenaOp()
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.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.static Set
<TriplePattern> getTPsInPattern
(org.apache.jena.sparql.algebra.Op op) static Set
<TriplePattern> getTPsInPattern
(org.apache.jena.sparql.algebra.op.Op2 op) int
hashCode()
mergeWith
(SPARQLGraphPattern other) The implementation of this method is currently very simple; it just returns a newSPARQLGroupPattern
that contains both this and the given pattern.toString()
Methods 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
mergeWith, mergeWith
-
Field Details
-
jenaPatternOp
protected final org.apache.jena.sparql.algebra.Op jenaPatternOp
-
-
Constructor Details
-
GenericSPARQLGraphPatternImpl2
public GenericSPARQLGraphPatternImpl2(org.apache.jena.sparql.algebra.Op jenaPatternOp)
-
-
Method Details
-
equals
-
hashCode
-
asJenaElement
Deprecated.Avoid using this function. It converts the internalOp
object back into anElement
, which might not work correctly in all cases? -
asJenaOp
public org.apache.jena.sparql.algebra.Op asJenaOp() -
toString
-
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
-
getExpectedVariables
Description copied from interface:SPARQLGraphPattern
Returns the sets of variables that can be expected in the solution mappings produced for this graph pattern. It holds that theExpectedVariables.getCertainVariables()
and theExpectedVariables.getPossibleVariables()
methods of the returned object return the same sets as returned bySPARQLGraphPattern.getCertainVariables()
andSPARQLGraphPattern.getPossibleVariables()
, respectively.- Specified by:
getExpectedVariables
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 SPARQLGraphPattern 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
- Throws:
VariableByBlankNodeSubstitutionException
- if one of the variables would be replaced by a blank node
-
mergeWith
The implementation of this method is currently very simple; it just returns a newSPARQLGroupPattern
that contains both this and the given pattern.- Specified by:
mergeWith
in interfaceSPARQLGraphPattern
-
getTPsInPattern
-
getTPsInPattern
-