Next: , Previous: , Up: Top   [Index]


4 Parents and Properties

Parent and Property objects represent the parents and properties of actual Entity objects in Octave / Matlab. Again, please look at the libcaosdb documentation for details on the relationships between these classes.

Class: Parent

The parent for an Entity.

Instance Variable of Parent: string id
Instance Variable of Parent: string name
Instance Variable of Parent: string description
Method on Parent: Parent ([struct data])

The constructor takes an optional data argument which may provide initial content. The typical user will just use the empty constructor Parent() and add content later.

Method on Parent: to_struct ()

Note: This method is mostly interesting for internal use of the library, end users probably will never need it.

Convert to a struct which has all the fields that may be needed for interaction with the backend C++ functions.

Class: Property

A property of an Entity. Note that this class is for concrete property instances which are attached to an Entity. To create new Property entities in CaosDB, use the Entity class with rolePROPERTY”.

Instance Variable of Property: string id
Instance Variable of Property: string name
Instance Variable of Property: string description
Instance Variable of Property: string importance

Must be one of the supported importances “OBLIGATORY”, “RECOMMENDED”, “SUGGESTED” or “FIX” (see also the server documentation).

Instance Variable of Property: string unit
Instance Variable of Property: string value

The exact type of the value property should match the datatype of the Property object.

Method on Property: Property ([struct data])

The constructor takes an optional data argument which may provide initial content. The typical user will just use the empty constructor Provide() and add content later.

Method on Property: get_datatype ()
Method on Property: set_datatype (string dtype_name, [logical is_reference = false, logical is_list = false])

Set the datatype of this Property in a consistent manner.

Parameters

dtype_name : string

Either the atomic datatype (for scalar simple values) or the ID of the referenced entity (in the case of reference values).

is_reference : logical

True if the value is a reference, else false (the default).

is_list : logical

True if the value is list types, false if it is a scalar (the default).
Method on Property: to_struct ()

Note: This method is mostly interesting for internal use of the library, end users probably will never need it.

Convert to a struct which has all the fields that may be needed for interaction with the backend C++ functions.

If the datatype indicates a list value, the value is interpreted as such. It is an error if the value is list-like (cell string or more than one numeric element) while the datatype indicates a scalar value.


Next: , Previous: , Up: Top   [Index]