DAP4: Proposal for Structure Projection
Assume this running example
<Structure name="ST"> <dimension name=z/> <Int32 name="f1"> <dimension value=5/> </Int32> <Int32 name="f2"> <Int32 name="f3"> </Structure>
In DAP2, a complete and possibly range-projected structure could be returned using an expression such as this.
[Note: a range projection is the typical DAP2 projection of a set of array dimensions such as A[1:10][31:2:40] ].
If, however, one wanted to return some non-empty subset of the fields of that structure, one had to resort to using multiple separate expressions – one for each field of interest – and rely on the implicit rule that such separately chosen fields would be placed into the same structure. So, to get ST with only fields f2 and f3, one had to write something like this.
This introduced the obvious problem of having to figure out which fields should be grouped together. If I had written this
this would have to appear to the client in the resulting DDX as two separate structures using some rename algorithm.
I want to propose that we extend the [...] notation to allow the specification of fields (as I have done for relational projections). So the above example would be written like this.
Additionally, nesting would be allowed. This would allow one to write things like this.