OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: [OASIS Issue Tracker] (ODATA-1092) Navigation Property Binding (public comment c201707e0004)

    [ https://issues.oasis-open.org/browse/ODATA-1092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=66818#comment-66818 ] 

Michael Pizzo commented on ODATA-1092:

Issue 1: Today, the presence of a navigationpropertybinding means that all members of a navigation property exist in the same entity set.  Because they existing in the same entity set, their keys must be unique, so appending the key to the navigation property must uniquely identify the member of the navigation property.

As above, this is what is broken when we introduce multiple navigation property bindings; you are no longer assured that the keys uniquely identify an entity within the collection (just as, in 4.0, you couldn't be sure the keys uniquely identified the entity within the collection if there was no navigation property binding present).

Clients can always get the canonical URL for a member of a collection with a navigation property binding by appending the key to the target specified in the navigation property binding for the collection.  

Addressing an entity by appending the key directly to the navigation property is only supported if there is a single target entity set, otherwise we can't guarantee the keys are unique.  In 4.01, there is a single target entity set if there is a single navigation property that does not specify a type cast segment.  If the is a navigation property binding that includes the type in the path, then you can address instances of that type by appending the type, followed by the key, to the navigation property.

If the client is willing to look at the navigation property binding, they can use the target to address the entity. The whole point of appending the key to the navigation property is that you don't need to look up the target, you can address the entity by convention of appending the key to the navigation property.

In the Capabilities vocabulary we have the IndexableByKey annotation that could be applied to a navigation property to explicitly state that you can use the convention to address members.  That would be a better way to determine addressability than presence of the navigation property binding.
Issue 2:
We should recommend that services provide navigation property bindings for all instances, either by specifying bindings for all derived types or by specifying a binding that does not include the type, as appropriate. However, we can't enforce this, so we need to cover the case where a member of the collection doesn't match any of the bound paths (i.e., there is no binding for its type and no binding that doesn't specify a type). This is treated the same as today if there was no navigation property binding for that instance. 

> Navigation Property Binding (public comment c201707e0004)
> ---------------------------------------------------------
>                 Key: ODATA-1092
>                 URL: https://issues.oasis-open.org/browse/ODATA-1092
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Task
>          Components: CSDL JSON , CSDL XML
>    Affects Versions: V4.01_CSD02
>            Reporter: Ralf Handl
>             Fix For: V4.01_CS01
> Public Review Comment https://lists.oasis-open.org/archives/odata-comment/201707/msg00004.html
> This comment concerns navigation property bindings.  There are two parts, a general issue with 4.0 and a similar issue that has been introduced with 4.01.  The comment refers to:
> OData Common Schema Definition Language (CSDL) XML Representation Version 4.01
> Committee Specification Draft 02 / Public Review Draft 02
> § 8.4 says:
> > Containment navigation properties define an implicit entity set for each instance of its declaring structured
> > type
> § 13.4 says:
> > If the entity type of an entity set or singleton declares navigation properties, a navigation property binding
> > allows describing which entity set or singleton will contain the related entities
> It therefore makes sense that a Binding Target must identify a single entity set.
> My issue is that this path is allowed to be a path to any "containment navigation property in scope".  Such a path only identifies an entity set uniquely in cases where the path includes a singleton.  If the path includes an EntitySet then, as per 8.4, it will be pointing to a set of EntitySets, one per entity instance.  
> § 15.4 contains an example that highlights the problem:
> > MySchema.MyEntityContainer/MyEntitySet/MyContainmentNavigationProperty
> This issue applies to both version 4.0 and 4.01.  The resulting navigation property is only weakly bound.  Anyone attempting to validate a link must exhaustively search every instance of MyEntitySet to determine the validity of the link.  You also have the strange situation that a bound navigation property may link to two different entities WITH THE SAME KEY.  (There is no requirement that keys are unique across entity sets.) This contravenes one of the methods of addressing entities in URLs:
> OData Version 4.01. Part 2: URL Conventions § 4.9
> > For [ ... ] collection-valued navigation properties with a NavigationPropertyBinding or ContainsTarget=true specification, members of the collection can be addressed by convention by appending the parenthesized key to the URL specifying the collection of entities
> So the above is already a problem IMO and I propose that the target paths be restricted to traversing Singletons (that is, if an entity set is specified it must be the last component of the path).
> Coming on to the new issue in 4.01...
> Version 4.01 has modified the way navigation bindings work to allow a single navigation property to be bound, simultaneously, to multiple entity sets based on the type of the target.  Straight away this triggers the same issue, that bound navigation properties no longer have unique keys.
> I'm unhappy with the idea that a binding may now bind to multiple entity sets as it would involve removing the ability to append a key to uniquely identify an entity via a (bound) navigation path.  It isn't clear what problem you're trying to solve here but it feels like it is best solved using multiple navigation properties rather than attempting an 'octopus binding'.
> Even if you allow a single bound navigation property to bind to multiple entity sets the new feature creates the possibility of a partially bound navigation property.  If I have a navigation property called A of type Collection(TypeA) and TypeA has two sub-types, TypeB and TypeC then we can now bind any of the following:
> A
> A/TypeA
> A/TypeB
> A/TypeC
> The most specific rule applies so the last two rules override the first two but if we only bind A/TypeC then any instances of TypeB linked to A are unbound.  The result is a partially bound navigation property.  This could be corrected by requiring a default binding (with no type cast segment) if a type-cast binding is provided.
> Hopefully helpful.
> Steve

This message was sent by Atlassian JIRA

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]