diff --git a/src/doc/yaml_interface.rst b/src/doc/yaml_interface.rst index 49e8042a9a249b23302a1c1472c5aaf9fb20f25e..6d2ec17867bd2cea408059b93375624c5680ffe5 100644 --- a/src/doc/yaml_interface.rst +++ b/src/doc/yaml_interface.rst @@ -86,6 +86,41 @@ list of previously defined names of Properties and/or RecordTypes. Note that if recommended_properties: Author: +Reusing Properties +================== + +Properties defined once (either as a property of a Record or as a separate Property) can be reused +later in the yaml file. That requires that after the first occurrence of the property, the +attributes have to be empty. Otherwise the reuse of the property would be conflicting with its +original definition. + +Example: +-------- + + +.. code-block:: yaml + + Project: + obligatory_properties: + projectId: + datatype: INTEGER + description: 'UID of this project' + date: + datetype: DATETIME + description: Date of a project or an experiment + + Experiment: + obligatory_properties: + experimentId: + datatype: INTEGER + description: 'UID of this experiment' + date: # no further attributes here, since property was defined above in 'Project'! + + +The above example defines two Records: Project and Experiment +The property ``date`` is defined upon its first occurrence as a property of ``Project``. +Later, the same property is also added to ``Experiment`` where no additional attributes are +allowed to specify. Datatypes =========