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

Navigation Properties in Complex Types (public comment c201305e00012)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.0_CSD01
    • Fix Version/s: V4.0_CSD02
    • Component/s: ATOM Format
    • Labels:
      None
    • Environment:

      [Applied]

    • Proposal:
      Hide

      Navigation properties in Atom are atom:link elements.

      Complex properties can be collection-valued, so the atom:link elements have to be placed within the representation of each single complex type instance.

      In ODATA-346 we decided that collections are NOT arrays, and items in a collection CANNOT be accessed by index. This makes features like the /$ref segment unavailable for navigation properties of complex types.

      This also requires that href attribute values in links within complex type instances MUST be direct links and CANNOT be indirect via the current entities, as they are by convention in OData V2 and V3 implementations.

      Example 1: Orders is indirect via customer entity, Country is direct with specified key
      <atom:entry>
      <atom:link rel="http://docs.oasis-open.org/odata/ns/related/Orders"
      type="application/atom+xml;type=entry" title="Orders"
      href="Customers('ALFKI')/Orders" />
      ...
      <metadata:properties>
      <Addresses>
      <metadata:element>
      <atom:link rel="http://docs.oasis-open.org/odata/ns/related/Country"
      type="application/atom+xml;type=entry" title="Country of residence"
      href="Countries('DE')" />
      <Street>Obere Str. 57</Street>
      <City>Berlin</City>
      <PostalCode>D-12209</PostalCode>
      </metadata:element>
      ...
      </Addresses>
      ...
      </metadata:properties>
      ...
      </atom:entry>

      Show
      Navigation properties in Atom are atom:link elements. Complex properties can be collection-valued, so the atom:link elements have to be placed within the representation of each single complex type instance. In ODATA-346 we decided that collections are NOT arrays, and items in a collection CANNOT be accessed by index. This makes features like the /$ref segment unavailable for navigation properties of complex types. This also requires that href attribute values in links within complex type instances MUST be direct links and CANNOT be indirect via the current entities, as they are by convention in OData V2 and V3 implementations. Example 1: Orders is indirect via customer entity, Country is direct with specified key <atom:entry> <atom:link rel="http://docs.oasis-open.org/odata/ns/related/Orders" type="application/atom+xml;type=entry" title="Orders" href="Customers('ALFKI')/Orders" /> ... <metadata:properties> <Addresses> <metadata:element> <atom:link rel="http://docs.oasis-open.org/odata/ns/related/Country" type="application/atom+xml;type=entry" title="Country of residence" href="Countries('DE')" /> <Street>Obere Str. 57</Street> <City>Berlin</City> <PostalCode>D-12209</PostalCode> </metadata:element> ... </Addresses> ... </metadata:properties> ... </atom:entry>
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/49351/odata-atom-format-v4.0-wd02-2013-05-28.docx https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/schemas/metadata.xsd?rev=318 Accepted: https://www.oasis-open.org/committees/download.php/49557/odata-meeting-41_on-20130613_14-F2F-minutes.html#odata-407

      Description

      The public comment [c201305e00012](https://lists.oasis-open.org/archives/odata-comment/201305/msg00012.html) with title "Navigation Properties in Complex Types" states:

      """
      [OData-Part3] (CSDL Defintion) states:

      As structural and navigation properties MAY be returned by the service on instances of any structured type, whether or not the type is marked as open. Clients MUST always be prepared to deal with additional properties on instances of any structured type, see [OData-Protocol].

      In this light, I wonder, what is the reason tat complex types cannot declare navigation properties in metadata? I would serve a lot of real -life cases
      For example, the Address complex type used throughout the documents is a bit unrealistic, as in most real cases it should contain a navigation property "Country", referencing another enitity, not just text representaion
      """

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              sdrees Stefan Hagen
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: