aas-specs icon indicating copy to clipboard operation
aas-specs copied to clipboard

Limit recursion depth for SMEs

Open arnoweiss opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. There should be a decision on a maximal recursion depth of SubmodelElements. Some SubmodelElements may contain arbitrary other SubmodelElements - namely:

  • SubmodelElementList
  • SubmodelElementCollection
  • Entity
  • AnnotatedRelationshipElement

This prevents overflow errors and should also serve as a guideline for modeling.

Describe the solution you'd like Define a maximal recursion depth in the spec. Suggestion: 100.

Describe alternatives you've considered Leave everything as is. There probably won't be any problems until someone has a really complex scenario where their stack crashes at runtime.

arnoweiss avatar Jan 22 '24 07:01 arnoweiss

@arnoweiss even the exact 100 as limit could still cause problems. https://github.com/eclipse-basyx/basyx-java-server-sdk/issues/158

mhrimaz avatar Jan 22 '24 07:01 mhrimaz

Spoke to some colleagues and they used 32 in similar specifications.

After all, it's up to the workstream AAS if this should be specified at all (I think it's relevant for interop --> not implementation-specific --> relevant for spec) and then decide on a reasonable number.

arnoweiss avatar Jan 23 '24 08:01 arnoweiss

You are probably right. To restrict recursion would not be backward-compatible but we could give a recommendation. I am happy to learn which depth might be appropriate. We should also have a look at existing Submodel Templates and which depth they used so far.

BirgitBoss avatar Jan 26 '24 17:01 BirgitBoss

TF AAS Part 1 2024-06-12 Decision Proposal: Add the following recommendation: A minimum recursion depth of 32 for Container-Elements should be supported. These are the SubmodelElements affected: SubmodelElementList SubmodelElementCollection Entity AnnotatedRelationshipElement Operation

For term "Container-Element" see also #420

BirgitBoss avatar Jun 12 '24 14:06 BirgitBoss

Workstream AAS Specs 2024-06-13 accepted to add recommendation A minimum recursion depth of 32 for Container-Elements should be supported. Additionally add note: This means for certification a maximum of 32 recursion test cases should be tested.

BirgitBoss avatar Jun 13 '24 08:06 BirgitBoss