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

Define an Edm.AnyType to allow functions to apply to entity sets of any entity type

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: CSDL XML
    • Labels:
      None
    • Environment:

      [Proposed]

    • Proposal:
      Hide

      Add the following types to the list of built-in types:
      -Edm.PrimitiveType
      -Edm.ComplexType
      -Edm.EntityType

      Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except:
      1) you can't use Edm.EntityType as the type for a named top-level entity in your container.
      2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set)
      3) in the base attribute of an EntityType/ComplexType definition (it's assumed)

      Examples of where you can use these abstract base types, as appropriate:
      -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property)
      -in a TypeDefinition
      -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType)
      -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType)
      -in a Parameter definition
      -as a Function returntype
      -in a Term definition

      Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example:
      ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf'
      This filters the results to only those that match the specified type and casts the results to that type.

      Accepted: https://www.oasis-open.org/committees/download.php/48097/odata-meeting-23_on-20130130_31-F2F-minutes.html#odata-16

      Show
      Add the following types to the list of built-in types: -Edm.PrimitiveType -Edm.ComplexType -Edm.EntityType Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except: 1) you can't use Edm.EntityType as the type for a named top-level entity in your container. 2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set) 3) in the base attribute of an EntityType/ComplexType definition (it's assumed) Examples of where you can use these abstract base types, as appropriate: -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property) -in a TypeDefinition -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType) -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType) -in a Parameter definition -as a Function returntype -in a Term definition Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example: ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf' This filters the results to only those that match the specified type and casts the results to that type. Accepted: https://www.oasis-open.org/committees/download.php/48097/odata-meeting-23_on-20130130_31-F2F-minutes.html#odata-16
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/48171/odata-core-v1.0-wd01-part3-csdl-2013-02-07-RH.doc https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/schemas/csdl.xsd?rev=175 Accepted: https://www.oasis-open.org/committees/download.php/48269/odata-meeting-25_on-20130214-minutes.html#odata-16

      Description

      OData might be extended to allow functions to apply to entity sets of any entity type. This could greatly reduce the number of functions that need to be defined for OData Extension for Temporal Data.

      This can also greatly simplify the Data Aggregation Extension, especially the WHERE-GROUPBY-HAVING dilemma.

      Consider a general Edm.Any type that can be used in Type= throughout the CSDL.

        Attachments

          Activity

          andrew.eisenberg Andrew Eisenberg (Inactive) created issue -
          ralfhandl Ralf Handl made changes -
          Field Original Value New Value
          Description OData might be extended to allow functions to apply to entity sets of any entity type. This could greatly reduce the number of functions that need to be defined for OData Extension for Temporal Data. OData might be extended to allow functions to apply to entity sets of any entity type. This could greatly reduce the number of functions that need to be defined for OData Extension for Temporal Data.

          This can also greatly simplify the Data Aggregation Extension, especially the WHERE-GROUPBY-HAVING dilemma.
          Priority Minor [ 4 ] Major [ 3 ]
          mikep Michael Pizzo (Inactive) made changes -
          Proposal Add the following types to the list of built-in types:
          -Edm.PrimitiveType
          -Edm.ComplexType
          -Edm.EntityType

          Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except:
          1) you can't use Edm.EntityType as the type for a named top-level entity in your container.
          2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set)
          3) in the base attribute of an EntityType/ComplexType definition (it's assumed)

          Examples of where you can use these abstract base types, as appropriate:
          -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property)
          -in a TypeDefinition
          -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType)
          -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType)
          -in a Parameter definition
          -as a Function returntype
          -in a Term definition (?)

          Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example:
          ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf'
          This filters the results to only those that match the specified type and casts the results to that type.
          Description OData might be extended to allow functions to apply to entity sets of any entity type. This could greatly reduce the number of functions that need to be defined for OData Extension for Temporal Data.

          This can also greatly simplify the Data Aggregation Extension, especially the WHERE-GROUPBY-HAVING dilemma.
          OData might be extended to allow functions to apply to entity sets of any entity type. This could greatly reduce the number of functions that need to be defined for OData Extension for Temporal Data.

          This can also greatly simplify the Data Aggregation Extension, especially the WHERE-GROUPBY-HAVING dilemma.

          Consider a general Edm.Any type that can be used in Type= throughout the CSDL.
          Environment [Proposed]
          Summary allow functions to apply to entity sets of any entity type Define an Edm.AnyType to allow functions to apply to entity sets of any entity type
          mikep Michael Pizzo (Inactive) made changes -
          Proposal Add the following types to the list of built-in types:
          -Edm.PrimitiveType
          -Edm.ComplexType
          -Edm.EntityType

          Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except:
          1) you can't use Edm.EntityType as the type for a named top-level entity in your container.
          2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set)
          3) in the base attribute of an EntityType/ComplexType definition (it's assumed)

          Examples of where you can use these abstract base types, as appropriate:
          -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property)
          -in a TypeDefinition
          -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType)
          -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType)
          -in a Parameter definition
          -as a Function returntype
          -in a Term definition (?)

          Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example:
          ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf'
          This filters the results to only those that match the specified type and casts the results to that type.
          Add the following types to the list of built-in types:
          -Edm.PrimitiveType
          -Edm.ComplexType
          -Edm.EntityType

          Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except:
          1) you can't use Edm.EntityType as the type for a named top-level entity in your container.
          2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set)
          3) in the base attribute of an EntityType/ComplexType definition (it's assumed)

          Examples of where you can use these abstract base types, as appropriate:
          -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property)
          -in a TypeDefinition
          -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType)
          -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType)
          -in a Parameter definition
          -as a Function returntype
          -in a Term definition

          Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example:
          ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf'
          This filters the results to only those that match the specified type and casts the results to that type.
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          We may need a way to define a common base between Edm.PrimitiveType and Edm.ComplexType, since they are generally usable in the same places. We will consider this when doing Metadata as a Service.

          Show
          mikep Michael Pizzo (Inactive) added a comment - We may need a way to define a common base between Edm.PrimitiveType and Edm.ComplexType, since they are generally usable in the same places. We will consider this when doing Metadata as a Service.
          ralfhandl Ralf Handl made changes -
          Status New [ 10000 ] Open [ 1 ]
          ralfhandl Ralf Handl made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          ralfhandl Ralf Handl made changes -
          Proposal Add the following types to the list of built-in types:
          -Edm.PrimitiveType
          -Edm.ComplexType
          -Edm.EntityType

          Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except:
          1) you can't use Edm.EntityType as the type for a named top-level entity in your container.
          2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set)
          3) in the base attribute of an EntityType/ComplexType definition (it's assumed)

          Examples of where you can use these abstract base types, as appropriate:
          -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property)
          -in a TypeDefinition
          -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType)
          -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType)
          -in a Parameter definition
          -as a Function returntype
          -in a Term definition

          Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example:
          ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf'
          This filters the results to only those that match the specified type and casts the results to that type.
          Add the following types to the list of built-in types:
          -Edm.PrimitiveType
          -Edm.ComplexType
          -Edm.EntityType

          Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except:
          1) you can't use Edm.EntityType as the type for a named top-level entity in your container.
          2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set)
          3) in the base attribute of an EntityType/ComplexType definition (it's assumed)

          Examples of where you can use these abstract base types, as appropriate:
          -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property)
          -in a TypeDefinition
          -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType)
          -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType)
          -in a Parameter definition
          -as a Function returntype
          -in a Term definition

          Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example:
          ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf'
          This filters the results to only those that match the specified type and casts the results to that type.

          Accepted: https://www.oasis-open.org/committees/download.php/48097/odata-meeting-23_on-20130130_31-F2F-minutes.html#odata-16
          Hide
          ralfhandl Ralf Handl added a comment - - edited

          Can Edm.PrimitiveType be used in a TypeDefinition?
          Can Edm.PrimitiveType be used in a key property of an entity type?

          Show
          ralfhandl Ralf Handl added a comment - - edited Can Edm.PrimitiveType be used in a TypeDefinition? Can Edm.PrimitiveType be used in a key property of an entity type?
          ralfhandl Ralf Handl made changes -
          Assignee Michael Pizzo [ mikep ] Ralf Handl [ ralfhandl ]
          handl Ralf Handl made changes -
          Assignee Ralf Handl [ ralfhandl ] Ralf Handl [ handl ]

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              andrew.eisenberg Andrew Eisenberg (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: