eclipse-aaspe / package-explorer

AASX Package Explorer
Other
55 stars 20 forks source link

Wrong Relationship Type in *.rels #161

Closed FrankSchnicke closed 6 months ago

FrankSchnicke commented 10 months ago

The AASX specification states on p. 17 that the namespace for relations is the following: http://admin-shell.io/aasx/relationships

In consequence, the relationship type in aasx-origin.rels has to be http://admin-shell.io/aasx/relationships/aas-spec; the relationship type in the general .rels has to be http://admin-shell.io/aasx/relationships/aasx-origin. However, the AASX Package Explorer and AAS4J as well are using http://www.admin-shell.io/aasx/relationships as namespace (note the extra "www").

In consequence, the AASX files created by the AASX Package Explorer and AAS4J are not conforming to the AASX spec on structural level. Fixing this by simply removing the "www" from the namespace string would lead to newer version of the AASX Package Explorer not being able to open files created before correcting this issue. In consequence, a backwards compatible solution looking for both namespaces would make sense.

We will fix this in AAS4J asap.

This issue was discovered due to the work of @s-heppner and team in the context of the BaSyx Python SDK 👍

BirgitBoss commented 10 months ago

I will raise an issue to support both relationship namespaces in Part 5 so that older .aasx can still be imported.

https://github.com/admin-shell-io/aas-specs-aasx/issues/2 (private repo)

WelliSolutions commented 9 months ago

For people working with Package Explorer and products based on the Python Basyx library, we have released a tool that can convert from AASX files made with Package Explorer to a more Basyx compatible format. It works around this bug and bug admin-shell-io/temp-aasx-package-explorer#128.

Find it at https://github.com/LukasBenner/AASFix

JS-Aibel commented 8 months ago

Hi, What is the status on this bug? This is a show stopper for us.

FrankSchnicke commented 8 months ago

Hi @JS-Aibel,

in AAS4J (cf. https://github.com/eclipse-aas4j/aas4j/pull/205) and in consequence, also in BaSyx, this is already fixed. However, I'm not sure about the AASX Package Explorer. Maybe @juileetikekar can add some details here.

JS-Aibel commented 8 months ago

Hi @JS-Aibel,

in AAS4J (cf. eclipse-aas4j/aas4j#205) and in consequence, also in BaSyx, this is already fixed. However, I'm not sure about the AASX Package Explorer. Maybe @juileetikekar can add some details here.

Thank you for the reply, @FrankSchnicke. I was wondering about the status of the AASX Package Explorer. It is very unfortunate that we cannot open an AASX created with the BaSyx library.

FrankSchnicke commented 8 months ago

Thank you for the reply, @FrankSchnicke. I was wondering about the status of the AASX Package Explorer. It is very unfortunate that we cannot open an AASX created with the BaSyx library.

This is most likely not related to this ticket but related to another ticket: https://github.com/admin-shell-io/aasx-package-explorer/issues/654

However, to my knowledge, it will be fixed in the next release of the AASX Package Explorer (see the linked ticket for more infos, e.g., a draft PR).

BirgitBoss commented 8 months ago

I propose that the explorer support both: for reading .aasx support both http://www.admin-shell.io/aasx/relationships and http://admin-shell.io/aasx/relationships to also support older .aasx files for writing use http://admin-shell.io/aasx/relationships as specified in Part 5

JS-Aibel commented 7 months ago

For people working with Python Basyx library and Package Explorer, the following workaround worked for me. By changing the relationship type before calling the aasx.AASXWriter the AASX-file from the Python Basyx library can be opened in the Package Explorer.

See Python code below.

if package_explorer:
            aasx.RELATIONSHIP_TYPE_AASX_ORIGIN = "http://www.admin-shell.io/aasx/relationships/aasx-origin"
            aasx.RELATIONSHIP_TYPE_AAS_SPEC = "http://www.admin-shell.io/aasx/relationships/aas-spec"
            aasx.RELATIONSHIP_TYPE_AAS_SPEC_SPLIT = "http://www.admin-shell.io/aasx/relationships/aas-spec-split"
            aasx.RELATIONSHIP_TYPE_AAS_SUPL = "http://www.admin-shell.io/aasx/relationships/aas-suppl"
        else:
            aasx.RELATIONSHIP_TYPE_AASX_ORIGIN = "http://admin-shell.io/aasx/relationships/aasx-origin"
            aasx.RELATIONSHIP_TYPE_AAS_SPEC = "http://admin-shell.io/aasx/relationships/aas-spec"
            aasx.RELATIONSHIP_TYPE_AAS_SPEC_SPLIT = "http://admin-shell.io/aasx/relationships/aas-spec-split"
            aasx.RELATIONSHIP_TYPE_AAS_SUPL = "http://admin-shell.io/aasx/relationships/aas-suppl"

        with aasx.AASXWriter(file_path) as writer:
s-heppner commented 7 months ago

I'm sorry to chime in, but that will create problems down the line with every other implementation that follows the specification precisely.

As stated in the issue at the very beginning, the specification v3.0 requires " http://admin-shell.io/aasx/relationships", not " http://www.admin-shell.io/aasx/relationships".

You're therefore advocating to create non-standard-conformant AASX packages that can only be read and written with the package explorer. Those files are broken for every other implementation that did follow the specification verbatim and missed this discussion here, or did not build a workaround.

JS-Aibel commented 7 months ago

I'm sorry to chime in, but that will create problems down the line with every other implementation that follows the specification precisely.

As stated in the issue at the very beginning, the specification v3.0 requires " http://admin-shell.io/aasx/relationships", not " http://www.admin-shell.io/aasx/relationships".

You're therefore advocating to create non-standard-conformant AASX packages that can only be read and written with the package explorer. Those files are broken for every other implementation that did follow the specification verbatim and missed this discussion here, or did not build a workaround.

Thank you for your feedback, @s-heppner. Yes, I agree. That AASX-file should only be used for viewing in the Package Explorer. When we create an AASX-file, it is nice to be able to visually see the AAS in the Package Explorer.

What I usually do, is I create two files. One standard-conformant AASX packages. And another that has the extension filename_pkgex.aasx. The _pkgex is then only for viewing in the Package Explorer and nothing else.

ghost commented 7 months ago

That AASX-file should only be used for viewing in the Package Explorer.

That is also the way I understood it. @JS-Aibel 's post came at the perfect time to unblock my work (in my very early stage of exploring AAS use cases), but I will only use this hack to check that my .aasx is otherwise readable to the Package Explorer and to create some screenshots to show to other people. Those files will never be shared.

s-heppner commented 7 months ago

Thanks for the clarification, @JS-Aibel and @timo-dreyer-mahr In that case, I'm of course totally fine with that hack!

BirgitBoss commented 7 months ago

see also https://github.com/admin-shell-io/aas-specs/issues/307#issuecomment-1919345497

g1zzm0 commented 7 months ago

@martafullen Can you please move this issue back to the public repository? The topic is too relevant to keep it hidden here.

martafullen commented 7 months ago

@g1zzm0 this issue, as well as all the others in admin-shell-io/aasx-package-explorer, are being moved into the new official repo under eclipse-aaspe/aaspe. This process should be finished shortly and the discussion can continue there.

Sorry for the confusion.

P.S. this issue has been fixed and merged into main; it will be included in the next release

juileetikekar commented 6 months ago

PR #185 closes this issue.