OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] Updated: (ODATA-280) Support cast segment in $expand


     [ http://tools.oasis-open.org/issues/browse/ODATA-280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Pizzo updated ODATA-280:
--------------------------------

    Proposal: 
Support the cast segment appended to the navigation property in $expand.

The ABNF construction rules would be:

expandItem   = [ qualifiedEntityTypeName "/" ] navigationProperty 
                         [ "/" qualifiedEntityTypeName  ]
                         [ "(" expandOption *( SEMI expandOption ) ")" ]
                         [ "/" qualifiedEntityTypeName  ]

  was:
Support the cast segment appended to the navigation property in $expand.

The ABNF construction rules would be:

expandItem   = [ qualifiedEntityTypeName "/" ] navigationProperty 
                         [ "/" qualifiedEntityTypeName  ]
                         [ "(" expandOption *( SEMI expandOption ) ")" ]


Note that, if approve ODATA-276, we will want to support casting to $ref *after* the expand options (doing so before is a little weird, since the things being expanded don't exist on the reference).

We could either:
1. Support cast segment before or after expand options:
~Employees?$expand=hr.Managers/DirectReports($filter=Salary gt 100000)
~Employees?$expand=hr.Managers($filter=Salary gt 10000)/DirectReports

expandItem   = [ qualifiedEntityTypeName "/" ] navigationProperty 
                         [ "/" qualifiedEntityTypeName  ]
                         [ "(" expandOption *( SEMI expandOption ) ")" ]
                         [ "/" qualifiedEntityTypeName  ]

2. Support cast segment only after expand options (if any):
~Employees?$expand=hr.Managers($filter=Salary gt 10000)/DirectReports

expandItem   = [ qualifiedEntityTypeName "/" ] navigationProperty 
                         [ "(" expandOption *( SEMI expandOption ) ")" ]
                         [ "/" qualifiedEntityTypeName  ]

3. Support cast segment before expand options and "casting" to $ref after expand options:
~Employees?$expand=hr.Managers/DirectReports($filter=Salary gt 10000)/$ref

expandItem   = [ qualifiedEntityTypeName "/" ] navigationProperty 
                         [ "/" qualifiedEntityTypeName  ]
                         [ "(" expandOption *( SEMI expandOption ) ")" ]
                         [ "/" ref  ]
ref= "$ref"

I could be talked into 1) or 2). 

Note that, in 1), putting the cast segment *before* the expand options would have a slightly different meaning than putting it after; before would scope the expand options just to the derived type, while after would apply the expand options first, then filter the results to those of the specified type.  So with 1) I could do:

~Employees/hr.Managers?$expand=DirectReports/hr.Managers($filter=DirectReports/$count gt 10)

while with 2) I would have to do:

~Employees/hr.Managers?$expand=DirectReports($filter=hr.Managers/DirectReports/$count gt 10)/hr.Managers

(which would also be valid in 1), just less concise)

> Support cast segment in $expand
> -------------------------------
>
>                 Key: ODATA-280
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-280
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData ABNF Construction Rules, OData Protocol , OData URL Conventions 
>    Affects Versions: V4.0_WD01
>         Environment: [Proposed]
>            Reporter: Michael Pizzo
>             Fix For: V4.0_WD01
>
>
> In ODATA-32 we added the ability to do things like filtered expands. We also support filtering collections by type using a CAST segment, and should do the same for $expanded properties.
> For example; 
>     ~Employees/hr.Managers?$expand=DirectReports
> today returns only those employees that are managers, and their direct reports.
>     ~Employees?$expand=hr.Managers/DirectReports
> today returns all employees and, for those employees that are managers, all of their direct reports.
> We would also support:
>     ~Employees/hr.Managers?$expand=DirectReports/hr.Managers
> to return only employees that were managers, and only those direct reports that were also managers.
> and
>     ~Employees?$expand=hr.Managers/DirectReports/hr.Managers
> to return all employees and, for each employee that was a manager, only those direct reports that were also managers.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]