Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion sdk/basyx/aas/adapter/aasx.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,20 @@ def read_into(self, object_store: model.AbstractObjectStore,
try:
aasx_origin_part = core_rels[RELATIONSHIP_TYPE_AASX_ORIGIN][0]
except IndexError as e:
raise ValueError("Not a valid AASX file: aasx-origin Relationship is missing.") from e
if core_rels.get("http://www.admin-shell.io/aasx/relationships/aasx-origin"):
# Since there are many AASX files with this (wrong) relationship URls in the wild, we make an exception
# and try to read it anyway. However, we notify the user that this may lead to data loss, since it is
# highly likely that the other relationship URLs are also wrong in that file.
# See also [#383](https://github.com/eclipse-basyx/basyx-python-sdk/issues/383) for the discussion.
logger.warning("SPECIFICATION VIOLATED: The Relationship-URL in your AASX file "
"('http://www.admin-shell.io/aasx/relationships/aasx-origin') "
"is not valid, it should be 'http://admin-shell.io/aasx/relationships/aasx-origin'. "
"We try to read the AASX file anyway, but this cannot guaranteed in the future,"
"and the file may not be fully readable, so data losses may occur."
"Please fix this and/or notify the source of the AASX.")
aasx_origin_part = core_rels["http://www.admin-shell.io/aasx/relationships/aasx-origin"][0]
else:
raise ValueError("Not a valid AASX file: aasx-origin Relationship is missing.") from e

read_identifiables: Set[model.Identifier] = set()

Expand Down
Loading