org.openanzo.glitter.query
Interface PatternSolution

All Superinterfaces:
java.lang.Comparable<PatternSolution>
All Known Implementing Classes:
PatternSolutionImpl

public interface PatternSolution
extends java.lang.Comparable<PatternSolution>

See http://www.w3.org/TR/rdf-sparql-query/#PatternSolutions A pattern solution is a potential single row in a result set. It maps variables as well as blank nodes (Bindable objets) to RDF terms.

Author:
Lee

Method Summary
 PatternSolution conjoin(PatternSolution other)
          See: http://wiki.atg.ibm.com/index.php?title=SPARQL_algebra#Conjunction
 RDFTerm getBinding(Bindable variable)
          Returns the binding for the given variable or blank node.
 java.util.Map<Bindable,RDFTerm> getBindings()
           
 java.util.Collection<Bindable> getBoundDomain(boolean sort)
          Returns the domain of variables and blank nodes in this solution.
 Bindable[] getBoundDomainArray()
           
 java.util.Collection<Variable> getBoundVariables()
          As in getBoundDomain(boolean) with a false argument, but only returns Variables, not BlankNodeManager.BlankNodes.
 void setBinding(Bindable variable, RDFTerm value)
          Sets a Bindable+value pair in this solution
 int size()
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getBoundDomain

java.util.Collection<Bindable> getBoundDomain(boolean sort)
Returns the domain of variables and blank nodes in this solution.

Parameters:
sort - If true, the Bindables will be sorted stably
Returns:
A (possibly-sorted) collection representing the bound variables and blank nodes in this solution

size

int size()
Returns:
The number of bindings in this solution.

getBoundDomainArray

Bindable[] getBoundDomainArray()
Returns:
the domain of variables and blank nodes in this solution as an array.

getBoundVariables

java.util.Collection<Variable> getBoundVariables()
As in getBoundDomain(boolean) with a false argument, but only returns Variables, not BlankNodeManager.BlankNodes.

Returns:
set of Variables

getBinding

RDFTerm getBinding(Bindable variable)
Returns the binding for the given variable or blank node.

Parameters:
variable -
Returns:
The value of this variable or blank node; null if the variable is not bound.

setBinding

void setBinding(Bindable variable,
                RDFTerm value)
Sets a Bindable+value pair in this solution

Parameters:
variable - The key.
value - The value.

getBindings

java.util.Map<Bindable,RDFTerm> getBindings()
Returns:
All the bindings that comprise this solution.

conjoin

PatternSolution conjoin(PatternSolution other)
                        throws java.lang.UnsupportedOperationException
See: http://wiki.atg.ibm.com/index.php?title=SPARQL_algebra#Conjunction

Parameters:
other - The second operand of the conjunction operation.
Returns:
The result of conjoining these two pattern solutions, or null if the two solutions are mutually exclusive.
Throws:
java.lang.UnsupportedOperationException - if this implementation cannot be conjoined with another.


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.