DataElements

All information in the DataStore repository is stored in the form of DataElements. DataElements are objects that have attributes and may contain other DataElements. The attributes of a DataElement are stored as an array of strings. A particular attribute is retrieved by calling getAttribute(attribute index). A particular attribute is set by calling setAttribute(attribute index, attribute value). The attribute indices that can be used are as follows: .
AttributeDescription
A_TYPEAttribute indicating the type of object. The type can be used to indicate the type of an instance of data, a descriptor, a relationship or a commnad.
A_NAMEAttribute indicating the name of object.
A_VALUEAttribute indicating the more information about that object
A_SOURCEAttribute indicating source information about an object, if applicable
A_ISREFAttribute indicating whether a the object is a reference or not. In the DataStore, a reference to another DataElement is represented with a DataElement
A_IDThe unique ID of a DataElement.

Rather than representing different types of objects as different classes, the type attribute of a DataElement indicates it's type. There are two general categories of DataElements. There are schema elements, descriptors, and instances of those schema elements, instances.

Descriptors

A descriptor is a DataElement that describes some type of object. The A_TYPE attribute of a descriptor indicates what type of descriptor it is. The A_NAME attribute of a descriptor identifies the type that the descriptor describes.

A descriptor may be of one of the following types:

T_OBJECT_DESCRIPTORDescribes a type of object
T_RELATION_DESCRIPTORDescribes a type of relationship that may exist between two DataElements.
T_COMMAND_DESCRIPTORDescribes a type of command

Object Descriptors

Object descriptors describe the different types of data that can be represented in the DataStore repository. Object descriptors can describe types of object instances as well as other types of object descriptors. Each object descriptor is related to other object, relationship and command descriptors.

Relation Descriptors

Relation descriptors describe the different types of relationships that can be represented in the DataStore repository. Relation descriptors describe types of relationships between object instances, object descriptors, command instances and command descriptors.

Command Descriptors

Command descriptors describe the different types of commands that can be executed on an object in the DataStore repository. In the DataStore schema, object descriptors are related to command descriptors to indicate that an object instance of a certain type can have the described command run on it. Command descriptors are always contained by the object descriptors they are associated with. The A_SOURCE attribute of a command descriptor indicates which miner(s) may execute an instance of such a command.

These three types of objects are used to define the DataStore schema. Instances of relation descriptors are used to define relationships between descriptors in the schema.

Instances

An instance object is a DataElement that is an instance of a descriptor. An instance may either by an object, a relation or a command. An instance uses it's descriptor's A_NAME attribute as it's A_TYPE attribute.

Objects

Objects are instances of object descriptors. Objects are used to the represent the external or internal entities that are being interacted with. An instance object can be related in a certain way to another type of instance object if it's object descriptor has the same kind of relationship to the other object's object descriptor. An instance object may be associated with a particular command if it's object descriptor is associated with the command descriptor for that command.

Relations

Relations are instances of relation descriptors. A relation is really a typed reference to another object. Relations may exist from one object to another if the schema indicates that the object descriptor for the first object may have a relationship of that type to the other object's descriptor. Relations are used to describe the relationship between two instances, the relationship between two descriptors and the relationship between an instance and a descriptor. A relation is able to reference another element by storing the other element's A_ID attribute in it's A_SOURCE attribute. If a relation object needs to be dereferenced, it uses this attribute to query the DataStore for the object being referenced.

A relation is typically represented by having an instance object DataElement contain a relation DataElement. There are two types of relationships between elements that are implicit. These are the contains and the parent of relationships. If an element is directly contained within another element, the relationship between those two elements is implied to be contains/parent of relationships.

Commands

Commands are instances of command descriptors. A command is always associated with a instance object such that the command is to be performed on that object. The object associated with a command is referred to as the subject of the command. Only a command that has a command descriptor that is related to the object descriptor of the subject may be constructed. A command object is constructed when the DataStore method command() is called. The command is created with a reference to the subject, an optional set of arguments, also instance objects, and a status object instance, used to indicate the state of the command. The tree of elements for a command is communicated, via the DataStore comm layer, to the appropriate miner(s), where it is interpretted and executed.

The structure of a command looks like the following:

As an example, suppose the DataStore is being used for browsing a filesystem. The filesystem entities and how to interact with the filesystem needs to be defined in the schema. The following descriptors could be used to describe this.

Now that all the required descriptors are defined, relations between descriptors are needed. Note that the symbol "->" implies a "contains" relationship and "IO()" implies an instance of a specified descriptor.

DataStore schemas are created by the DataStore miners. Each tool contributes it's own schema or to the DataStore schema, referencing descriptors of other schemas, such that one tool can contribute to another tool. All the command descriptors that are contributed by a miner are expected to be handled by the contributing miner. Whenever a miner creates a new command descriptor, the A_SOURCE attribute indicates to the DataStore that an instance of that command should be routed to that miner when it's issued.

See the section, Miners to find out how miners contribute schemas and execute commands.