成员未在ODATA查询中实现

时间:2016-11-22 10:45:33

标签: odata

我试图使用odata查询计算中立情绪。我的Http requerst是

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

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

但我得到的错误就是这样

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

我对odata的经验不足。还有其他办法可以获得情感总数。

1 个答案:

答案 0 :(得分:0)

Try the parameter like this(OData Version 2):

http://service_root_URI/odata/TweetSentiments/$count/?$top=1&$filter=Sentimenteq'Neutral'

工作示例:

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