We need to investigate & design a public query API. Goals for this API are:
- Easy to build queries with a variety of clients (probably JSON) without dealing with low-level issues like escaping.
- Only expose queries with reasonable resource consumption (CPU and IO, < 1 minute run time?). If this cannot be statically guaranteed, have a way to reliably kill long-running queries, ideally before they consume a lot of resources.
- Minimal per-request overheads in the API layer (low single-digit ms)
The Freebase API with MQL is already in use and seems to be useful to existing consumers. Some links:
- MQL reference guide
- MQL cookbook
- interactive query editor with sample queries
- MQL types
- Cayley MQL front-end implementation
With the announced integration of Freebase data into wikidata maintaining the same API sounds attractive, and could potentially let us reuse existing tools like the query editor.
Another option could be to use an existing higher-level query language like SPARQL, which also has a JSON serialization.