agent.core.memory
Class Memory

java.lang.Object
  extended by agent.core.memory.Memory

public class Memory
extends java.lang.Object

Agent Memory Main functionality to access and manipulate Jena ontology models in MySQL database

Version:
0.8
Author:
Michal Laclavik, Emil Gatial (inference, connection testing)

Field Summary
(package private)  Config config
           
private  IDBConnection conn
          Instanceof database connection object
private static java.lang.String DEFAULT_MODEL_NAME
          Default ontology model name
private  boolean loaded
          State variable identifies whether model is loaded
private  Logger log
          Log4j object
private  OntModel model
          Instance of ontological model used in agent
 
Constructor Summary
Memory(java.lang.String _propertyFile, java.lang.String _agentName)
          Constructor
 
Method Summary
 void closeModel()
          Close OWL Model and store Model in RDB if using database backend This have to be redesigned and store everything on the crash
 void createModel()
          Creates OWL model out of defined SOURCE_FILE in OWL database and store this model see: SOURCE_FILE, INDIVIDUALS_FILE
 Property createProperty(java.lang.String property)
          Creates ontology property out ofstring represenation
static java.lang.String getBase()
          Reurns the agent onoloy name space
 IDBConnection getConnection()
          This method returns db connection
 OntModel getModel()
          Returns OWL ontological model for manipulation
 void memory2owl()
          Saves current content of Memory into file defined in Ontology Property file see: OUTPUT_FILE
 void performInference(java.lang.String ruleFile, boolean derivationLogging)
          Infers some new statements about the agent ontological model accoding to given rules of inference
and adds inferenced model as submodel of agent
 void removeModel()
          Remove model from DB
 void reset()
          Sometimes if operation is idle MySQL connection fails and we need to reset connection and model
 void test()
          Prints objects from OWL model for testing purposes
 void testConnection()
          Tests the status of connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

Config config

DEFAULT_MODEL_NAME

private static final java.lang.String DEFAULT_MODEL_NAME
Default ontology model name

See Also:
Constant Field Values

log

private Logger log
Log4j object


conn

private IDBConnection conn
Instanceof database connection object


model

private OntModel model
Instance of ontological model used in agent


loaded

private boolean loaded
State variable identifies whether model is loaded

Constructor Detail

Memory

public Memory(java.lang.String _propertyFile,
              java.lang.String _agentName)
Constructor

Parameters:
_propertyFile - - property file name where settings for agent memory are stored. Settings are defined according to memory.Config
_agentName - name of the agent
Method Detail

getBase

public static java.lang.String getBase()
Reurns the agent onoloy name space

Returns:
name space of agent

getConnection

public IDBConnection getConnection()
This method returns db connection

Returns:
instance of db connection object

createModel

public void createModel()
Creates OWL model out of defined SOURCE_FILE in OWL database and store this model see: SOURCE_FILE, INDIVIDUALS_FILE


removeModel

public void removeModel()
Remove model from DB


getModel

public OntModel getModel()
Returns OWL ontological model for manipulation

Returns:
ontological model

performInference

public void performInference(java.lang.String ruleFile,
                             boolean derivationLogging)
Infers some new statements about the agent ontological model accoding to given rules of inference
and adds inferenced model as submodel of agent

Parameters:
ruleFile - path to file with line delimited list of rules
derivationLogging - true/false value indicates whether to perform logging of inferenced statements
false value accelerate inferece processing
See Also:
setDerivationLogging

reset

public void reset()
Sometimes if operation is idle MySQL connection fails and we need to reset connection and model


test

public void test()
Prints objects from OWL model for testing purposes


memory2owl

public void memory2owl()
Saves current content of Memory into file defined in Ontology Property file see: OUTPUT_FILE


closeModel

public void closeModel()
Close OWL Model and store Model in RDB if using database backend This have to be redesigned and store everything on the crash


createProperty

public Property createProperty(java.lang.String property)
Creates ontology property out ofstring represenation

Parameters:
property - represents local name of ontology property

testConnection

public void testConnection()
Tests the status of connection. If it doesn't exist then make new connection to database and initialize model