AndroMeta  2.0.0
Public Types | Public Member Functions | Static Public Member Functions
Meta::MDLOntology Class Reference

A knowledge base system whereby a library of domains is defined which contain attributes and and time-based events which operate on these attributes. Domains can extend and link to one another. The ontology is intended to be accessed by multiple users simultaneously and implements proper data protection and synchronizaton. More...

#include <MDLOntology.h>

List of all members.

Public Types

enum  TimeType { TimeAt = 0, TimeNext = 1, TimePrevious = 2 }

Public Member Functions

 MDLOntology (const mstr &ontologyPath)
 MDLOntology (const mstr &ontologyPath, const mstr &flatOntologyPath)
 ~MDLOntology ()
void findDomains (const mstr &user, const mvec &extends, const mvec &notExtends, mvec &out, const mstr &creator="", const mvar &startDomainMap=undef)
void setErrorStream (std::ostream &estr)
bool hasDomain (const mstr &domain)
mvec normalizeExtends (const mvec &extends)
mvec normalizeNotExtends (const mvec &extends)
mvec domainsExtended (const mstr &domain)
mvec fullDomainsExtended (const mstr &domain)
mvec attributes (const mstr &domain)
void createIndex (mvar &index, bool tags)
void setAttribute (const mstr &creator, const mstr &domain, const mstr &time, const mstr &attribute, const mstr &value)
void createDomain (const mstr &creator, const mstr &domain)
const mstrcreator (const mstr &domain)
mvec setDomainsExtended (const mstr &domain, const mvec &domains)
void addAttribute (const mstr &creator, const mstr &domain, const mstr &attribute, const mstr &attributeDomain)
void deleteAttribute (const mstr &domain, const mstr &attribute)
void save (bool backup)
mreal epsilon ()
void setEpsilon (const mreal &epsilon)
void deleteDomain (const mstr &domain)
void setDomainDescription (const mstr &creator, const mstr &domain, const mstr &description)
mstr domainDescription (const mstr &domain)
void setAttributeDescription (const mstr &creator, const mstr &domain, const mstr &attribute, const mstr &description)
mstr attributeDescription (const mstr &domain, const mstr &attribute)
void removeEvents (const mstr &domain, const mstr &attribute)
void removeEvent (const mstr &domain, const mstr &time, const mstr &attribute)
mvec events (const mstr &domain)
mvec events (const mstr &domain, const mstr &attribute)
void clearEvents (const mstr &domain)
void addEvent (const mstr &creator, const mstr &domain, const mstr &time, const mstr &attribute, const mstr &value)
bool lock (const mstr &domain, const mstr &user)
void unlock (const mstr &domain, const mstr &user)
bool isLocked (const mstr &domain, const mstr &user)
mstr runModel (const mstr &domain, TimeType timeType, const mstr &time, mvar &out, const mtime &timeout, bool full, bool description, bool concise)
void query (const mvec &domains, const mvar &time, mnode code, mvec &out)
void setPublicRead (const mstr &domain, bool flag)
void setPublicWrite (const mstr &domain, bool flag)
bool isPublicRead (const mstr &domain)
bool isPublicWrite (const mstr &domain)
void walkLinks (const mstr &user, const mstr &domain, const mstr &time, size_t maxLinks, mvar &out)
void flatten (const mstr &outputPath, bool tags)
void mergeOntology (const mstr &mergePath)
int addMethod (const mstr &creator, const mstr &domain, const mstr &method="")
void renameMethod (const mstr &creator, const mstr &domain, int methodId, const mstr &newMethod)
void setMethodCode (const mstr &creator, const mstr &domain, int methodId, const mstr &code)
mstr addMethodParameter (const mstr &creator, const mstr &domain, int methodId, const mstr &parameter="")
void renameMethodParameter (const mstr &creator, const mstr &domain, int methodId, const mstr &parameter, const mstr &newParameter)
void setMethodParameterType (const mstr &creator, const mstr &domain, int methodId, const mstr &parameter, const mstr &type)
void setMethodParameterDomain (const mstr &creator, const mstr &domain, int methodId, const mstr &parameter, const mstr &parameterDomain)
void setMethodParameterDefaultValue (const mstr &creator, const mstr &domain, int methodId, const mstr &parameter, const mstr &value)
void deleteMethod (const mstr &domain, int methodId)
void deleteMethodParameter (const mstr &creator, const mstr &domain, int methodId, const mstr &parameter)
void reorderMethodParameters (const mstr &creator, const mstr &domain, int methodId, const mvec &parameters)
void methods (const mstr &domain, bool extended, mvec &out)
void codeAssistMethods (const mstr &domain, int methodId, const mstr &code, int cursor, mvec &out)

