org.openanzo.glitter.query
Interface SolutionGenerator

All Known Implementing Classes:
BasicGraphSolutionGenerator, ContainerSolutionGenerator, CoreSolutionGenerator, LdapSolutionGenerator, RdbSolutionGenerator, ServerSolutionGenerator

public interface SolutionGenerator

A SolutionGenerator is a backend to the Glitter engine that knows how to generate a specific type of bindings.

Author:
lee

Method Summary
 boolean canBindGraphVariables()
          Informative method.
 boolean canHandleSimultaneousRequests()
          Informative method.
 void cleanup()
          Called after all calls to generateSolutions.
 SolutionSet generateSolutions(TreeNode node, IRIReference namedGraph, Variable namedGraphVariable, SolutionSet requiredBindings)
           
 QueryExecutionPlan getQueryExecutionPlan()
           
 QueryExecutionServices getQueryExecutionServices()
          Deprecated.  
 QueryInformation getQueryInformation()
           
 RDFDataset<?> getRDFDataset()
           
 void initialize()
          Called before any calls to generateSolutions but after all calls to set*.
 void setIncludeInferredTriples(boolean includeInferredTriples)
           
 void setOntology(java.net.URI ontology)
           
 void setQueryExecutionPlan(QueryExecutionPlan plan)
           
 void setQueryExecutionServices(QueryExecutionServices services)
          Deprecated.  
 void setQueryInformation(QueryInformation queryInformation)
           
 void setRDFDataset(RDFDataset<?> dataset)
           
 boolean sortedSolutions()
           
 boolean usesRequiredBindings()
          Informative method.
 boolean willHandleFilters(java.util.Set<Expression> filters)
          Many backends do not implement filters, in which case Glitter will filter results even if the solution generator handles a node which subsumes filters.
 

Method Detail

setRDFDataset

void setRDFDataset(RDFDataset<?> dataset)
Parameters:
dataset - The RDFDataset against which the query is being executed.

setQueryInformation

void setQueryInformation(QueryInformation queryInformation)
Parameters:
queryInformation - Information on the parsed and prepared query.

setQueryExecutionPlan

void setQueryExecutionPlan(QueryExecutionPlan plan)
Parameters:
plan - The execution plan in use.

setQueryExecutionServices

void setQueryExecutionServices(QueryExecutionServices services)
Deprecated. 

Parameters:
services -

setIncludeInferredTriples

void setIncludeInferredTriples(boolean includeInferredTriples)
Parameters:
includeInferredTriples - Whether or not inferred triples should contribute to bindings.

setOntology

void setOntology(java.net.URI ontology)
Parameters:
ontology - The ontology in effect for inferred triples.

getRDFDataset

RDFDataset<?> getRDFDataset()
Returns:
Accessor to the dataset

getQueryInformation

QueryInformation getQueryInformation()
Returns:
Accessor to the parsed query

getQueryExecutionPlan

QueryExecutionPlan getQueryExecutionPlan()
Returns:
Accessor to the execution plan

getQueryExecutionServices

QueryExecutionServices getQueryExecutionServices()
Deprecated. 

Returns:
QueryExecutionServices for this SolutionGenerator

generateSolutions

SolutionSet generateSolutions(TreeNode node,
                              IRIReference namedGraph,
                              Variable namedGraphVariable,
                              SolutionSet requiredBindings)
                              throws GlitterException
Parameters:
node - The node in the tree for which bindings are desired.
namedGraph - If not null, the solutions should be generated by matching against this graph from the named graph part of the RDF dataSet. Otherwise, the solutions should be generated from the default graph. (i.e., if not null, treat this graph as the default graph)
namedGraphVariable - If not null and this SolutionGenerator returns true for canBindGraphVariables(), then this is the variable that should be bound to the named graph IRI from which solutions are found.
requiredBindings - Known bindings at this point in the AST. Every returned solution should be a superset of one solution from the required bindings. (That is, unbound variables can be bound, but all bound variables must remain bound to the same value.) Note that Glitter enforces this constraint when combining pattern solutions. In general, if generateSolutions returns a value (null or otherwise), then the SolutionGenerator will not be called again for any descendants of node. If an exception is thrown, then generateSolution may be called for descendant (simpler) nodes.
Returns:
A list of bindings (for variables and blank nodes) that satisfy the given tree node, or null if this pattern doesn't match.
Throws:
GlitterException
CannotGenerateSolutionsException - if the SolutionGenerator does not wish to handle this tree node.

initialize

void initialize()
                throws GlitterException
Called before any calls to generateSolutions but after all calls to set*.

Throws:
GlitterException

cleanup

void cleanup()
             throws GlitterException
Called after all calls to generateSolutions.

Throws:
GlitterException

usesRequiredBindings

boolean usesRequiredBindings()
Informative method.

Returns:
Whether or not this backend makes use of known constraints passed in when generating solutions.

canHandleSimultaneousRequests

boolean canHandleSimultaneousRequests()
Informative method.

Returns:
Whether or not this backend can handle multiple requests in parallel.

canBindGraphVariables

boolean canBindGraphVariables()
Informative method.

Returns:
Whether or not this backend can range over a graph variable and bind the variable to the appropriate graphs from the named graph part of the RDFDataset

willHandleFilters

boolean willHandleFilters(java.util.Set<Expression> filters)
Many backends do not implement filters, in which case Glitter will filter results even if the solution generator handles a node which subsumes filters. (Other than an OPTIONAL -- a solution generator should only handle an OPTIONAL that includes a filter if it can handle the filter.)

Parameters:
filters -
Returns:
true if the solution generator will take care of these filters on any nodes that it sees, false if Glitter should handle the filters.

sortedSolutions

boolean sortedSolutions()
Returns:
whether or not the generator sorts returned solutions as per any ORDER BY information


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