-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.01_CS01
-
Fix Version/s: V4.01_CS02
-
Component/s: Protocol
-
Labels:
-
Environment:
Proposed
-
Proposal:
-
Resolution:
Expressions in query options nested within $expand already can reference the instance identified by the resource path via the symbolic literal $it.
What's missing is in case of multiple nesting levels of $expand to reference the "next outer" instance.
Artificial example: expand all Bars that have the same Baz as the current instance of Foo
GET Foo?$expand=Bar($filter=Baz eq $it/Baz)
What if I want to do this one level down: expand all Bazes that have the same Qux as the current expanded Bar's Qux
GET Foo?$expand=Bar($expand=Baz($filter=Qux eq $outer/Qux))
Note: $up is basically the .. operator in Unix file systems.
Less artificial example: a service with temporal entity sets for Employee, WorkAssignment, and Department. I want to request employees and their work assignments over a period of time to see all changes in data, and want to expand the department with the snapshot state at the beginning of each work assignment because changes to the department are not of interest:
GET Employees?$from=2010-01-01&$to=2019-02-28&$expand=WorkAssignments($expand=Department($at=$outer/@Temporal.From))