Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aasx non-importable in AAS4J due to not-schema-compliant xml #134

Closed
keiligch opened this issue Apr 11, 2023 · 3 comments
Closed

aasx non-importable in AAS4J due to not-schema-compliant xml #134

keiligch opened this issue Apr 11, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@keiligch
Copy link

Description
Used Package Explorer version is v2023-02-03.

When creating an AAS with the Package Explorer, the aasx-file is not importable in AAS4J due to mistakes in the xml-file within the .aasx.

  • Example 1: when the SemanticId of the Submodel is not set in the package explorer, the xml contains
<aas:submodel>
  [...]
  <aas:semanticId>
    <aas:keys />
  </aas:semanticId>

, leading to an serialization exception in java while importing with AAS4j due to the empty keys-element.

  • Example 2: the submodel elements in the xml are structured as follows:
<aas:submodelElements>
   <aas:submodelElement>
     <aas:property>

. The <aas:submodelElement>-element is not compliant to the schema, it must be

<aas:submodelElements>
  <aas:property>

.

To Reproduce

  1. Create new AAS with the Package Explorer, adding a submodel without a semanticId
  2. Adding a property
  3. Save as .aasx
  4. Setup a new Java-Project and set AAS4J as a dependency
  5. use the aasx-file as an InputStream as an argument for the AASXDeserializer constructor
  6. run the read()-method on the AASXDeserializer-object.
  7. get Exceptions related to Example 1
  8. remove semanticId- and keys-elements from xml
  9. run AASXDeserializer again
  10. get Exceptions related to Example 2
  11. remove submodelElement-element
  12. run AASXDeserializer again successfully
@FrankSchnicke
Copy link
Contributor

I would like to bump this issue since this error now has propagated to the Submodel Templates provided by IDTA:
admin-shell-io/submodel-templates#37

@BirgitBoss
Copy link
Contributor

With the new Release 3.0 of explorer we have (AASX Package Explorer V3 2023-09-12.alpha)

image
If you did not start to enter a semantic ID everything is correct:

  <submodels>
    <submodel>
      <idShort>mySubmodel</idShort>
      <id>http://bosch-connected-industry.com/demo/sm/instance/1/0/5390EAE5EDPUGHG</id>
    </submodel>

and if you clicked on semantic ID but then did not add the keys
image
we have an xml generated that is not valid, because keys has a cardinality of 1..*

    <submodel>
      <idShort>my2ndSubmodel</idShort>
      <id>http://bosch-connected-industry.com/demo/sm/instance/1/0/13C9FC51F3QLLIT</id>
      <semanticId>
        <type>ExternalReference</type>
        <keys />
      </semanticId>
    </submodel>

I think it is ok for the explorer to act like this. However, before releasing anything the xml needs to be validated against the xsd schema.

@martafullen martafullen transferred this issue from admin-shell-io/aasx-package-explorer Feb 16, 2024
@martafullen martafullen transferred this issue from another repository Feb 21, 2024
@juileetikekar juileetikekar self-assigned this Mar 18, 2024
@juileetikekar juileetikekar added the bug Something isn't working label Mar 18, 2024
@juileetikekar
Copy link
Contributor

Hi @keiligch,

The issue with empty lists has already been fixed in the latest version of the AASX Package Explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants