Skip to content

server: Implement the read-only $value routes - #623

Open
thammel wants to merge 1 commit into
eclipse-basyx:developfrom
rwth-iat:feat/446-get-value-endpoints
Open

server: Implement the read-only $value routes#623
thammel wants to merge 1 commit into
eclipse-basyx:developfrom
rwth-iat:feat/446-get-value-endpoints

Conversation

@thammel

@thammel thammel commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

All $value routes previously responded with 501 Not Implemented.

The specification leaves some points open, which are resolved as follows:

  • Property values are mapped to the JSON type of their valueType, so booleans and numbers are not quoted. Values without a JSON literal are returned as their XSD representation. xs:integer is unbounded in both Python and JSON and is therefore passed on as it is.
  • Elements without a value are omitted from Submodels, collections and Entity statements, but kept as null within a SubmodelElementList, as omitting them would shift the indices of the remaining elements.
  • Operations and Capabilities have no ValueOnly representation. They are skipped in containers and result in 400 Bad Request when requested directly, which is how the $metadata route handles them.
  • level=core returns the direct children of the requested resource and their nested containers as empty, matching the examples of the specification.
  • The entries of GET /submodels/{id}/submodel-elements/$value are mapped by idShort, as a bare SubmodelElementValue would lose the association between a value and its element. Submodels are returned as-is, since their entries are already named.
  • The languages of a MultiLanguageProperty are sorted, to keep the order of the response deterministic.

The ValueOnly serialization is only defined for JSON, so the routes respond with 406 Not Acceptable if XML is requested. extent remains unimplemented, as on all other routes. PATCH …/$value, the $path routes and the operation invocation routes are not part of this change.

Fixes #446

All `$value` routes previously responded with `501 Not Implemented`.

The specification leaves some points open, which are resolved as
follows:

- Property values are mapped to the JSON type of their `valueType`, so
  booleans and numbers are not quoted. Values without a JSON literal
  are returned as their XSD representation.
  `xs:integer` is unbounded in both Python and JSON and is
  therefore passed on as it is.
- Elements without a value are omitted from Submodels, collections and
  Entity statements, but kept as `null` within a SubmodelElementList, as
  omitting them would shift the indices of the remaining elements.
- Operations and Capabilities have no ValueOnly representation. They are
  skipped in containers and result in `400 Bad Request` when requested
  directly, which is how the `$metadata` route handles them.
- `level=core` returns the direct children of the requested resource and
  their nested containers as empty, matching the examples of the
  specification.
- The entries of `GET /submodels/{id}/submodel-elements/$value` are
  mapped by idShort, as a bare `SubmodelElementValue` would lose the
  association between a value and its element. Submodels are returned
  as-is, since their entries are already named.
- The languages of a MultiLanguageProperty are sorted, to keep the order
  of the response deterministic.

The ValueOnly serialization is only defined for JSON, so the routes
respond with `406 Not Acceptable` if XML is requested. `extent` remains
unimplemented, as on all other routes. `PATCH …/$value`, the `$path`
routes and the operation invocation routes are not part of this change.

Fixes eclipse-basyx#446
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.

1 participant