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=66794#comment-66794 ] 

George Ericson commented on ODATA-1092:

On 8.4: Observation: A Containment Navigation Property is equivalent to declaring a Singleton or EntitySet within the EntityType or ComplexType.
On 13.4: Observation: 13.4.2 includes: 
"If the target is a target path, it MUST resolve to an entity set, singleton, or containment navigation property in scope. The path can traverse single-valued containment navigation properties or single-valued complex properties before ending in a containment navigation property, and there MUST NOT be any non-containment navigation properties prior to the final segment."
The 'single-valued' requirement can be satisfied by specifying a specific value in an array (i.e including keys as needed in the target path.)
On 15.4: Agree with the weakly bound statement. 
On 15.4: An entity may not be in two different EntitySets or Singletons.  See 6.5 Key
"An entity type’s key refers to the set of properties that uniquely identify an instance of the entity type within an entity set."
On 15.4: What URL construction rule that is contravened?
On URL convention: See first observation above.
On new issue: If the rule in the first observation is followed, then the ambiguity is removed.  Unfortunately, specification of target paths is more complicated.  Note though that only non-containment Navigation Properties need be bound.

> 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]