eclipse-aaspe / package-explorer

AASX Package Explorer
Other
64 stars 19 forks source link

fixing namespace for relationships and making it backwards compatible… #197

Closed martafullen closed 7 months ago

martafullen commented 7 months ago

… (#690)

AlexanderWollbrink commented 7 months ago

The fix for the bug is up. I also added backwards compatible reading for "http://www.admin-shell.io/aasx/relationships/aas-suppl". Unfortunately, I can not see where the relationship for this is created, so I wasn't able to "convert" it to the new namespace. Maybe you could look into this @juileetikekar?

juileetikekar commented 7 months ago

Hi @AlexanderWollbrink,

Thank you for the fix.

Regarding fix related to "aas-suppl" file, please find my observations below:

  1. When creating a new AASX V3 file => A correct new namespace gets added.
  2. When converting V2 -> V3 => the namespace does not change, i.e., it remains "http://www.admin-shell.io/aasx/relationships/aas-suppl" (see the screenshot below).

image

The relationship gets created in case of supplementary files. If the AASX package has a supplimentary file, the relationship is found under "/aasx//_rels/.aas.xml.rel"

You can use the below AASX file to reproduce the issue. Please rename the from from .zip to .aasx.

TestAAS_V2.zip

If you unzip this file, you will find "AssetAdministrationShell---0F98619F.aas.xml.rels" file, which consists of "aas_suppl" relationship under "\aasx\AssetAdministrationShell---0F98619F\ _rels\".

Please let me know if you need more information.

AlexanderWollbrink commented 7 months ago

Hey @juileetikekar, thank you for the answer. My approach would be, to find the "old" namespace relationships, delete those and replace them with the new ones. The issue is, that I can't find where in the code the existing relationships for suppl. files appear or where inside the package-structure they are saved.

juileetikekar commented 7 months ago

Hi @AlexanderWollbrink,

In my opinion, we will need to add a code explicitely to handle the namespace change. The current implementation just takes care of "aas_suppl" relationship only in case of adding and deleting file in case of "save" operation.

AlexanderWollbrink commented 7 months ago

I tested this with several AASX files that I had and it worked nicely for all the relationships. In my opinion we can merge this into main.

mristin commented 7 months ago

Just a heads-up: there is a unit tested & battle tested implementation of AASX package: https://github.com/aas-core-works/aas-package3-csharp

You might want to consider using it in the future.

juileetikekar commented 7 months ago

My suggestion at this point is to merge the PR into main to unblock other activities. We can continue with the refactoring in next step.

@AlexanderWollbrink could you please merge the PR into main?