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 rewritervoid
void
Load rule files for queries in query directory and
store them in mapboolean
indicates 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) void
setBuiltinProvider
(BuiltinProvider builtinProvider) sets the built-in provider for the rewritervoid
setProperties
(Properties prp) set propertiesvoid
setRewriterProvider
(RewriterProvider rewriterProvider) void
setStatistics
(SystemMonitor statistics) adds a system monitor which has run time data about rules.boolean
indicates 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:
IOException
SemReasonerException
-
getName
Description copied from interface:Rewriter
get the name of a rewriter -
getDescription
Description copied from interface:Rewriter
get a description for the rewriter- Specified by:
getDescription
in interfaceRewriter
- Returns:
-
readsSymbolTable
public boolean readsSymbolTable()Description copied from interface:Rewriter
indicates whether rewriter has to read the symbol table- Specified by:
readsSymbolTable
in interfaceRewriter
- Returns:
-
writesSymbolTable
public boolean writesSymbolTable()Description copied from interface:Rewriter
indicates whether rewriter modifies the symbol table- Specified by:
writesSymbolTable
in interfaceRewriter
- Returns:
-
setBuiltinProvider
Description copied from interface:Rewriter
sets the built-in provider for the rewriter- Specified by:
setBuiltinProvider
in interfaceRewriter
-
setRewriterProvider
-
getRewriterProvider
-
setStatistics
Description copied from interface:Rewriter
adds a system monitor which has run time data about rules.- Specified by:
setStatistics
in interfaceRewriter
-
setProperties
Description copied from interface:Rewriter
set properties- Specified by:
setProperties
in 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:Rewriter
applies the rewriter to a set of rules- Specified by:
rewrite
in interfaceRewriter
- Parameters:
idb
- , intensional databaseedbs
- , extensional databases, the last one is used for snapshot transaction datasymbolTable
- , symbol tabledatatypes
- , the external datatypesconfig
- , configuration- Returns:
- Throws:
InterruptedException
RewriterException
IOException
SemReasonerException
-