Search code examples
odata

Member is not implemented in ODATA Query


I'am trying to get count of Neutral Sentiments using odata query.My Http requerst is

http:// service root URI/odata/TweetSentiments$top=1&$filter=Sentiment eq 'Neutral' & $count=true

from

<a:feed m:context="$metadata#TweetSentiments" xmlns:a="http://www.w3.org/2005/Atom" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:d="http://docs.oasis-open.org/odata/ns/data">
<a:id>http://10.97.139.11:8004/odata//TwSentiments</a:id>
<a:entry>
<a:title/>
<a:summary/>
<a:updated>2016-11-22T10:34:29Z</a:updated>
<a:author>
<a:name/>
</a:author>
<a:content type="application/xml">
<m:properties>
<d:Time m:type="DateTimeOffset">2016-11-09T08:15:10.885Z</d:Time>
<d:TweetId>796264857880461316</d:TweetId>
<d:TweetText>Nae way did &lt;em>this is test tweet</d:TweetText>
<d:Sentiment>Neutral</d:Sentiment>
<d:SentimentValue m:type="Double">2.0</d:SentimentValue>
</m:properties>
</a:content>
</a:entry>
</a:feed>

But I'm getting error like this

 <error xmlns="http://docs.oasis-open.org/odata/ns/metadata">
<code>null</code>
<message>Member Sentiment is not implemented</message>
</error>

I've not enough experience in odata.Is there any other way to get total count of Sentiments.


Solution

  • Try the parameter like this(OData Version 2):
    
    http://service_root_URI/odata/TweetSentiments/$count/?$top=1&$filter=Sentimenteq'Neutral'
    

    Working Example:

    http://services.odata.org/OData/OData.svc/Categories(1)/Products/$count