admin-shell-io / aas-specs

Repository of the Asset Administration Shell Specification IDTA-01001 - Metamodel
https://admin-shell-io.github.io/aas-specs-antora/index/home/index.html
Creative Commons Attribution 4.0 International
50 stars 26 forks source link

BUG - aasenv contains maximum one element submodels_t, conceptDescriptions_t or assetAdministrationshell_t #179

Closed BirgitBoss closed 2 years ago

BirgitBoss commented 2 years ago

Since the types represent the lists and not the single elements in the list it is 0..1 multiplicity here (like for assets) and not 0..*

<element maxOccurs="unbounded" minOccurs="1" name="assetAdministrationShells" type="aas:assetAdministrationShells_t"/>
<element maxOccurs="1" minOccurs="0" name="assets" type="aas:assets_t"/>
<element maxOccurs="unbounded" minOccurs="1" name="conceptDescriptions" type="aas:conceptDescriptions_t"/>
<element maxOccurs="unbounded" minOccurs="1" name="submodels" type="aas:submodels_t"/>

==>

<element maxOccurs="1" minOccurs="0" name="assetAdministrationShells" type="aas:assetAdministrationShells_t"/>
<element maxOccurs="1" minOccurs="0" name="assets" type="aas:assets_t"/>
<element maxOccurs="1" minOccurs="0" name="conceptDescriptions" type="aas:conceptDescriptions_t"/>
<element maxOccurs="1" minOccurs="0" name="submodels" type="aas:submodels_t"/>
BirgitBoss commented 2 years ago

Now in branch https://github.com/admin-shell-io/aas-specs/tree/draft-V3RC02-schemas no types any longer for plural - although this is best practice and was a concsious decision to introduce them in V1.0: Only then it is possible to specify that something is option and that - if existing - at minimum 1 element should be contained.

Although maxOccurs is "1" by default I would prefer to add maxOccurs explicitly.

  <xs:group name="environment">
    <xs:sequence>
      <xs:element name="assetAdministrationShells" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="assetAdministrationShell" type="assetAdministrationShell_t" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
mristin commented 2 years ago

no types any longer for plural - although this is best practice and was a concsious decision to introduce them in V1.0 [...] Only then it is possible to specify that something is option and that - if existing - at minimum 1 element should be contained.

@BirgitBoss Please see https://github.com/aas-core-works/aas-core-meta/issues/149. Could you please write the feedback directly on that other issue? If I understood you correctly, lists should either be specified with at least one item or the XML element should not be specified at all? (Let's continue the discussion on the issue https://github.com/aas-core-works/aas-core-meta/issues/149.)

mristin commented 2 years ago

Closing the issue, since the schema could be generated with the appropriate constraint. The definition for plural sequences is not necessary.

mristin commented 2 years ago

The maxOccurs set to 1 has been introduced in #204.