Open jkhsjdhjs opened 1 year ago
Actually, I believe this may be a problem with the specification. In Part 5 Package File Format, it is specified that Submodels
should reference supplementary AASX-files via a "relative URI" in the File
SubmodelElement
.
Some further research proves constraint that the file://
prefix is mandatory in the PathType
is wrong: PathType Definition. Therefore, it would appear that the schemata is wrong here. I'll look into it.
RFC 8089 may not allow for relative paths, have you tried to start with a .
though?
Thanks for the investigation!
RFC 8089 may not allow for relative paths, have you tried to start with a
.
though?
I haven't tried that yet, but /TestFile.pdf
looks more like an absolute path to me anyways, where /
is the root of the AASX package.
As an ugly temporary fix, so that AASX-packages can used, we decided to remove the regex check from the schemata. We need to document this though and revert these changes with the upcoming spec fix.
When loading an AASX file, the aasx checks all submodels for
File
elements and tries to resolve the referenced files relative to the aasx container root. In Version 2.0, a document namedTestFile.pdf
in the AASX packages root would be referenced by aFile
element via the path/TestFile.pdf
. Since version 3.0, the schemata prohibit values like/TestFile.pdf
and require thefile://
protocol to be used, e.g.file:///TestFile.pdf
. The problem is thatFile
also supports remote references to files, for example viahttps://
. This isn't allowed by the new schemata.We should discuss whether the restrictions imposed by the schemata are actually correct, and if so, change the aasx adapter and examples accordingly.
See also: https://github.com/eclipse-basyx/basyx-python-sdk/blob/8304c2ad14f132c9d84b5b1d5185276b34fcc635/basyx/aas/examples/data/example_aas.py#L453 https://github.com/eclipse-basyx/basyx-python-sdk/blob/8304c2ad14f132c9d84b5b1d5185276b34fcc635/basyx/aas/examples/data/example_aas.py#L470-L471 https://github.com/eclipse-basyx/basyx-python-sdk/blob/8304c2ad14f132c9d84b5b1d5185276b34fcc635/basyx/aas/adapter/aasx.py#L233-L259