Reputation: 3908
Freebase's metaweb query language can be used to retreive future events if you pass in an ISO8601 formatted date.
[{
"id": null,
"name": null,
"start_date" : null,
"type": "/time/event",
"start_date>" : "2011-09-02"
}]
NOW()
or CURDATE()
?Upvotes: 3
Views: 288
Reputation: 4603
There is no equivalent to SQL's NOW() or CURDATE in MQL. Whichever programming language you're using to send the query should have an equivalent function which you can use.
You can kind of get a list of future events by sorting them in descending order of start_date like this:
[{
"id": null,
"name": null,
"type": "/time/event",
"start_date": {
"value": null,
"optional": false
},
"sort": "-start_date.value"
}]
Upvotes: 1
Reputation: 511
You can also use __now__
in timestamp fields as a special shortcut:
[{
"id": null,
"name": null,
"start_date" : null,
"type": "/time/event",
"start_date>" : "__now__"
}]
You can see a live demo of this via this Freebase Query Editor snippet.
Upvotes: 4