If you start to develop Freebase applications you then at some point you will inevitably see the error message “Query timeout”
For example, if you wanted to get a list of Musical Artists in Freebase you might try this query
{
“query”:[{
“id”:null,
“limit”:0,
“name”:null,
“type”:”/music/artist”
}]
}
But as there are almost 1/3 million artists in the database this query will timeout. That’s just as well, otherwise you would be loading a 30MB JavaScript file!
That was an extreme example, but as more users register with Freebase, my Map of Freebase Users occasionally timeouts. (It’s actually the MJT library which imposes the deadline here, not necessary the database which timeouts). Even if your application isn’t timing out, you find that your browser becomes unresponsive as it loads large JavaScript files from the database.
The solution is to use MQL cursors
I’ve created an example using MQL cursors in MJT which demonstrates a number of concepts:
- Using MQL cursors
- Calling MJT templates with arguments
- Incremental queries (the page updates without reloading)