Classes | |
class | Variable |
Public Member Functions | |
boolean | addVariable (Variable var) throws Exception |
void | checkDomains (boolean verbose) |
boolean | contains (String varName) |
Database (RelationalModel model) throws Exception | |
String | getConstantType (String constant) |
Iterable< String > | getDomain (String domName) throws Exception |
HashMap< String, HashSet < String > > | getDomains () throws Exception |
Collection< Variable > | getEntries () throws Exception |
String[][] | getEntriesAsArray () throws Exception |
RelationalModel | getModel () |
ParameterHandler | getParameterHandler () |
String[] | getParameterSet (RelationKey key, String[] keyValues) |
Signature | getSignature (String functionName) |
Variable | getVariable (String varName) |
String | getVariableValue (String varName, boolean closedWorld) throws Exception |
void | print () throws Exception |
void | printDomain (PrintStream out) |
void | readBLOGDB (String databaseFilename, boolean ignoreUndefinedNodes) throws Exception |
void | readBLOGDB (String databaseFilename) throws Exception |
void | readMLNDB (String databaseFilename, boolean ignoreUndefinedNodes) throws Exception |
void | readMLNDB (String databaseFilename) throws Exception |
void | setClosedWorldPred (String predName) throws Exception |
void | setDebug (boolean debug) |
void | setVerbose (boolean verbose) |
Public Attributes | |
RelationalModel | model |
Protected Member Functions | |
boolean | addVariable (Variable var, boolean ignoreUndefinedFunctions, boolean doPrologAssertions) throws Exception |
void | fillDomain (String type, String value) throws Exception |
boolean | getPrologValue (Signature sig, String[] args) throws Exception |
void | setClosedWorldPred (Signature sig, int i, String[] params) throws Exception |
Protected Attributes | |
boolean | debug = false |
HashMap< String, HashSet < String > > | domains |
HashMap< String, String > | entity2type |
HashMap< String, Variable > | entries |
HashMap< RelationKey, HashMap < String, String[]> > | functionalDependencies |
HashMap< String, MultiIterator < String > > | multiDomains |
ParameterHandler | paramHandler |
PrologKnowledgeBase | prolog |
Boolean | prologDatabaseExtended = false |
Taxonomy | taxonomy |
boolean | verbose = false |
represents an evidence/training database for a relational model
Definition at line 28 of file Database.java.
edu::tum::cs::srl::Database::Database | ( | RelationalModel | model | ) | throws Exception [inline] |
constructs an empty database for the given model
model |
Exception |
Definition at line 56 of file Database.java.
boolean edu::tum::cs::srl::Database::addVariable | ( | Variable | var, | |
boolean | ignoreUndefinedFunctions, | |||
boolean | doPrologAssertions | |||
) | throws Exception [inline, protected] |
Definition at line 178 of file Database.java.
boolean edu::tum::cs::srl::Database::addVariable | ( | Variable | var | ) | throws Exception [inline] |
adds the given variable to the database if it isn't already present
Definition at line 174 of file Database.java.
void edu::tum::cs::srl::Database::checkDomains | ( | boolean | verbose | ) | [inline] |
checks the domains for overlaps and merges domains if necessary
Definition at line 363 of file Database.java.
boolean edu::tum::cs::srl::Database::contains | ( | String | varName | ) | [inline] |
checks whether the database contains an entry for the given variable name
Definition at line 160 of file Database.java.
void edu::tum::cs::srl::Database::fillDomain | ( | String | type, | |
String | value | |||
) | throws Exception [inline, protected] |
adds to the domain type the given value
type | name of the domain/type | |
value | the value/entity name to add |
Exception |
Definition at line 328 of file Database.java.
String edu::tum::cs::srl::Database::getConstantType | ( | String | constant | ) | [inline] |
gets the type of the given constant by searching through the domains
constant |
Definition at line 617 of file Database.java.
Iterable<String> edu::tum::cs::srl::Database::getDomain | ( | String | domName | ) | throws Exception [inline] |
domName |
Exception |
Definition at line 400 of file Database.java.
HashMap<String, HashSet<String> > edu::tum::cs::srl::Database::getDomains | ( | ) | throws Exception [inline] |
Definition at line 601 of file Database.java.
Collection<Variable> edu::tum::cs::srl::Database::getEntries | ( | ) | throws Exception [inline] |
retrieves all entries in the database TODO Because of the prolog database extension, calling this method should render the database immutable
Exception |
Definition at line 430 of file Database.java.
String [][] edu::tum::cs::srl::Database::getEntriesAsArray | ( | ) | throws Exception [inline] |
Exception |
Definition at line 471 of file Database.java.
RelationalModel edu::tum::cs::srl::Database::getModel | ( | ) | [inline] |
Definition at line 607 of file Database.java.
ParameterHandler edu::tum::cs::srl::Database::getParameterHandler | ( | ) | [inline] |
Implements edu::tum::cs::inference::IParameterHandler.
Definition at line 653 of file Database.java.
String [] edu::tum::cs::srl::Database::getParameterSet | ( | RelationKey | key, | |
String[] | keyValues | |||
) | [inline] |
Definition at line 255 of file Database.java.
boolean edu::tum::cs::srl::Database::getPrologValue | ( | Signature | sig, | |
String[] | args | |||
) | throws Exception [inline, protected] |
computes the value of a variable via Prolog and adds it to the database
sig | ||
args |
Exception |
Definition at line 453 of file Database.java.
Signature edu::tum::cs::srl::Database::getSignature | ( | String | functionName | ) | [inline] |
Definition at line 516 of file Database.java.
Variable edu::tum::cs::srl::Database::getVariable | ( | String | varName | ) | [inline] |
retrieves a variable setting
varName | the name of the variable to retrieve |
Definition at line 153 of file Database.java.
String edu::tum::cs::srl::Database::getVariableValue | ( | String | varName, | |
boolean | closedWorld | |||
) | throws Exception [inline] |
gets a variable's value as stored in the database
varName | the name of the variable whose value is to be retrieved | |
closedWorld | whether to make the closed-world assumption, i.e. to assume that any Boolean variable for which we do not have a value is "False" |
Exception |
Definition at line 112 of file Database.java.
void edu::tum::cs::srl::Database::print | ( | ) | throws Exception [inline] |
Definition at line 526 of file Database.java.
void edu::tum::cs::srl::Database::printDomain | ( | PrintStream | out | ) | [inline] |
Definition at line 520 of file Database.java.
void edu::tum::cs::srl::Database::readBLOGDB | ( | String | databaseFilename, | |
boolean | ignoreUndefinedNodes | |||
) | throws Exception [inline] |
Definition at line 268 of file Database.java.
void edu::tum::cs::srl::Database::readBLOGDB | ( | String | databaseFilename | ) | throws Exception [inline] |
Definition at line 264 of file Database.java.
void edu::tum::cs::srl::Database::readMLNDB | ( | String | databaseFilename, | |
boolean | ignoreUndefinedNodes | |||
) | throws Exception [inline] |
Definition at line 543 of file Database.java.
void edu::tum::cs::srl::Database::readMLNDB | ( | String | databaseFilename | ) | throws Exception [inline] |
databaseFilename |
java.lang.Exception |
Definition at line 536 of file Database.java.
void edu::tum::cs::srl::Database::setClosedWorldPred | ( | Signature | sig, | |
int | i, | |||
String[] | params | |||
) | throws Exception [inline, protected] |
Definition at line 498 of file Database.java.
void edu::tum::cs::srl::Database::setClosedWorldPred | ( | String | predName | ) | throws Exception [inline] |
adds all missing values of ground atoms of the given predicate, setting them to "False". Invoke after the database has been read!
predName |
Exception |
Definition at line 490 of file Database.java.
void edu::tum::cs::srl::Database::setDebug | ( | boolean | debug | ) | [inline] |
Definition at line 92 of file Database.java.
void edu::tum::cs::srl::Database::setVerbose | ( | boolean | verbose | ) | [inline] |
Definition at line 657 of file Database.java.
boolean edu::tum::cs::srl::Database::debug = false [protected] |
Definition at line 46 of file Database.java.
HashMap<String, HashSet<String> > edu::tum::cs::srl::Database::domains [protected] |
Definition at line 35 of file Database.java.
HashMap<String, String> edu::tum::cs::srl::Database::entity2type [protected] |
Definition at line 43 of file Database.java.
HashMap<String, Variable> edu::tum::cs::srl::Database::entries [protected] |
maps variable names to Variable objects containing values
Definition at line 33 of file Database.java.
HashMap<RelationKey, HashMap<String, String[]> > edu::tum::cs::srl::Database::functionalDependencies [protected] |
Definition at line 34 of file Database.java.
Definition at line 36 of file Database.java.
HashMap<String, MultiIterator<String> > edu::tum::cs::srl::Database::multiDomains [protected] |
Definition at line 44 of file Database.java.
Definition at line 48 of file Database.java.
Definition at line 37 of file Database.java.
Boolean edu::tum::cs::srl::Database::prologDatabaseExtended = false [protected] |
Definition at line 38 of file Database.java.
Taxonomy edu::tum::cs::srl::Database::taxonomy [protected] |
Definition at line 42 of file Database.java.
boolean edu::tum::cs::srl::Database::verbose = false [protected] |
Definition at line 47 of file Database.java.