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-979) Recursive containment navigation properties and Partner attribute


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

Michael Pizzo edited comment on ODATA-979 at 10/27/16 5:18 PM:
---------------------------------------------------------------

Struggling a bit with your example; wouldn't the parent property of  a FileSystemEntry always be a folder? i.e.;

- EntityType Name=FileSystemEntry 
  - NavigationProperty Name=Parent Type=this.Folder Nullable=true 

Or are you supporting embedding folders in folders or files, but files must be in folders, and the top-level thing must be a folder?  Not trying to be pedantic, just trying to understand if the example is off or if there's something more fundamental.

Also, I assume in your example that the "children" property should have containstarget=true?

In either case, your first objection is to the rule that the partner nav prop must be nullable, and you're pointing out that specialization allows the base type to be nullable but the derived type to be non-nullable.  i.e, you could define:

- EntityType Name=FileSystemEntry 
  - NavigationProperty Name=Parent Type=this.FileSystemContainer Nullable=true 

- EntityType Name=File BaseType=this.FileSystemEntry 
  - NavigationProperty Name=Parent Type=this.Folder Nullable=false 

- EntityType Name=FileSystemContainer BaseType=this.FileSystemEntry 
  - NavigationProperty Name=Children Type=Collection(this.FileSystemEntry) Partner=Parent ContainsTarget=true

- EntityType Name=Folder BaseType=this.FileSystemContainer
  - NavigationProperty Name=Parent Type=this.FileSystemContainer Nullable=false 

- EntityType Name=Drive BaseType=this.FileSystemContainer

In this example, only folders can be in drives, but files or folders can be in folders.  So your argument is that the parent of a file is always a folder, whose parent property is nullable, right?
 
Regardless, I don't think your example violates the rule that a type can only have one (declared or derived) nav prop whose partner specifies containstarget=true, right?  Does the wording for that rule just have to be improved?



was (Author: mikep):
Struggling a bit with your example; wouldn't the parent property of  a FileSystemEntry always be a folder? i.e.;

- EntityType Name=FileSystemEntry 
  - NavigationProperty Name=Parent Type=this.Folder Nullable=true 

Or are you supporting embedding folders in folders or files, but files must be in folders, and the top-level thing must be a folder?  Not trying to be pedantic, just trying to understand if the example is off or if there's something more fundamental.

Also, I assume in your example that the "children" property should have containstarget=true?

In either case, your first objection is to the rule that the partner nav prop must be nullable, and you're pointing out that specialization allows the base type to be nullable but the derived type to be non-nullable.  i.e, you could define:

- EntityType Name=FileSystemEntry 
  - NavigationProperty Name=Parent Type=this.FileSystemContainer Nullable=true 

- EntityType Name=File BaseType=this.FileSystemEntry 
  - NavigationProperty Name=Parent Type=this.Folder Nullable=false 

- EntityType Name=FileSystemContainer BaseType=this.FileSystemEntry 
  - NavigationProperty Name=Children Type=Collection(this.Folder) Partner=Parent ContainsTarget=true

- EntityType Name=Folder BaseType=this.FileSystemContainer
  - NavigationProperty Name=Parent Type=this.FileSystemContainer Nullable=false 

- EntityType Name=Drive BaseType=this.FileSystemContainer

In this example, only folders can be in drives, but files or folders can be in folders.  So your argument is that the parent of a file is always a folder, whose parent property is nullable, right?
 
Regardless, I don't think your example violates the rule that a type can only have one (declared or derived) nav prop whose partner specifies containstarget=true, right?  Does the wording for that rule just have to be improved?


> Recursive containment navigation properties and Partner attribute
> -----------------------------------------------------------------
>
>                 Key: ODATA-979
>                 URL: https://issues.oasis-open.org/browse/ODATA-979
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: OData CSDL
>    Affects Versions: V4.0_ERRATA03
>         Environment: Proposed
>            Reporter: Ralf Handl
>             Fix For: V4.01_WD01
>
>
> An entity cannot be referenced by more than one containment relationship, and cannot both belong to an entity set declared within the entity container and be referenced by a containment relationship. 
> Current rules around recursive containment and partner navigation properties seem to be sufficient to achieve this goal. but may not be necessary, i.e. seem overly restrictive.
> A counter-example to the current rules can be constructed by redefining a partner navigation property with a more specific type, which is allowed now:
> - EntityType Name=FileSystemEntry
>   - NavigationProperty Name=Parent Type=this.FileSystemEntry Nullable=true
> - EntityType Name=Folder BaseType=this.FileSystemEntry
>   - NavigationProperty Name=Children Type=Collection(this.FileSystemEntry) Partner=Parent
> - EntityType Name=File BaseType=this.FileSystemEntry
>   - NavigationProperty Name=Parent Type=this.Folder Nullable=false



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


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