Open mahdanoura opened 2 months ago
As mentioned in yesterdays TD call I understand the desire to use slot
for modelling the same concept once and reusing it.
Anyhow, once the cardinality differs it is not the same
concept anymore, if I understand the concept of slot
correctly.
I would guess (but I don't know LinkML) there are other ways as well (separating the type and the actual element with occurrences). Let me use XML schema as an example:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<!-- Type to be reused -->
<xs:complexType name="MyType">
<xs:sequence>
<xs:element name="foo" type="xs:string" />
<xs:element name="bla" type="xs:int" />
</xs:sequence>
</xs:complexType>
<!-- example where type is used -->
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<!-- instance with 0 to 10 -->
<xs:element name="useOfTypeA" type="MyType" minOccurs="0" maxOccurs="10" />
<!-- instance with exactly 1 -->
<xs:element name="useOfTypeB" type="MyType" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The aim of
slot
definitions in LinkML is to reuse those entities across the schema. However, some of theslots
need to be used in different ways with different properties, for instance the slottitle
is not mandatory on all TD levels and only on the top level it is required. This is the case for many of theslots
defined and causes problems in the generators.