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-1071) Nullable Collection Navigation Property

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

Ralf Handl commented on ODATA-1071:

Collection-valued navigation properties are sets of related entities, not lists:
- the set cannot contain duplicates
- the set cannot contain null because null is not an entity

An empty set of related entities is represented as an empty array. We didn't see a semantic difference between "no set of related entities" and "an empty set of related entities", both boil down to "no related entities". Using an empty array is less surprising when filtering a set of entities: "no matching entities" results in an empty array, independently of whether the unfiltered set is empty or not.

The story is slightly different for collection-valued structural properties, especially since we introduced ordered collections, i.e. arrays. Here null is an allowed array item, and Nullable="true" is allowed.

We didn't see a significant semantic difference between "no array" and "an empty array" that would have justified introducing an additional CollectionIsNullable attribute.

> Nullable Collection Navigation Property
> ---------------------------------------
>                 Key: ODATA-1071
>                 URL: https://issues.oasis-open.org/browse/ODATA-1071
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: CSDL JSON , CSDL XML
>    Affects Versions: V4.0_CS02
>         Environment: Schema 
>            Reporter: George Ericson
>            Assignee: George Ericson
>              Labels: Clarification, Errata
>             Fix For: V4.01_CSD02
> There is the assertion:
> "Nullable MUST NOT be specified for a collection-valued navigation property, a collection is allowed to have zero items."
> A property, regardless of multiplicity consumes a slot in an instance (entity representation).  The slot has a sequence of values, depending on cardinality.  If the slot has no values, then the property is said to be null.  If an entry in a list of values has no value, then that entry is null.  So, you can both have a collection property that is null or a collection property consisting of a list of null values.  After much discussion, the DMTF specified the following for the values of a collection property (i.e. upper bound on multiplicity > 1)
> - NULL: The collection has no specified value.
> - [] : The collection has no elements (I.e. size = 0
> - [ Null ] : The collection has one element specified as having no value
> - [ "" ] : The collection has one element specified as having the empty string
> - [ "x", Null, "y",...] : The collection has multiple elements, some may be specified as having no value.
> The collection representing the list of values is not a separate modeled entity, rather it is a representation of the value list of the property itself.

This message was sent by Atlassian JIRA

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