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

7.1: Add example for grouping by single-valued navigation property

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_CSD03
    • Fix Version/s: V4.0_CSD04
    • Component/s: Data Aggregation
    • Labels:
      None
    • Environment:

      Applied

    • Proposal:
      Hide

      Proposal amended during meeting 2018-7-19: treat group by NavProp as group by NavProp/$ref and return the nested @odata.id values

      Since section 3.10.1 only mentions grouping by navigation properties, but lacks a definition that is then finally given by example in section 7.1, move the relevant statements from section 7.1 to 3.10.1

      Show
      Proposal amended during meeting 2018-7-19: treat group by NavProp as group by NavProp/$ref and return the nested @odata.id values Since section 3.10.1 only mentions grouping by navigation properties, but lacks a definition that is then finally given by example in section 7.1, move the relevant statements from section 7.1 to 3.10.1

      Description

      Section 7.1 defines the result of grouping by a single-valued navigation property without giving an example.

      Any example in this section that groups by the key property of a related entity could be rephrased to group by the navigation property instead. Here's how example 52 would look like:

      GET ~Sales?$apply=groupby((Customer,Product))
      

      and results in

      {
        "@odata.context": "$metadata#Sales(Customer,Product)",
        "value": [
          { "@odata.id": null, "Customer": { "@odata.id": "Customers('C1')" }, "Product": { "@odata.id": "Products('P2')" } },
          { "@odata.id": null, "Customer": { "@odata.id": "Customers('C1')" }, "Product": { "@odata.id": "Products('P3')" } },
          { "@odata.id": null, "Customer": { "@odata.id": "Customers('C1')" }, "Product": { "@odata.id": "Products('P1')" } },
          { "@odata.id": null, "Customer": { "@odata.id": "Customers('C2')" }, "Product": { "@odata.id": "Products('P2')" } },
          { "@odata.id": null, "Customer": { "@odata.id": "Customers('C2')" }, "Product": { "@odata.id": "Products('P3')" } },
          { "@odata.id": null, "Customer": { "@odata.id": "Customers('C3')" }, "Product": { "@odata.id": "Products('P3')" } },
          { "@odata.id": null, "Customer": { "@odata.id": "Customers('C3')" }, "Product": { "@odata.id": "Products('P1')" } }
        ]
      }
      

        Attachments

          Activity

          handl Ralf Handl created issue -
          handl Ralf Handl made changes -
          Field Original Value New Value
          Description Section 7.1 defines the result of grouping by a single-valued navigation property without giving an example.

          Any example in this section that groups by the key property of a related entity could be rephrased to group by the navigation property instead. Here's how example 52 would look like:

          GET ~Sales?$apply=groupby((Customer,Product))
          and results in
          {
            "@odata.context": "$metadata#Sales(Customer(Name,ID),Product(Name))",
            "value": [
              { "@odata.id": null,
                "Customer@odata.navigationLink": "Customers('C1')",
                "Product@odata.navigationLink": "Products('P2')" },
              { "@odata.id": null,
                "Customer@odata.navigationLink": "Customers('C1')",
                "Product@odata.navigationLink": "Products('P3')" },
              { "@odata.id": null,
                "Customer@odata.navigationLink": "Customers('C1')",
                "Product@odata.navigationLink": "Products('P1')"},
              { "@odata.id": null,
                "Customer@odata.navigationLink": "Customers('C2')",
                "Product@odata.navigationLink": "Products('P2')" },
              { "@odata.id": null,
                "Customer@odata.navigationLink": "Customers('C2')",
                "Product@odata.navigationLink": "Products('P3')" },
              { "@odata.id": null,
                "Customer@odata.navigationLink": "Customers('C3')",
                "Product@odata.navigationLink": "Products('P3')"} },
              { "@odata.id": null,
                "Customer@odata.navigationLink": "Customers('C3')",
                "Product@odata.navigationLink": "Products('P1')" }
            ]
          }
          Section 7.1 defines the result of grouping by a single-valued navigation property without giving an example.

          Any example in this section that groups by the key property of a related entity could be rephrased to group by the navigation property instead. Here's how example 52 would look like:

          GET ~Sales?$apply=groupby((Customer,Product))
           and results in
           {
           "@odata.context": "$metadata#Sales(Customer,Product)",
           "value": [

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C1')", "Product@odata.navigationLink": "Products('P2')" }

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C1')", "Product@odata.navigationLink": "Products('P3')" }

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C1')", "Product@odata.navigationLink": "Products('P1')"}

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C2')", "Product@odata.navigationLink": "Products('P2')" }

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C2')", "Product@odata.navigationLink": "Products('P3')" }

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C3')", "Product@odata.navigationLink": "Products('P3')"}

          },

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C3')", "Product@odata.navigationLink": "Products('P1')" }

          ]
           }
          mikep Michael Pizzo (Inactive) made changes -
          Status New [ 10000 ] Open [ 1 ]
          mikep Michael Pizzo (Inactive) made changes -
          Proposal See description Proposal amended during meeting 2018-7-19: treat group by NavProp as group by NavProp/$ref and return the nested @odata.id values
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          Resolved per amended proposal 2018-7-19

          Show
          mikep Michael Pizzo (Inactive) added a comment - Resolved per amended proposal 2018-7-19
          mikep Michael Pizzo (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          handl Ralf Handl made changes -
          Description Section 7.1 defines the result of grouping by a single-valued navigation property without giving an example.

          Any example in this section that groups by the key property of a related entity could be rephrased to group by the navigation property instead. Here's how example 52 would look like:

          GET ~Sales?$apply=groupby((Customer,Product))
           and results in
           {
           "@odata.context": "$metadata#Sales(Customer,Product)",
           "value": [

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C1')", "Product@odata.navigationLink": "Products('P2')" }

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C1')", "Product@odata.navigationLink": "Products('P3')" }

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C1')", "Product@odata.navigationLink": "Products('P1')"}

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C2')", "Product@odata.navigationLink": "Products('P2')" }

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C2')", "Product@odata.navigationLink": "Products('P3')" }

          ,

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C3')", "Product@odata.navigationLink": "Products('P3')"}

          },

          { "@odata.id": null, "Customer@odata.navigationLink": "Customers('C3')", "Product@odata.navigationLink": "Products('P1')" }

          ]
           }
          Section 7.1 defines the result of grouping by a single-valued navigation property without giving an example.

          Any example in this section that groups by the key property of a related entity could be rephrased to group by the navigation property instead. Here's how example 52 would look like:

          {code}
          GET ~Sales?$apply=groupby((Customer,Product))
          {code}

          and results in

          {code:json}
          {
            "@odata.context": "$metadata#Sales(Customer,Product)",
            "value": [
              { "@odata.id": null, "Customer": { "@odata.id": "Customers('C1')" }, "Product": { "@odata.id": "Products('P2')" } },
              { "@odata.id": null, "Customer": { "@odata.id": "Customers('C1')" }, "Product": { "@odata.id": "Products('P3')" } },
              { "@odata.id": null, "Customer": { "@odata.id": "Customers('C1')" }, "Product": { "@odata.id": "Products('P1')" } },
              { "@odata.id": null, "Customer": { "@odata.id": "Customers('C2')" }, "Product": { "@odata.id": "Products('P2')" } },
              { "@odata.id": null, "Customer": { "@odata.id": "Customers('C2')" }, "Product": { "@odata.id": "Products('P3')" } },
              { "@odata.id": null, "Customer": { "@odata.id": "Customers('C3')" }, "Product": { "@odata.id": "Products('P3')" } },
              { "@odata.id": null, "Customer": { "@odata.id": "Customers('C3')" }, "Product": { "@odata.id": "Products('P1')" } }
            ]
          }
          {code}
          gerald.krause1 Gerald Krause made changes -
          Proposal Proposal amended during meeting 2018-7-19: treat group by NavProp as group by NavProp/$ref and return the nested @odata.id values Proposal amended during meeting 2018-7-19: treat group by NavProp as group by NavProp/$ref and return the nested @odata.id values

          Since section 3.10.1 only mentions grouping by navigation properties, but lacks a definition that is then finally given by example in section 7.1, move the relevant statements from section 7.1 to 3.10.1
          gerald.krause1 Gerald Krause made changes -
          Environment Proposed Applied
          handl Ralf Handl made changes -
          Status Resolved [ 5 ] Applied [ 10002 ]
          heiko.theissen Heiko Theissen made changes -
          Status Applied [ 10002 ] Closed [ 6 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: