Association References
Association References are the most basic References. They are used to link to other elements in the model, or to elements defined in DataResources.
Associations:
- Are one-directional. Opposite links are not (yet) supported.
- Are not hierarchical.
- Can target ElementClasses from other Ontologies, as long as there is a dependency in that direction.
- Require the target ElementClass to have identifiers.
model/references/ScriptParameter_type.xml
<reference name="type">
<associationType name="association"/>
<owner name="ScriptParameter" ontology="demo"/>
<target name="ScriptParameterType" ontology="demo"/>
<cardinality>
<minimum>0</minimum>
<maximum>1</maximum>
</cardinality>
</reference>
Association in action
When used to create models, we can then reference elements defined in other parts of the model.
MyScript.xml
<script>
<parameters>
<scriptParameter>
<name>output</name>
<type>File</type>
</scriptParameter>
</parameters>
</script>
scriptParameterTypes.xml
<dataResource type="demo::ScriptParameterType">
<scriptParameterType>
<name>File</name>
</scriptParameterType>
</dataResource>