Class BGPImpl
java.lang.Object
se.liu.ida.hefquin.base.query.impl.BGPImpl
-
Constructor Summary
ConstructorsConstructorDescriptionBGPImpl()
BGPImpl
(Set<TriplePattern> tps) BGPImpl
(org.apache.jena.sparql.core.BasicPattern pattern) BGPImpl
(org.apache.jena.sparql.core.PathBlock pattern) Assumes that the givenPathBlock
does not contain property path patterns (but only triple patterns).BGPImpl
(org.apache.jena.sparql.syntax.ElementPathBlock pattern) Assumes that the givenElementPathBlock
does not contain property path patterns (but only triple patterns).BGPImpl
(BGP otherBGP, TriplePattern tp) BGPImpl
(TriplePattern tp, BGP otherBGP) BGPImpl
(TriplePattern tp, TriplePattern... tps) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.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.Returns an unmodifiable set of triple patterns.int
hashCode()
static SPARQLGraphPattern
Merges the given BGP into the given graph pattern.Return a BGP that contains all triple patterns of this BGP 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.Returns a BGP that contains all triple patterns of this BGP plus the given triple pattern.toString()
Returns a string representation of the BGPMethods 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
-
Constructor Details
-
BGPImpl
public BGPImpl() -
BGPImpl
-
BGPImpl
-
BGPImpl
-
BGPImpl
-
BGPImpl
-
BGPImpl
-
BGPImpl
public BGPImpl(org.apache.jena.sparql.core.BasicPattern pattern) -
BGPImpl
public BGPImpl(org.apache.jena.sparql.syntax.ElementPathBlock pattern) Assumes that the givenElementPathBlock
does not contain property path patterns (but only triple patterns). If it does, this methods throws anIllegalArgumentException
. -
BGPImpl
public BGPImpl(org.apache.jena.sparql.core.PathBlock pattern) Assumes that the givenPathBlock
does not contain property path patterns (but only triple patterns). If it does, this methods throws anIllegalArgumentException
.
-
-
Method Details
-
getTriplePatterns
Description copied from interface:BGP
Returns an unmodifiable set of triple patterns.- Specified by:
getTriplePatterns
in interfaceBGP
-
addTriplePattern
-
toString
-
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 BGP 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 interfaceBGP
- Specified by:
applySolMapToGraphPattern
in interfaceSPARQLGraphPattern
- 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:BGP
Returns a BGP that contains all triple patterns of this BGP plus the given triple pattern. This method is a more specific version ofSPARQLGraphPattern.mergeWith(SPARQLGraphPattern)
. -
mergeWith
Description copied from interface:BGP
Return a BGP that contains all triple patterns of this BGP plus all triple patterns of the given BGP. This method is a more specific version ofSPARQLGraphPattern.mergeWith(SPARQLGraphPattern)
. -
merge
Merges the given BGP into the given graph pattern. If the given graph pattern is also a BGP, then the resulting graph pattern is a BGP that is the union of the two given BGPs. Otherwise, the resulting graph pattern is the given graph pattern with the BGP joined into it.
-