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.TripleReturns a representation of this triple pattern as an object of the classTripleof the Jena API.booleanReturns 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.intReturns 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).intReturns 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.inthashCode()static SPARQLGraphPatternmerge(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.intReturns 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, waitMethods 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:TriplePatternReturns a representation of this triple pattern as an object of the classTripleof the Jena API.- Specified by:
 asJenaTriplein interfaceTriplePattern
 - 
numberOfVars
public int numberOfVars()Description copied from interface:TriplePatternReturns the number of distinct variables in this triple pattern.- Specified by:
 numberOfVarsin interfaceTriplePattern
 - 
toString
Description copied from interface:TriplePatternReturns a string representation of the triple- Specified by:
 toStringin interfaceTriplePattern- Overrides:
 toStringin classObject
 - 
equals
 - 
hashCode
 - 
getAllMentionedTPs
Description copied from interface:SPARQLGraphPatternReturns a set of all triple patterns that are contained within this graph pattern.- Specified by:
 getAllMentionedTPsin interfaceSPARQLGraphPattern
 - 
getCertainVariables
Description copied from interface:SPARQLGraphPatternReturns the variables that are guaranteed to be bound in every solution mapping produced for this graph pattern.- Specified by:
 getCertainVariablesin interfaceSPARQLGraphPattern
 - 
getPossibleVariables
Description copied from interface:SPARQLGraphPatternReturns 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:
 getPossibleVariablesin interfaceSPARQLGraphPattern
 - 
getAllMentionedVariables
Description copied from interface:SPARQLGraphPatternReturns 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:
 getAllMentionedVariablesin interfaceSPARQLGraphPattern
 - 
getNumberOfVarMentions
public int getNumberOfVarMentions()Description copied from interface:SPARQLGraphPatternReturns 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:
 getNumberOfVarMentionsin interfaceSPARQLGraphPattern
 - 
getNumberOfTermMentions
public int getNumberOfTermMentions()Description copied from interface:SPARQLGraphPatternReturns 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:
 getNumberOfTermMentionsin interfaceSPARQLGraphPattern
 - 
applySolMapToGraphPattern
public TriplePattern applySolMapToGraphPattern(SolutionMapping sm) throws VariableByBlankNodeSubstitutionException Description copied from interface:SPARQLGraphPatternApplies 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:
 applySolMapToGraphPatternin interfaceSPARQLGraphPattern- Specified by:
 applySolMapToGraphPatternin interfaceTriplePattern- Throws:
 VariableByBlankNodeSubstitutionException- if one of the variables would be replaced by a blank node
 - 
mergeWith
Description copied from interface:SPARQLGraphPatternMerges this graph pattern with the given graph pattern, using join semantics, and returns the resulting, merged pattern.- Specified by:
 mergeWithin interfaceSPARQLGraphPattern
 - 
mergeWith
Description copied from interface:TriplePatternReturns 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:
 mergeWithin interfaceTriplePattern
 - 
mergeWith
Description copied from interface:TriplePatternReturn 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:
 mergeWithin 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. 
 -