Skip to content
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

Change TOSCA Path relationship traversal semantics #156

Open
lauwers opened this issue Oct 27, 2023 · 1 comment
Open

Change TOSCA Path relationship traversal semantics #156

lauwers opened this issue Oct 27, 2023 · 1 comment

Comments

@lauwers
Copy link
Contributor

lauwers commented Oct 27, 2023

The current draft of the TOSCA v2.0 spec states the following with respect to node and relationship indices:

Note that both the indexes can either be a non-negative integer, the keyword ALL, or missing. If it is a non-negative integer, 0 represents the first index and so on incrementally. If the index is missing, the semantic meaning is that the first index (index with value 0) is used. If it is the keyword ALL, then we return the result for all possible indices (further resolved separately) as a list. If the there are multiple ALL keywords in the definition, then all the results shall be merged into a single list.

I propose to change the semantics such that if the index is missing, the meaning is that all the nodes or all the relationships are specified. This feels more natural and less arbitrary, and is more consistent with the "entity referral" interpretation of TOSCA Path. It is also more consistent with the use of lists in programming languages, where the name of a list without an index refers to the entire list rather than to the first element in the list.

@lauwers
Copy link
Contributor Author

lauwers commented Oct 27, 2023

Alternatively, we could take count_range into account to determine the default:

  • if the upper bound of count_range is 1, then the default is to return the single element with index 0
  • if the upper bound of count_range is greater than 1, then the default is to return the entire list

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

No branches or pull requests

1 participant