-
Notifications
You must be signed in to change notification settings - Fork 3
Properties
Bryan Lawrence edited this page Mar 21, 2016
·
4 revisions
Class properties are declared in CIM2 using a four-member tuple which define the property name, type, cardinality, and provide documentation:
('property_name', 'property_type', 'cardinality', 'docstring')
where
-
property_name
is what you expect ... it's the name of a property/attribute -
property-type
is one of- A basic type from
str
,datetime
,int
,float
,bool
- A cim type of the form
package.class|enum_name
wherepackage
is a defined CIM package andclass_name
orenum_name
is defined within it. In this case, the targetproperty_type
instance is composed into the parent class. - A reference to a remote resource of the form
linked_to(package.class_name)
orlinked_to(package.class_name, package.enum_name)
denoting that the property_name points to a remote CIM document of typeclass_name
from CIM packagepackage
(and in the second casepackage.enum_name
is a controlled vocabulary which can be used to type the association in more detail than provided by the property_name).
- A basic type from
-
cardinality
is the form of'X.Y[+|-]'
where "X" and "Y" are integers and Y >= X. Y is also allowed to be "N", to indicate an unbounded upper limit. Typical values are '0.1','1.1','1.N'. The numeric values "X.Y" are optionally followed by a "+" and/or '-' ... details to follow. -
docstring
is a string which describes what the property attribute is for, from the point of view of the parent class.
The following are examples of valid property strings:
('category','science.model_types','1.1',
'Generic type for this model'),
('id', 'str','0.1',
'Vocabulary identifier, where this model description was constructed via a controlled vocabulary'),
('simulates','linked_to(science.scientific_realm)', '0.N',
"The scientific domains which this model simulates"),
('internal_software_components', 'software.software_component','0.N',
'Software modules which together provide the functionality for this model'),
('related_experiments', 'linked_to(designing.numerical_experiment, designing.experimental_relationships', '0.N',
'Other experiments which have defined relationships to this one.')