Package com.semedy.reasoner.core
Class QueryHandler
java.lang.Object
com.semedy.reasoner.core.QueryHandler
- All Implemented Interfaces:
Rewriter
Query handler manages queries.
It gets an idb containing queries as input and
creates a (modified) idb as output.
So it's quite similar to a rewriter, BUT
it stores idbs on disk, manages rewriting etc.
So it is a kind of meta rewriter.
Storing idbs on disk allows to modify the rule body sequence
manually which is often crucial for performance.
It gets an idb containing queries as input and
creates a (modified) idb as output.
So it's quite similar to a rewriter, BUT
it stores idbs on disk, manages rewriting etc.
So it is a kind of meta rewriter.
Storing idbs on disk allows to modify the rule body sequence
manually which is often crucial for performance.
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionQueryHandler(BuiltinProvider builtins, RewriterProvider rewriters, SymbolTable symbols, ExternalDataTypeProvider datatypes, String queryDir) -
Method Summary
Modifier and TypeMethodDescriptionapplyRewriter(IntensionalDB input, ExtensionalDB[] edbs, SymbolTable symbols, ExternalDataTypeProvider datatypes, Configuration config, boolean withMagicSets, Properties builtinConfig) get a description for the rewritergetName()get the name of a rewritervoidvoidLoad rule files for queries in query directory and
store them in mapbooleanindicates whether rewriter has to read the symbol tablerewrite(IntensionalDB idb, ExtensionalDB[] edbs, SymbolTable symbolTable, ExternalDataTypeProvider datatypes, Configuration config) applies the rewriter to a set of rulesrewrite(IntensionalDB idb, ExtensionalDB[] edbs, SymbolTable symbols, ExternalDataTypeProvider datatypes, Configuration config, Properties builtinConfig) voidsetBuiltinProvider(BuiltinProvider builtinProvider) sets the built-in provider for the rewritervoidsetProperties(Properties prp) set propertiesvoidsetRewriterProvider(RewriterProvider rewriterProvider) voidsetStatistics(SystemMonitor statistics) adds a system monitor which has run time data about rules.booleanindicates whether rewriter modifies the symbol table
-
Constructor Details
-
QueryHandler
public QueryHandler(BuiltinProvider builtins, RewriterProvider rewriters, SymbolTable symbols, ExternalDataTypeProvider datatypes, String queryDir)
-
-
Method Details
-
loadQueries
Load rule files for queries in query directory and
store them in map- Throws:
IOExceptionSemReasonerException
-
getName
Description copied from interface:Rewriterget the name of a rewriter -
getDescription
Description copied from interface:Rewriterget a description for the rewriter- Specified by:
getDescriptionin interfaceRewriter- Returns:
-
readsSymbolTable
public boolean readsSymbolTable()Description copied from interface:Rewriterindicates whether rewriter has to read the symbol table- Specified by:
readsSymbolTablein interfaceRewriter- Returns:
-
writesSymbolTable
public boolean writesSymbolTable()Description copied from interface:Rewriterindicates whether rewriter modifies the symbol table- Specified by:
writesSymbolTablein interfaceRewriter- Returns:
-
setBuiltinProvider
Description copied from interface:Rewritersets the built-in provider for the rewriter- Specified by:
setBuiltinProviderin interfaceRewriter
-
setRewriterProvider
-
getRewriterProvider
-
setStatistics
Description copied from interface:Rewriteradds a system monitor which has run time data about rules.- Specified by:
setStatisticsin interfaceRewriter
-
setProperties
Description copied from interface:Rewriterset properties- Specified by:
setPropertiesin interfaceRewriter
-
rewrite
public IntensionalDB rewrite(IntensionalDB idb, ExtensionalDB[] edbs, SymbolTable symbols, ExternalDataTypeProvider datatypes, Configuration config, Properties builtinConfig) throws InterruptedException, RewriterException, IOException -
applyRewriter
public IntensionalDB applyRewriter(IntensionalDB input, ExtensionalDB[] edbs, SymbolTable symbols, ExternalDataTypeProvider datatypes, Configuration config, boolean withMagicSets, Properties builtinConfig) throws InterruptedException, IOException, SemReasonerException -
invalidateQueries
public void invalidateQueries() -
rewrite
public IntensionalDB rewrite(IntensionalDB idb, ExtensionalDB[] edbs, SymbolTable symbolTable, ExternalDataTypeProvider datatypes, Configuration config) throws InterruptedException, RewriterException, IOException, SemReasonerException Description copied from interface:Rewriterapplies the rewriter to a set of rules- Specified by:
rewritein interfaceRewriter- Parameters:
idb- , intensional databaseedbs- , extensional databases, the last one is used for snapshot transaction datasymbolTable- , symbol tabledatatypes- , the external datatypesconfig- , configuration- Returns:
- Throws:
InterruptedExceptionRewriterExceptionIOExceptionSemReasonerException
-