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

Allow path in an edm:key to also use a primitive property of a non null-able navigation property (recursively) of the entity type.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_ERRATA03
    • Fix Version/s: V4.01_WD01
    • Component/s: CSDL XML, Protocol
    • Labels:
      None
    • Environment:

      Proposed

    • Proposal:
      Hide

      Allow the path expression to include references to unique, immutable, primitive (i.e., key) properties of non null-able, immutable navigation properties (recursively).

      8.3.1 Attribute Name could be simply amended as in:
      The edm:PropertyRef element MUST specify a value for the Name attribute which MUST be a path expression resolving to a primitive property of the entity type itself or to a primitive property of a complex or a single-valued, non-nullable navigation property (recursively) of the entity type. The names of the properties in the path are joined together by forward slashes.

      Semantics:
      In JSON payloads:
      1) The id must be written, even in minimal metadata, or
      2) The nav properties must be expanded to include at least the related ids (service could default expand to include the related id fields.)
      You can only create the entity if:
      a. You include a link to an existing related entity containing the key value, or
      b. You do a deep insert that includes the related entity
      You can't change the relationship to the related entity containing the key value (so it would have to be single, non-nullable, and immutable)
      The referenced property(ies) on the related entity must be immutable and must be unique (i.e., are generally a key of the related entity)
      Deleting the related entity deletes the entity whose key referenced a property of that entity

      Show
      Allow the path expression to include references to unique, immutable, primitive (i.e., key) properties of non null-able, immutable navigation properties (recursively). 8.3.1 Attribute Name could be simply amended as in: The edm:PropertyRef element MUST specify a value for the Name attribute which MUST be a path expression resolving to a primitive property of the entity type itself or to a primitive property of a complex or a single-valued, non-nullable navigation property (recursively) of the entity type. The names of the properties in the path are joined together by forward slashes. Semantics: In JSON payloads: 1) The id must be written, even in minimal metadata, or 2) The nav properties must be expanded to include at least the related ids (service could default expand to include the related id fields.) You can only create the entity if: a. You include a link to an existing related entity containing the key value, or b. You do a deep insert that includes the related entity You can't change the relationship to the related entity containing the key value (so it would have to be single, non-nullable, and immutable) The referenced property(ies) on the related entity must be immutable and must be unique (i.e., are generally a key of the related entity) Deleting the related entity deletes the entity whose key referenced a property of that entity

      Description

      Currently a key can only be made up of properties that are either in the entity type directly or in a complex property recursively. It therefore explicitly excludes the use of these properties in a, non null-able, navigation property. This causes the modeler to expose the underlying data structure as he'll have to add these primitive properties to the entity directly and keeping them in sync using referential constraints.
      An example that shows this would be a situation like in graphs where nodes are connected by edges and where an edge gets particular properties associated to it. Here the edge will have to, apart from the two navigation properties representing the nodes it is connecting also two primitive properties that contain the node IDs to be able to form a key for an edge.
      Obviously many m-n relationships exist which have additional properties describing the relationship exist that would benefit.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hubert.heijkers Hubert Heijkers (Inactive)
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: