"http://www.freebase.com/api/service/mqlread?query={"query":[{"id":"/topic..."
The mqlread service is used to perform read-only queries on Freebase data.
| Name | mqlread | |
| Description | Runs a MQL read query and returns the results to client. | |
| Accessible Via | /api/service/mqlread | |
| HTTP GET | Yes | |
| HTTP POST | Yes | |
| Special Headers | None | |
| Login Required | No | |
| Required Arguments | One of: query : a single MQL query | |
| Optional Arguments | cursor : graph cursor that may be returned as a result of a query that asked for one. | |
| Extra Arguments Ignored | Yes | |
| Response Format | application/json | |
| Notes | MQL queries must be wrapped in an envelope consisting of two JSON objects before being sent to mqlRead. This is explained in detail in section 4.2.4 of the The Complete Metaweb Application Development Reference Guide (API and MQL). The envelope parameters are: cursor: enables the retrieval of a large result set in batches escape (value: false): disables escaping of <, >, & characters to <, >, and & lang: specify the language in which you want the results returned as_of_time (value: timestamp): specify that the results should reflect the state of the database as of the time specified by the timestamp (useful for making historical queries) uniqueness_failure (values: hard or soft): affects whether {...} produces an error or a single value if there are multiple results for the query. Full information on mqlRead can be found in Chapter 4 of The Complete Metaweb Application Development Reference Guide (API and MQL). For additional information on using the callback parameter to generate a JSONP response, or using onsucceed and onfail to redirect to a URI template, see Common API Query Parameters. |
Examples:
http://www.freebase.com/api/service/mqlread?query={"query":[{"id":"/topic/en/edinburgh","key":[{"namespace":"/wikipedia/en_id","value":null}]}]}
http://www.freebase.com/api/service/mqlread?queries={"q0":{"query":[{"id":"/topic/en/edinburgh","key":[{"namespace":"/wikipedia/en_id","value":null}]}]},"q1":{"query":[{"id":"/topic/en/hamster","key":[{"namespace":"/wikipedia/en_id","value":null}]}]}}