Class QueryProcessor
java.lang.Object
net.ontopia.topicmaps.query.impl.basic.AbstractQueryProcessor
net.ontopia.topicmaps.query.impl.basic.QueryProcessor
- All Implemented Interfaces:
IndexIF,QueryProcessorIF
INTERNAL: This query processor implementation can be used to query any topic
map implementation; it makes no assumptions about the stored form of the
topic map.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collatorprotected TologOptionsprotected TologParserprotected TopicMapIF -
Constructor Summary
ConstructorsConstructorDescriptionQueryProcessor(TopicMapIF topicmap) QueryProcessor(TopicMapIF topicmap, LocatorIF base) -
Method Summary
Modifier and TypeMethodDescriptioncount(TologQuery query, QueryMatches matches) INTERNAL: Replaces count($A) variables by their relevant counts.createInitialMatches(TologQuery query, Collection items, Map arguments) createInitialMatches(TologQuery query, Map arguments) PUBLIC: Parses and executes the query, returning the results.PUBLIC: Parses and executes the query binding the parameters in the query to the values given in the 'arguments' map, returning the results.execute(String query, Map arguments, DeclarationContextIF context) PUBLIC: Parses and executes the query in the given context binding the parameters in the query to the values given in the 'arguments' map, returning the results.execute(String query, DeclarationContextIF context) PUBLIC: Parses and executes the query in the given context, returning the results.execute(TologQuery query) execute(TologQuery query, Map arguments) voidDEPRECATED: Loads a set of rules into the query processor from a reader object.voidDEPRECATED: Loads a set of rules into the query processor from a string.PUBLIC: Parses the query, returning an object representing the result.parse(String query, DeclarationContextIF context) PUBLIC: Parses the query in the given context, returning an object representing the result.protected TologQueryparseQuery(String query, DeclarationContextIF context) parseUpdate(String statement) PUBLIC: Parses the update statement, returning an object representing the result.parseUpdate(String statement, DeclarationContextIF context) PUBLIC: Parses the update statement in the given context, returning an object representing the result.protected ModificationStatementparseUpdateStatement(String statement, DeclarationContextIF ctx) reduce(TologQuery query, QueryMatches matches) INTERNAL: Projects the query results onto the set of variables specified in the 'select' clause.protected intrunUpdate(ModificationStatement statement, Map<String, ?> params) voidsort(TologQuery query, QueryMatches matches) INTERNAL: Sorts the query result as requested.intPUBLIC: Runs the update statement, returning the number of modified objects.intPUBLIC: Runs the update statement with the given parameters, returning the number of modified objects.intupdate(String query, Map<String, ?> params, DeclarationContextIF context) PUBLIC: Runs the update statement in the given declaration context with the given parameters, returning the number of modified objects.intupdate(String query, DeclarationContextIF context) PUBLIC: Runs the update statement in the given declaration context, returning the number of modified objects.Methods inherited from class net.ontopia.topicmaps.query.impl.basic.AbstractQueryProcessor
findClauseItems, findClauseVariables, satisfy
-
Field Details
-
topicmap
-
collator
-
options
-
parser
-
-
Constructor Details
-
QueryProcessor
-
QueryProcessor
-
-
Method Details
-
getOptions
-
execute
Description copied from interface:QueryProcessorIFPUBLIC: Parses and executes the query, returning the results.- Specified by:
executein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
execute
public QueryResultIF execute(String query, DeclarationContextIF context) throws InvalidQueryException Description copied from interface:QueryProcessorIFPUBLIC: Parses and executes the query in the given context, returning the results.- Specified by:
executein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
execute
Description copied from interface:QueryProcessorIFPUBLIC: Parses and executes the query binding the parameters in the query to the values given in the 'arguments' map, returning the results.- Specified by:
executein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
execute
public QueryResultIF execute(String query, Map arguments, DeclarationContextIF context) throws InvalidQueryException Description copied from interface:QueryProcessorIFPUBLIC: Parses and executes the query in the given context binding the parameters in the query to the values given in the 'arguments' map, returning the results.- Specified by:
executein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parse
Description copied from interface:QueryProcessorIFPUBLIC: Parses the query, returning an object representing the result.- Specified by:
parsein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parse
Description copied from interface:QueryProcessorIFPUBLIC: Parses the query in the given context, returning an object representing the result.- Specified by:
parsein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parseQuery
protected TologQuery parseQuery(String query, DeclarationContextIF context) throws InvalidQueryException - Throws:
InvalidQueryException
-
load
Description copied from interface:QueryProcessorIFDEPRECATED: Loads a set of rules into the query processor from a string. The rules will then be available for use in queries throughout the lifetime of the current scope.- Specified by:
loadin interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
load
Description copied from interface:QueryProcessorIFDEPRECATED: Loads a set of rules into the query processor from a reader object. The rules will then be available for use in queries throughout the lifetime of the current scope.- Specified by:
loadin interfaceQueryProcessorIF- Throws:
InvalidQueryExceptionIOException
-
execute
- Throws:
InvalidQueryException
-
execute
- Throws:
InvalidQueryException
-
update
Description copied from interface:QueryProcessorIFPUBLIC: Runs the update statement, returning the number of modified objects.- Specified by:
updatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
update
Description copied from interface:QueryProcessorIFPUBLIC: Runs the update statement in the given declaration context, returning the number of modified objects.- Specified by:
updatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
update
Description copied from interface:QueryProcessorIFPUBLIC: Runs the update statement with the given parameters, returning the number of modified objects.- Specified by:
updatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
update
public int update(String query, Map<String, ?> params, DeclarationContextIF context) throws InvalidQueryExceptionDescription copied from interface:QueryProcessorIFPUBLIC: Runs the update statement in the given declaration context with the given parameters, returning the number of modified objects.- Specified by:
updatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parseUpdate
Description copied from interface:QueryProcessorIFPUBLIC: Parses the update statement, returning an object representing the result.- Specified by:
parseUpdatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parseUpdate
public ParsedModificationStatementIF parseUpdate(String statement, DeclarationContextIF context) throws InvalidQueryException Description copied from interface:QueryProcessorIFPUBLIC: Parses the update statement in the given context, returning an object representing the result.- Specified by:
parseUpdatein interfaceQueryProcessorIF- Throws:
InvalidQueryException
-
parseUpdateStatement
protected ModificationStatement parseUpdateStatement(String statement, DeclarationContextIF ctx) throws InvalidQueryException - Throws:
InvalidQueryException
-
runUpdate
protected int runUpdate(ModificationStatement statement, Map<String, ?> params) throws InvalidQueryException- Throws:
InvalidQueryException
-
createInitialMatches
-
createInitialMatches
-
reduce
INTERNAL: Projects the query results onto the set of variables specified in the 'select' clause. If there is no 'select' clause nothing is done.- Parameters:
query- The parsed query.matches- The query result.
-
count
INTERNAL: Replaces count($A) variables by their relevant counts.- Parameters:
query- The parsed query.matches- The query result.
-
sort
INTERNAL: Sorts the query result as requested.- Parameters:
query- The parsed query.matches- The query result.
-