Link Search Menu Expand Document

CVE API

CVE is developped in pure python. The CVE API supports the management of meta-models and the corresponding instances.

CVE core model

The core model of CVE is a graph made of nodes and links between nodes. Then a upper class named vitem is the model of every node. Then CVE specialized a few type of nodes :

  • vstate is a type of node which has a basic value : a real (vreal), a boolean (vboolean), a string (vint), a file (vfile), an integer (vint), a transformation matrix (vtransform) or a vector (vvector). This list can be extended.
  • cveitem is a complex node defined a set of named links to vstates of other cveitem references. A named link acts as an attribute to define the node. It may be ruled by a classifier.
  • cveclassifier defines a template for a cveitem. It is definded by a set of attributes which identify the name, cardinality and types of the states of a cveitem associated to the classifier.
Core model

With classifier definitions a cveitem follows definitions rules. A graph of cveitems becomes a semantic graph.

Main methods

Semantic graph management

The cardinality and the type of a cveitem depends on its classifier definition. Instanciating a graph node is made by creating a cveitem referencing a classifier. A cveitem is an instance of a classifier.

  • if the cardinality of an attribute is multiple, then a reference to either a vitem matching the attribute type may be inserted into the state corresponding to the attribute. An already inserted node may be removed. The insert_state or remove_state methods are adapted to manage the value of the attribute.
  • if the cardinality is reduced to a single node, we can either reference any vitem from the correct type to the attribute using the set_state method. Then if the type has a specific value the methods set_state_value may be used to edit directly the value of the vstate instance.

Meta model management

Obviously there are tools to manage classifiers (creation and definition of attributes) and thus to create the meta-models instanciated by cveitems :

  • cveclassifier()
  • add_attribute()
  • add_method() a classifier is associated to a list of cvemethod​

The high level vitem class makes the graph self-inspectable. This property enables very generic functions, to load, save, share any graph whatever the meta-model is. Indeed every information is standardized and can be managed on a very structured way.

Behaviors

Core model

The model and the meta-models are quite static. One can use python scripts to load, edit or to save them. But it is more interesting to create some agents who are in charge to automate the evolution of a model partition over the time. The model evolves triggered by external events.

A cvebehavior is a abstract agent taking in charge a part of the graph and which either survey/observe or edit the graph. It can be split into sub-behaviors. A behavior is taken in charge by a given process. Than means that it will be associated to a software managing external events and internal events. There are two types of behaviors

  • A cvedevice which may have sub-behaviors, but is not mandatory. When it has sub-behaviors it exchange events with its sub-behavior in a multiprocess protocol.
  • A cveserver must have sub-behaviors : this agent has the main role to share the graph between agents on remote computers. The exchange of events if base on internet protocols. The cveserver is necessary to distribute the management between network agents. But an other option could be to let a cvedevice share its graph on the network through a subbehavior dedicated to this service. Then the cveserver would be obsolete.

How to go a step further

To know a little more it is advised to start by managing models instantiating an existing meta model. Then it is interesting to address how to build and integrate your own meta-model. At last the construction of a new agent is a process which expects the two previous steps and which offer end-user added value.


Table of contents