Skip to content
Snippets Groups Projects
Commit 96588bb1 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

DOC: added information on how to reuse properties in yaml files

parent 326bd556
No related branches found
No related tags found
2 merge requests!107Release v0.11.0,!57FIX: if multiple updates for one entity exist, the retrieve would result in an...
Pipeline #29018 failed
...@@ -74,6 +74,41 @@ If the data model depends on record types or properties which already exist in C ...@@ -74,6 +74,41 @@ If the data model depends on record types or properties which already exist in C
added using the ``extern`` keyword: ``extern`` takes a list of previously defined names. added using the ``extern`` keyword: ``extern`` takes a list of previously defined names.
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!
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 Datatypes
========= =========
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment