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

Simplify custom aggregate term

    XMLWordPrintable

    Details

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

      [Proposed]

      Description

      In the current draft we have introduced an annotation term for defining a custom aggregate that can be applied to either an entity type or an entity container. The term's type is a complex type with a single property named "Type" which is the type returned by the custom aggregate.

      Because the type of the term is a complex type, rather than a simple type, application of the term requires a record constructor as in:

      <Annotation Term="Aggregation.CustomAggregate" Qualifier="Forecast">
      <Record>
      <PropertyValue Property="Type" String="Edm.Decimal"/>
      </Record>
      </Annotation>

      However, since we have only one property defined for the term we can make the term be of that type (string), rather than a complex type having a single property of that type. This would allow a much more concise application as:

      <Annotation Term="Aggregation.CustomAggregate" Qualifier="Forecast" String="Edm.Decimal"/>

      The drawbacks to this approach are:
      1) It would be harder to add additional properties to a custom aggregate in the future. However, the most common properties to want to add would be facets, and we could use a TypeDefinition for that. For other extensions, we could use the common metadata extension mechanism of annotating the annotation.
      2) It is slightly less intuitive what the single property represents. In the old format, you had the name of the property ("Type") to give you a hint what the string represented. In the new syntax you have to know that the string property that is the value of the custom aggregate is the type. We could rename the term something that would indicate that the string property represented the type of the custom aggregate (i.e., "CustomAggregateType"), but that would probably be even more confusing as the term really does define the aggregate (whose name is specified through the qualifier attribute) and not just the type of something being annotated.

      Still, the simplicity of expression seems to outweigh either of these drawbacks.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikep Michael Pizzo
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: