edu::tum::cs::srl::Database Class Reference

Inheritance diagram for edu::tum::cs::srl::Database:
Inheritance graph
[legend]

List of all members.

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< VariablegetEntries () 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, Variableentries
HashMap< RelationKey, HashMap
< String, String[]> > 
functionalDependencies
HashMap< String, MultiIterator
< String > > 
multiDomains
ParameterHandler paramHandler
PrologKnowledgeBase prolog
Boolean prologDatabaseExtended = false
Taxonomy taxonomy
boolean verbose = false

Detailed Description

represents an evidence/training database for a relational model

Author:
jain

Definition at line 28 of file Database.java.


Constructor & Destructor Documentation

edu::tum::cs::srl::Database::Database ( RelationalModel  model  )  throws Exception [inline]

constructs an empty database for the given model

Parameters:
model 
Exceptions:
Exception 

Definition at line 56 of file Database.java.


Member Function Documentation

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

Parameters:
type name of the domain/type
value the value/entity name to add
Exceptions:
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

Parameters:
constant 
Returns:
the type name or null if the constant is unknown

Definition at line 617 of file Database.java.

Iterable<String> edu::tum::cs::srl::Database::getDomain ( String  domName  )  throws Exception [inline]
Parameters:
domName 
Returns:
the domain as a set of strings or null if the domain is not found
Exceptions:
Exception 

Definition at line 400 of file Database.java.

HashMap<String, HashSet<String> > edu::tum::cs::srl::Database::getDomains (  )  throws Exception [inline]
Returns:

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

Returns:
Exceptions:
Exception 

Definition at line 430 of file Database.java.

String [][] edu::tum::cs::srl::Database::getEntriesAsArray (  )  throws Exception [inline]
Returns:
the values of this database as an array of String[2] arrays, where the first element of each is the name of the variable, and the second is the value
Exceptions:
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

Parameters:
sig 
args 
Returns:
Exceptions:
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

Parameters:
varName the name of the variable to retrieve
Returns:
returns the variable setting with the given name if it is contained in the database), null otherwise
Deprecated:
because it does not really work with prolog predicates

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

Parameters:
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"
Returns:
If a value for the given variable is stored in the database (or can be computed based on Prolog rules), it is returned. Otherwise, null is returned - unless the closed world assumption is being made and the variable is boolean, in which case the default value of "False" is returned.
Exceptions:
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]
Parameters:
databaseFilename 
Exceptions:
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!

Parameters:
predName 
Exceptions:
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.


Member Data Documentation

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.

Definition at line 38 of file Database.java.

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations


srldb
Author(s): Dominik Jain, Stefan Waldherr, Moritz Tenorth
autogenerated on Fri Jan 11 09:58:43 2013