Skip to content

Conversation

moritzsommer
Copy link
Contributor

Previously, we lacked a tutorial demonstrating how to navigate a Submodel's hierarchy using IdShorts and IdShortPaths.

This adds a simple tutorial for Submodel navigation and updates the documentation to reference it. The end user is shown how to navigate SubmodelElements, such as simple Properties, Property Collections, Property Lists and Collection Lists.

Fixes #351

Previously, we lacked a tutorial demonstrating how to navigate a
Submodel's hierarchy using IdShorts and IdShortPaths.

This adds a simple tutorial for Submodel navigation and updates the
documentation to reference it. The end user is shown how to navigate
SubmodelElements, such as simple Properties, Property Collections,
Property Lists and Collection Lists.

Fixes eclipse-basyx#351
@moritzsommer
Copy link
Contributor Author

I have two more questions about this topic:

  1. When using get_referable(), the user gets back a Referable object. This object does not have a value attribute, so in order to access this attribute (in a clean way, without mypy complaining), you have to cast. Is this behaviour intended?
  2. In the last dev meeting, we didn't cover the topic getting objects back out of an ObjectStore. Therefore, I didn't include it in the tutorial. However, Add tutorial aas_navigation  #351 and Usage of id_short Path Parameter in get_referable #345 mention it. Should I include the workflow presented in Usage of id_short Path Parameter in get_referable #345 in this tutorial?

Comment on lines -129 to +131
* [`tutorial_aasx`](./basyx/aas/examples/tutorial_aasx.py): Export Asset Administration Shells with related objects and auxiliary files to AASX package files
* [`tutorial_backend_couchdb`](./basyx/aas/examples/tutorial_backend_couchdb.py): Use the *Backends* interface (`update()/commit()` methods) to manage and retrieve AAS objects in a CouchDB document database
* [`tutorial_aasx`](./basyx/aas/examples/tutorial_aasx.py): Export Asset Administration Shells with related objects and auxiliary files to AASX package files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you move the tutorial_aasx down? In my head, it'd be a more logical order to first cover AASX and then CouchDB.

# through them using IdShorts and IdShortPaths.
#
# Step-by-Step Guide:
# Step 1: Create a Submodel with a Property, a Property Collection, a Property List and a Collection List
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Step 1: Create a Submodel with a Property, a Property Collection, a Property List and a Collection List
# Step 1: Create a Submodel with a Property, a SubmodelElementCollection of Properties, a SubmodelElementList of Properties and a SubmodelElementList of SubmodelElementCollections

Comment on lines +16 to +17
# Step 2: Navigate through the Submodel using IdShorts and IdShortPaths

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could add a little "directory-tree" here to show the final layout of the created Submodel? Something like:

Submodel
| -- Property "idShort1"
| -- SMC "idShort2"
|  | -- Property "idShort3"
| -- SML 
...

Comment on lines 9 to 14
tutorial_create_simple_aas
tutorial_serialization_deserialization
tutorial_navigate_aas
tutorial_storage
tutorial_serialization_deserialization
tutorial_backend_couchdb
tutorial_aasx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should follow the same order as in the README.

@s-heppner
Copy link
Contributor

@moritzsommer wrote here:

  1. When using get_referable(), the user gets back a Referable object. This object does not have a value attribute, so in order to access this attribute (in a clean way, without mypy complaining), you have to cast. Is this behaviour intended?
  2. In the last dev meeting, we didn't cover the topic getting objects back out of an ObjectStore. Therefore, I didn't include it in the tutorial. However, Add tutorial aas_navigation  #351 and Usage of id_short Path Parameter in get_referable #345 mention it. Should I include the workflow presented in Usage of id_short Path Parameter in get_referable #345 in this tutorial?

ad 1.) I agree that this is ugly, but not every Referable has a value in the meta-model and we need to follow the specification also for the abstract classes. Do you have a better solution than what we have now?

ad 2.) This should be covered by the tutorial_storage. Maybe you can refer in this tutorial to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants