Hi Hans-Jürgen,
JSONiq supports the descendant axis
indirectly with the descendant-objects function.
Engines can optimize as they do with XPath.
The following is like
$object/descendant-or-self::*
descendant-objects($object)
The following is like $object/descendant::*
descendant-objects(values($object))
The following is like $object//Field:
descendant-objects($object).Field
JSONiq does not have axes going back to
parents or ancestors or siblings, because 1)
there hasn't been much demand for it or any
specific use cases and 2) In the JDM (JSONiq
Data Model), objects or arrays don't "belong" to
their parents, which allows further
optimizations. As Dana says, not all tree
structures are alike and requirements are
different. For example, JSON trees (in JSONiq
and XQuery 3.1) are node-based, while XML trees
are edge-based: nodes "know" their name, but
JSON fields don't "know" their key.
Kind regards,
Ghislain