OASIS Open Data Protocol (OData) TC

 View Only
Expand all | Collapse all

[OASIS Issue Tracker] (ODATA-1558) Define semantics for navigation properties of type Edm.EntityType

  • 1.  [OASIS Issue Tracker] (ODATA-1558) Define semantics for navigation properties of type Edm.EntityType

    Posted 11-10-2022 17:50
    Michael Pizzo created ODATA-1558: ------------------------------------ Summary: Define semantics for navigation properties of type Edm.EntityType Key: ODATA-1558 URL: https://issues.oasis-open.org/browse/ODATA-1558 Project: OASIS Open Data Protocol (OData) TC Issue Type: New Feature Components: Protocol Affects Versions: V4.01_OS Environment: [Proposed] Reporter: Michael Pizzo Fix For: V4.01_ERRATA01 [OData Common Schema Definition Language (CSDL) XML Representation Version 4.01 (oasis-open.org) https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/odata-csdl-xml-v4.01.html#sec_BuiltInAbstractTypes ] defines the behavior for Edm.EntityType. It specifically disallows use of Edm.EntityType as the type of an EntitySet, because all instances within an entity set must have the same key. However, it leaves open the ability to use Edm.EntityType as the entity type of a navigation property. And, indeed, ODATA-1552 updates the xsd to allow navigation properties of type Edm.EntityType. What is missing is a description of the semantics of a navigation property whose type is Edm.EntityType. Specifically, since Edm.EntityType doesn't define a key, it's not possible to index into a navigation property of type Edm.EntityType by key *unless you insert a cast segment*. This is ramification is implied by other rules (so calling it out is not a breaking change) but it should be explicitly called out so that the user doesn't have to derive the semantics from the existing rules. We do separately have a rule that requires a collection-valued containment navigation property define a key (and thus, Edm.EntityType cannot be used as the type of a collection-valued containment navigation property): "For a collection-valued containment navigation property the specified entity type MUST have a [key https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/odata-csdl-xml-v4.01.html#sec_Key] defined." ; This is consistent with entitysets, which disallow the use of Edm.EntityType "because all entities in an entity set must have the same key fields to uniquely identify them within the set". Are there any other semantics of a (collection-valued) navigation property of Edm.EntityType that need to be spelled out? Also note that, in general, if there is no navigation property binding for a non-containment collection-valued navigation property, the key may not uniquely identify the instance. This has nothing to do with Edm.EntityType, and we may want to decide to open a separate issue to track, it just came up in scope of the discussion. -- This message was sent by Atlassian Jira (v8.3.3#803004)


  • 2.  RE: [odata] [OASIS Issue Tracker] (ODATA-1558) Define semantics for navigation properties of type Edm.EntityType

    Posted 11-10-2022 20:05
    Another way to think about EDM.EntityType is as an 'Abstract' superclass of all other EntityTypes.  Any Entity belonging to an EntitySet or Singleton must have a non-abstract EntityType. There is no conflict with collections, since a containment navigation property must be associated with an implicit or explicit EntitySet or Singleton.   A comment on this note : Also note that, in general, if there is no navigation property binding for a non-containment collection-valued navigation property, the key may not uniquely identify the instance. The key must uniquely identify an instance in its container (EntitySet or Singleton).  However, there is no requirement that each key value is unique across all containers. Therefore, a key value may not be unique in the collection, since entities in multiple containers might be referenced through a collection-valued navigation property.      George