Static Public Member Functions

static void createOntology (const mstr &path)
static void patchOntology120 (const mstr &path, const mstr &newPath)
static void patchOntology200 (const mstr &path)
static MDLOntologyget (const mstr &path)
static void release (MDLOntology *ontology)
static void releaseAll ()

Detailed Description

A knowledge base system whereby a library of domains is defined which contain attributes and and time-based events which operate on these attributes. Domains can extend and link to one another. The ontology is intended to be accessed by multiple users simultaneously and implements proper data protection and synchronizaton.


Constructor & Destructor Documentation

Meta::MDLOntology::MDLOntology ( const mstr ontologyPath)

Construct an ontlogy with the specifed path.

Meta::MDLOntology::MDLOntology ( const mstr ontologyPath,
const mstr flatOntologyPath 
)

Construct an ontlogy with the specifed path using flatOntologyPath to initialize the data.

Destructor.


Member Function Documentation

void Meta::MDLOntology::addAttribute ( const mstr creator,
const mstr domain,
const mstr attribute,
const mstr attributeDomain 
)

Add an attribute to the specifid domain.

void Meta::MDLOntology::addEvent ( const mstr creator,
const mstr domain,
const mstr time,
const mstr attribute,
const mstr value 
)

Add an event to the domain.

int Meta::MDLOntology::addMethod ( const mstr creator,
const mstr domain,
const mstr method = "" 
)

Add a method to specified domain.

mstr Meta::MDLOntology::addMethodParameter ( const mstr creator,
const mstr domain,
int  methodId,
const mstr parameter = "" 
)

Add a parameter to a method.

mstr Meta::MDLOntology::attributeDescription ( const mstr domain,
const mstr attribute 
)

Get a description for the specified attribute.

Return a list of the attributes the named domain contains.

void Meta::MDLOntology::clearEvents ( const mstr domain)

Delete all events from the specified domain.

void Meta::MDLOntology::codeAssistMethods ( const mstr domain,
int  methodId,
const mstr code,
int  cursor,
mvec out 
)

Generate code-assist methods.

void Meta::MDLOntology::createDomain ( const mstr creator,
const mstr domain 
)

Create a new domain.

void Meta::MDLOntology::createIndex ( mvar index,
bool  tags 
)

Create an index of the ontology.

static void Meta::MDLOntology::createOntology ( const mstr path) [static]

Create new ontology located at path.

const mstr& Meta::MDLOntology::creator ( const mstr domain)

Return the author / creator of the specified domain.

void Meta::MDLOntology::deleteAttribute ( const mstr domain,
const mstr attribute 
)

Delete an attribute from the specified domain.

void Meta::MDLOntology::deleteDomain ( const mstr domain)

Delete the specified domain.

void Meta::MDLOntology::deleteMethod ( const mstr domain,
int  methodId 
)

Delete a method.

void Meta::MDLOntology::deleteMethodParameter ( const mstr creator,
const mstr domain,
int  methodId,
const mstr parameter 
)

Delete a method parameter.

Get the description of the specified domain.

Return a normalized list of immediate domains extended by the named domain.

The smallest time value that can be represented at the current time precision.

mvec Meta::MDLOntology::events ( const mstr domain)

Return all events defined on the domain.

mvec Meta::MDLOntology::events ( const mstr domain,
const mstr attribute 
)

Return all events defined on the domain for the specified attribute.

void Meta::MDLOntology::findDomains ( const mstr user,
const mvec extends,
const mvec notExtends,
mvec out,
const mstr creator = "",
const mvar startDomainMap = undef 
)

Find domains that satisfy the parameters.

void Meta::MDLOntology::flatten ( const mstr outputPath,
bool  tags 
)

Produce a flat-file representation of the ontology.

Return a full list of domains recursively extended by the named domain.

static MDLOntology* Meta::MDLOntology::get ( const mstr path) [static]

Get a pointer to the ontology using path.

bool Meta::MDLOntology::hasDomain ( const mstr domain)
Returns:
true if the ontology has the named domain.
bool Meta::MDLOntology::isLocked ( const mstr domain,
const mstr user 
)

Return true if the specified user has the named domain locked.

bool Meta::MDLOntology::isPublicRead ( const mstr domain)

Return true of the specifed domain allows public read.

bool Meta::MDLOntology::isPublicWrite ( const mstr domain)

Return true of the specifed domain allows public write.

bool Meta::MDLOntology::lock ( const mstr domain,
const mstr user 
)

Lock the specified domain for a certain user to modify.

void Meta::MDLOntology::mergeOntology ( const mstr mergePath)

Merge this ontology with the ontology at mergePath.

void Meta::MDLOntology::methods ( const mstr domain,
bool  extended,
mvec out 
)

Get all methods on a domain.

Normalize a list of domains extended.

Normalize a list of domains not extended.

static void Meta::MDLOntology::patchOntology120 ( const mstr path,
const mstr newPath 
) [static]

Patch to version 1.2.0 of the ontology.

static void Meta::MDLOntology::patchOntology200 ( const mstr path) [static]

Patch to version 2.0.0 of the ontology.

void Meta::MDLOntology::query ( const mvec domains,
const mvar time,
mnode  code,
mvec out 
)

Perform a query on the specified set of domains.

static void Meta::MDLOntology::release ( MDLOntology ontology) [static]

Release an ontology. If it is no longer needed, it will be deallocated.

static void Meta::MDLOntology::releaseAll ( ) [static]

Release all ontologies in memory.

void Meta::MDLOntology::removeEvent ( const mstr domain,
const mstr time,
const mstr attribute 
)

Remove an event at the specified time and attribute from the named domain.

void Meta::MDLOntology::removeEvents ( const mstr domain,
const mstr attribute 
)

Remove all events for the specified attribute.

void Meta::MDLOntology::renameMethod ( const mstr creator,
const mstr domain,
int  methodId,
const mstr newMethod 
)

Rename the specified method.

void Meta::MDLOntology::renameMethodParameter ( const mstr creator,
const mstr domain,
int  methodId,
const mstr parameter,
const mstr newParameter 
)

Rename a method parameter.

void Meta::MDLOntology::reorderMethodParameters ( const mstr creator,
const mstr domain,
int  methodId,
const mvec parameters 
)

Reorder method parameters.

mstr Meta::MDLOntology::runModel ( const mstr domain,
TimeType  timeType,
const mstr time,
mvar out,
const mtime timeout,
bool  full,
bool  description,
bool  concise 
)

Run the specified domain for a certain time.

void Meta::MDLOntology::save ( bool  backup)

Save the domain.

void Meta::MDLOntology::setAttribute ( const mstr creator,
const mstr domain,
const mstr time,
const mstr attribute,
const mstr value 
)

Set an attribute on the specified domain.

void Meta::MDLOntology::setAttributeDescription ( const mstr creator,
const mstr domain,
const mstr attribute,
const mstr description 
)

Set a description for an attribute.

void Meta::MDLOntology::setDomainDescription ( const mstr creator,
const mstr domain,
const mstr description 
)

Set a domain's plain-language description.

mvec Meta::MDLOntology::setDomainsExtended ( const mstr domain,
const mvec domains 
)

Set the domains extended.

void Meta::MDLOntology::setEpsilon ( const mreal epsilon)

Set epsilon.

void Meta::MDLOntology::setErrorStream ( std::ostream &  estr)

Set the error output stream.

void Meta::MDLOntology::setMethodCode ( const mstr creator,
const mstr domain,
int  methodId,
const mstr code 
)

Set the method code for the specified domain.

void Meta::MDLOntology::setMethodParameterDefaultValue ( const mstr creator,
const mstr domain,
int  methodId,
const mstr parameter,
const mstr value 
)

Set a method parameter default value.

void Meta::MDLOntology::setMethodParameterDomain ( const mstr creator,
const mstr domain,
int  methodId,
const mstr parameter,
const mstr parameterDomain 
)

Set the domain of a method parameter.

void Meta::MDLOntology::setMethodParameterType ( const mstr creator,
const mstr domain,
int  methodId,
const mstr parameter,
const mstr type 
)

Set the type of a method parameter.

void Meta::MDLOntology::setPublicRead ( const mstr domain,
bool  flag 
)

Set public read access for the specified domain.

void Meta::MDLOntology::setPublicWrite ( const mstr domain,
bool  flag 
)

Set public write access for the specified domain.

void Meta::MDLOntology::unlock ( const mstr domain,
const mstr user 
)

Unlock the specified domain that a certain user has locked.

void Meta::MDLOntology::walkLinks ( const mstr user,
const mstr domain,
const mstr time,
size_t  maxLinks,
mvar out 
)

Get a list of domains which are recursively linked to by the starting domain.


The documentation for this class was generated from the following file: