You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Xavier Soudan <xs...@infovista.com> on 2016/01/14 13:06:12 UTC

Issue with $select and navigation properties

Hi,

I've an issue with the $select statement, when selecting navigation properties:
Let's have an EntitySet People, containing Entity Person
This entity Person has a navigation property Friends, which is an entityset of People too
Now if I try the following URL:
http://host/service/People?$select=UserName,Friends&$expand=Friends($select=UserName)

I get the following error response:
"Only simple and complex properties are allowed in selection."

But If I look at the specification from oasis
5.1.3 System Query Option $select
...
If the selectItem is a navigation property then the corresponding navigation link is represented in the response. If the navigation property also appears in an $expand<http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part2-url-conventions/odata-v4.0-errata02-os-part2-url-conventions-complete.html#_System_Query_Option_1> query option then it is additionally represented as inline content. This inline content can itself be restricted with a nested $select query option, see section 5.1.1.10.


So this behavior of Olingo looks like a bug to me. Is it a known issue that will be addressed ?

The issue is that it prevents using this service with external consumer, such as PowerQuery/PowerBI

Note that I get the expected result if I remove Friends from the $select, keeping it only in the $expand part. But I can't change this behavior from external consumers.
This test case is inspired from odata reference service TripPin http://services.odata.org/V4/TripPinServiceRW where the query returns the result with no error.


Regards,
Xavier.

RE: Issue with $select and navigation properties

Posted by "Amend, Christian" <ch...@sap.com>.
Hi Xavier,

you are correct this is a bug in version 4.0.0 and 4.1.0 of the Olingo library. With version 4.2.0 we have refactored the internal URI parsing heavily and fixed this bug there. Since this was some major refactoring I would not like to put this into a micro version Bugfix. So I hope you can wait until we release version 4.2.0. The appointed release date is end of March. You can always consume the SNAPSHOT version.

Best Regards,
Christian

From: Xavier Soudan [mailto:xsoudan@infovista.com]
Sent: Donnerstag, 14. Januar 2016 13:06
To: user@olingo.apache.org
Subject: Issue with $select and navigation properties

Hi,

I've an issue with the $select statement, when selecting navigation properties:
Let's have an EntitySet People, containing Entity Person
This entity Person has a navigation property Friends, which is an entityset of People too
Now if I try the following URL:
http://host/service/People?$select=UserName,Friends&$expand=Friends($select=UserName)

I get the following error response:
"Only simple and complex properties are allowed in selection."

But If I look at the specification from oasis
5.1.3 System Query Option $select
...
If the selectItem is a navigation property then the corresponding navigation link is represented in the response. If the navigation property also appears in an $expand<http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part2-url-conventions/odata-v4.0-errata02-os-part2-url-conventions-complete.html#_System_Query_Option_1> query option then it is additionally represented as inline content. This inline content can itself be restricted with a nested $select query option, see section 5.1.1.10.


So this behavior of Olingo looks like a bug to me. Is it a known issue that will be addressed ?

The issue is that it prevents using this service with external consumer, such as PowerQuery/PowerBI

Note that I get the expected result if I remove Friends from the $select, keeping it only in the $expand part. But I can't change this behavior from external consumers.
This test case is inspired from odata reference service TripPin http://services.odata.org/V4/TripPinServiceRW where the query returns the result with no error.


Regards,
Xavier.