-
Notifications
You must be signed in to change notification settings - Fork 27
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
Reading published AAS Submodel Templates from aasx #232
Comments
Thank you for opening this issue. Therefore, to my knowledge, it is still aas-package-explorer#666 that is the issue, as also shown by the stack-trace you provided that says that the Edit (2024-03-14, @s-heppner): |
@s-heppner this issue doesn't exist anymore. And i get the same error for: Traceback (most recent call last):
File "./venv/lib/python3.10/site-packages/basyx/aas/adapter/aasx.py", line 144, in read_into
aasx_origin_part = core_rels[RELATIONSHIP_TYPE_AASX_ORIGIN][0]
IndexError: list index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./src/__main__.py", line 22, in <module>
reader.read_into(object_store=new_object_store,
File "./venv/lib/python3.10/site-packages/basyx/aas/adapter/aasx.py", line 146, in read_into
raise ValueError("Not a valid AASX file: aasx-origin Relationship is missing.") from e
ValueError: Not a valid AASX file: aasx-origin Relationship is missing. I downloaded this file from: https://v3security.admin-shell-io.com/. The following required namespaces are not declared: https://admin-shell.io/aas/3/0 - Is the input document of an older version?
Unexpected top-level list {http://admin-shell.io/aas/3/0}assetAdministrationShells on line 3!
Unexpected top-level list {http://admin-shell.io/aas/3/0}assets on line 20!
Unexpected top-level list {http://admin-shell.io/aas/3/0}submodels on line 21!
Unexpected top-level list {http://admin-shell.io/aas/3/0}conceptDescriptions on line 810! I use the main branch. |
Looks like you'd only have to append an
You can zip the |
I've contacted the guys to make the aas-package-explorer#666 issue visible again, considering there are obviously lots of shells in the wild that still have this issue, even if the newest version of the AASX Package Explorer fixed it. Edit: It's now found here: eclipse-aaspe/aaspe#161 |
thanks for the Reply! Let's explain further what i did. The following required namespaces are not declared: https://admin-shell.io/aas/3/0 - Is the input document of an older version?
Unexpected top-level list {http://admin-shell.io/aas/2/0}assetAdministrationShells on line 3!
Unexpected top-level list {http://admin-shell.io/aas/2/0}assets on line 20!
Unexpected top-level list {http://admin-shell.io/aas/2/0}submodels on line 21!
Unexpected top-level list {http://admin-shell.io/aas/2/0}conceptDescriptions on line 810! ok, let's unzip it. If i replace all The following required namespaces are not declared: https://admin-shell.io/aas/3/0 - Is the input document of an older version?
Unexpected top-level list {http://admin-shell.io/aas/3/0}assetAdministrationShells on line 3!
Unexpected top-level list {http://admin-shell.io/aas/3/0}assets on line 20!
Unexpected top-level list {http://admin-shell.io/aas/3/0}submodels on line 21!
Unexpected top-level list {http://admin-shell.io/aas/3/0}conceptDescriptions on line 810! if i replace all Traceback (most recent call last):
File "./basyx/basyx/aas/adapter/aasx.py", line 144, in read_into
aasx_origin_part = core_rels[RELATIONSHIP_TYPE_AASX_ORIGIN][0]
IndexError: list index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./src/__main__.py", line 27, in <module>
reader.read_into(object_store=new_object_store,
File "./basyx/basyx/aas/adapter/aasx.py", line 146, in read_into
raise ValueError("Not a valid AASX file: aasx-origin Relationship is missing.") from e
ValueError: Not a valid AASX file: aasx-origin Relationship is missing. What's also confusing is the line numbers, because there is no occur of <?xml version="1.0"?>
<aas:aasenv xmlns:IEC="http://admin-shell.io/IEC61360/3/0" xmlns:xsi="http://w3.org/2001/XMLSchema-instance" xmlns:abac="http://admin-shell.io/aas/abac/3/0" xsi:schemaLocation="http://admin-shell.io/aas/3/0 AAS.xsd http://admin-shell.io/IEC61360/3/0 IEC61360.xsd" xmlns:aas="http://admin-shell.io/aas/3/0">
<aas:assetAdministrationShells>
<aas:assetAdministrationShell>
<aas:idShort />
<aas:identification idType="Custom">AssetAdministrationShell---61CFE571</aas:identification>
<aas:assetRef>
<aas:keys />
</aas:assetRef>
<aas:submodelRefs>
<aas:submodelRef>
<aas:keys>
<aas:key type="Submodel" local="true" idType="IRI">https://example.com/ids/sm/1231_6162_1022_9579</aas:key>
</aas:keys>
</aas:submodelRef>
</aas:submodelRefs>
<aas:conceptDictionaries />
</aas:assetAdministrationShell>
</aas:assetAdministrationShells>
<aas:assets />
<aas:submodels>
<aas:submodel>
<aas:idShort>ContactInformations</aas:idShort>
<aas:identification idType="IRI">https://example.com/ids/sm/1231_6162_1022_9579</aas:identification>
<aas:kind>Template</aas:kind>
<aas:semanticId>
<aas:keys>
<aas:key type="ConceptDescription" local="true" idType="IRI">http://admin-shell.io/zvei/nameplate/1/0/ContactInformations</aas:key> line 810-828: <aas:conceptDescriptions>
<aas:conceptDescription>
<aas:idShort>RoleOfContactPerson</aas:idShort>
<aas:identification idType="IRDI">0173-1#02-AAO204#003</aas:identification>
<aas:embeddedDataSpecification>
<aas:dataSpecificationContent>
<aas:dataSpecificationIEC61360>
<IEC:preferredName />
<IEC:shortName />
<IEC:unit />
<IEC:dataType />
<IEC:definition>
<IEC:langString lang="en">function of a contact person in a process</IEC:langString>
</IEC:definition>
</aas:dataSpecificationIEC61360>
</aas:dataSpecificationContent>
<aas:dataSpecification>
<aas:keys>
<aas:key type="GlobalReference" local="false" idType="IRI">http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0</aas:key> It would be nice if you could help me figure out what's wrong with this files. aasx-server | fail: IO.Swagger.Lib.V3.Middleware.ExceptionMiddleware[0]
aasx-server | Object reference not set to an instance of an object. Same with the basyx testfiles. Every project assert to support V3, but they don't work together. PS:
That work's, i can read this files. But i would like to use templates. I don't want to create every file myself if i can avoid it. |
You cannot just do that. The
Did you perhaps also replace this in the
The curly braces
|
Oh wow, thank you for your detailed research! I checked this Submodel Template's history and it's last been touched 2 years ago: https://github.com/admin-shell-io/submodel-templates/commits/main/published/Contact%20Information/1 Since v3.0 of the metamodel was released in April of last year, the SMT must be of version 2.0.1 of the metamodel (or even older).
Back then, the
Since some of the model objects changed between v3.0 and v2.0.1, doing this will most likely break everything.
Now it's me that gets confused. The file cannot be of v3.0. I have no idea, why the
My conclusion that I draw from the information that I can see right now:
We try our best to follow the specification of the AAS verbatim. |
This is probably because @Kuchsn replaced |
Ok, a lot makes more sense now i think. |
You're very welcome! |
Yeah, that annoys me, too. As you can see in #185, we get a lot of issues similar to yours. These minor changes like
Sure, just keep in mind that these are for V2 and that you'll need the older basyx-python-sdk version. |
Reading published AAS Submodel Templates
When trying to read published Submodel Templates from the provided aasx-files i get an error.
I tried to read them like this:
And i got the following error:
This error could be related to known issues #185 or #666, but it's also possible that it's a separate issue.
The text was updated successfully, but these errors were encountered: