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

xsiSchemaLocation in generated XML documents not processable by AASXPackageExplorer #186

Closed
bs-jokri opened this issue Oct 19, 2023 · 8 comments

Comments

@bs-jokri
Copy link

Hi,

I am currently trying to import AAS files in xml format generated by the AAS4j library into the AASXPackageExplorer, however it seems the editor cannot handle the xsi:schemaLocation produced by AAS4j.

The generated version contains a black before the file name

<aas:environment xmlns:aas="https://admin-shell.io/aas/3/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://admin-shell.io/aas/3/0 AAS.xsd">

However, the Editor loads the file, if it is provided as

<aas:environment xmlns:aas="https://admin-shell.io/aas/3/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://admin-shell.io/aas/3/0/AAS.xsd">

Expected behavior:
The generated XML file is imported into the AASXPackageExplorer.

@twebermartins
Copy link
Contributor

Thanks @bs-jokri for raising this. We will have a look at it.

@FrankSchnicke
Copy link
Contributor

I'm not sure if this is a bug related to AAS4J. In the schema location, pairs of namespaces as well as their respective schema location are provided. Thus, xsi:schemaLocation="https://admin-shell.io/aas/3/0/AAS.xsd" does not make much sense due to the file itself missing (i.e., the second entry in the schemaLocation tag). Nevertheless, it would make more sense to replace AAS.xsd with https://github.com/admin-shell-io/aas-specs/blob/V3.0.7/schemas/xml/AAS.xsd

Can you provide an error log of the AASX Package Explorer of an unsuccessful load?

@sebbader-sap
Copy link
Contributor

sebbader-sap commented Nov 9, 2023

I was not able to reproduce the described behaviour with AASX Package Explorer v2023-09-12.

However, what I did find out:

  1. This minimal example can be loaded by the Package Explorer:
<?xml version='1.0' encoding='UTF-8'?>
<aas:environment xmlns:aas="https://admin-shell.io/aas/3/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://admin-shell.io/aas/3/0 AAS.xsd">
  <aas:assetAdministrationShells>
    <aas:assetAdministrationShell>
      <aas:id>AssetAdministrationShell---2CEBD072</aas:id>
      <aas:assetInformation>
        <aas:assetKind>Instance</aas:assetKind>
      </aas:assetInformation>
    </aas:assetAdministrationShell>
  </aas:assetAdministrationShells>
  <aas:submodels />
  <aas:conceptDescriptions />
</aas:environment>
  1. AAS4J serialises this here (note the missing aas:submodels and aas:conceptDescriptions), which leads to an error:
<?xml version='1.0' encoding='UTF-8'?>
<aas:environment xmlns:aas="https://admin-shell.io/aas/3/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://admin-shell.io/aas/3/0 AAS.xsd">
  <aas:assetAdministrationShells>
    <aas:assetAdministrationShell>
      <aas:id>AssetAdministrationShell---2CEBD072</aas:id>
      <aas:assetInformation>
        <aas:assetKind>Instance</aas:assetKind>
      </aas:assetInformation>
    </aas:assetAdministrationShell>
  </aas:assetAdministrationShells>
</aas:environment>

@sebbader-sap
Copy link
Contributor

As https://github.com/admin-shell-io/aas-specs/blob/2fe82a66ca502f9c5aea1ef0de0baaa729469faf/schemas/xml/AAS.xsd#L327 states that, e.g., submodels is optional but must not be empty, I see this as a bug in the Package Explorer.

@sebbader-sap
Copy link
Contributor

@FrankSchnicke can you follow my arguments? If so, can you add it to the bug you have already opened in the Package Explorer?

@sebbader-sap
Copy link
Contributor

(Remark: I had only a limited environment available for my tests, I was able to use v2023-09-12 but without needed .NET Core libraries - no permissions to install on my VM. Therefore, I am not 100% sure whether my Package Explorer behaves identical to others.)

@FrankSchnicke
Copy link
Contributor

@sebbader-sap I added your findings to the ticket over at the AASX PE Repo: admin-shell-io/aasx-package-explorer#653.

@bs-jokri since @sebbader-sap could not reproduce the issue, I will close this ticket. For the general overview of compatibility issues related to bugs with AAS4J but also with AASX PE see #158

@bs-jokri
Copy link
Author

@sebbader-sap @FrankSchnicke thanks to both of you looking into the issue. I also tested again and can second @sebbader-sap observations. My test model also missed some optional elements, which might caused the problem not the schemaLocation. Thus, fine with me closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants