Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-36

Make $expand implicit if navigation properties are mentioned in $select

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.0_WD01
    • Fix Version/s: V4.0_WD01
    • Component/s: Protocol, URL Conventions
    • Labels:
      None
    • Environment:

      [Closed]

    • Proposal:
      Hide

      I propose we keep $select and $expand separate.

      $expand and $select are different parts of the query, handled and evaluated at different points in time (similar to FROM and SELECT clauses in SQL).

      $expand is evaluated before $select and identifies the full set of entities available to the client. Once that full set of data is defined, $select allows the client to select the properties of those entities that are of interest from that set of data.

      We are looking at extending $expand to include things like filtering and sorting of the related entities. I would not like to introduce complexity by saying that $expand is used in some case (i.e., where filtering/sorting of related entities is required) but not used in other cases.

      Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47432/latest/odata-meeting-15_on-20121108_9-F2F-minutes.html

      Show
      I propose we keep $select and $expand separate. $expand and $select are different parts of the query, handled and evaluated at different points in time (similar to FROM and SELECT clauses in SQL). $expand is evaluated before $select and identifies the full set of entities available to the client. Once that full set of data is defined, $select allows the client to select the properties of those entities that are of interest from that set of data. We are looking at extending $expand to include things like filtering and sorting of the related entities. I would not like to introduce complexity by saying that $expand is used in some case (i.e., where filtering/sorting of related entities is required) but not used in other cases. Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47432/latest/odata-meeting-15_on-20121108_9-F2F-minutes.html

      Description

      Currently clients need to repeat themselves when projecting on expanded entities:

      GET http://services.odata.org/OData/OData.svc/Products?$select=*,Category/Name&$expand=Category

      This could be reduced to

      GET http://services.odata.org/OData/OData.svc/Products?$select=*,Category/Name

      because the client explicitly requests Category/Name, and the server can only satisfy that if it expands the Category.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              martinzurmuehl Martin Zurmuehl
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: