[Freebase-discuss] Sort data by timestamp
Shawn Simister
simister at google.com
Fri Dec 16 17:18:40 UTC 2011
The sort clause should be at the top level of the query and there also
needs to be a timestamp:null clause like I gave in my previous response so
that it can sort on that value. Also, all values are optional:false by
default so you don't need to state that explicitly. Here's what you end up
with:
[{
"creator": "/user/rakshit",
"mid": null,
"name": null,
"timestamp<=": "__now__",
"timestamp": null,
"sort": "-timestamp"
}]
Have you read through the MQL
Manual<http://wiki.freebase.com/wiki/MQL_Manual_Table_of_Contents>yet?
Its a good way to learn how to write MQL queries and will probably
cover a lot of the questions you have.
On Thu, Dec 15, 2011 at 10:09 PM, Saurabh Saxena <getsaurabhsaxena at gmail.com
> wrote:
> *[{
> "creator": "/user/rakshit",
> "mid": null,
> "name": {
> "value": null,
> "optional": false
> },
> "timestamp": {
> "value<=": "__now__",
> "optional": false,
> "sort": "-timestamp"
> }
> }]
> *
>
> I am using the above query and getting following error. What can be done
> for this?
> *
> *
> *message: "Unable to locate timestamp from sort"*
>
>
> Regards
> Saurabh
>
>
> On Fri, Dec 16, 2011 at 12:28 AM, Tom Morris <tfmorris at gmail.com> wrote:
>
>> On Thu, Dec 15, 2011 at 1:40 PM, Saurabh Saxena
>> <getsaurabhsaxena at gmail.com> wrote:
>>
>> > Can i sort my data in descending order by timestamp value.
>>
>> Yes.
>> _______________________________________________
>> You are receiving this message because you are subscribed to the
>> Freebase-discuss mailing list.
>> To post a message to the list: Freebase-discuss at freebase.com
>> To unsubscribe, view archives, etc:
>> http://lists.freebase.com/mailman/listinfo/freebase-discuss
>>
>
>
> _______________________________________________
> You are receiving this message because you are subscribed to the
> Freebase-discuss mailing list.
> To post a message to the list: Freebase-discuss at freebase.com
> To unsubscribe, view archives, etc:
> http://lists.freebase.com/mailman/listinfo/freebase-discuss
>
--
Shawn Simister
Developer Programs Engineer
Google, San Francisco
http://freebase.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freebase.com/pipermail/freebase-discuss/attachments/20111216/a343c04c/attachment.htm>
More information about the Freebase-discuss
mailing list