I’m trying to query for wine producers and their websites on Freebase with this query:
[{
"/common/topic/official_website": [],
"id": null,
"name": null,
"type": "/wine/wine_producer"
}]
Here it is in the Freebase query editor:
http://www.freebase.com/query?lang=%2Flang%2Fen&q=%5B%7B%22%2Fcommon%2Ftopic%2Fofficial_website%22%3A%5B%5D%2C%22id%22%3Anull%2C%22name%22%3Anull%2C%22type%22%3A%22%2Fwine%2Fwine_producer%22%7D%5D
Why do none of the vineyards have official websites? That seems like a unlikely coincidence. Also, none of the other properties of included types have non-null values.
How do I tell Freebase to obtain the properties of included types in addition to the ones on the wine producer type itself?
False premise. 185 of them do have values for the official web site:
[{
"/common/topic/official_website": [{
"value": null
}],
"id": null,
"name": null,
"type": "/wine/wine_producer",
"return": "count"
}]
You need to forget about the notion of included types for anything related to MQL querying. MQL doesn't know and doesn't care.
Related
I can get the artists that were added after 2014-10
[{
"type": "/music/artist",
"id": null,
"name": null,
"timestamp": null,
"timestamp>=": "2014-10"
}]
But how can I choose those ones who were added before but information about them has been changed since 2014-10?
You can use the reflection capabilities to query the creation date of individual links. See the Links, Reflection, and History section of the MQL manual.
I am sending the following mql query to get a list of topics, their mids and "notable types", but in the results notable types are always empty.
[{
"name": "The beatles",
"/common/topic/notable_types": [], //also tried "null"
"mid": null,
"limit": 10
}]
But this is inconsistent with the online freebase. For example, the query returns
{
"mid": "/m/07c0j",
"/common/topic/notable_types": [],
"name": "The Beatles"
},
And by checking the webpage "http://www.freebase.com/m/07c0j" you can see it has a notable type of "music artist".
Any suggestions if I have used wrong query or anything to do with the freebase database?
Many thanks!
They should really return on error on this query. Notably types isn't available through the MQL API -- only the Topic API.
My code:
[{
"id": null,
"name": null,
"/common/topic/alias": [],
"/common/topic/notable_for": [],
"limit": 100,
"type": "/sports/sport"
}]
Link
"/common/topic/alias" is returned fine however notable_for is always empty. I also tried: null, [{}], {} and /common/notable_for which gives a schema error.
How can I return the notable_for value per instance in the /sports/sport example above?
The notable_for data is computed separately from other facts in Freebase and is not accessible from the MQL API. It is however available from the Search API, the Topic API and the RDF data dumps.
Search API:
https://www.googleapis.com/freebase/v1/search?filter=(all+type:/sports/sport)&output=(/common/topic/alias)
Topic API:
https://www.googleapis.com/freebase/v1/topic/m/071k0
I'm having a hard time trying to get data about a person from Freebase using his social link - by a MQL query.
How could this be done?
Something like:
https://www.googleapis.com/freebase/v1/mqlread?query={
"*":[{}],
"/common/topic/social_media_presence":[{
"value":"http://twitter.com/JustinBieber"
}]
}
Those links are really stored as keys and the links are generated from templates with they key plugged in. You can see all the keys here: https://www.freebase.com/m/06w2sn5?keys=
A modified version of your query would be:
[{
"key": [{
"namespace": {
"id": "/authority/twitter"
},
"value": "JustinBieber"
}],
"*": [{}]
}]
You can do the same thing with other namespaces like /authority/facebook or /authority/musicbrainz as well as the various language wikipedias e.g. /wikipedia/en
I'm not sure how complete the coverage or currency of the social media info is though...
I would like to develop a Freebase java application that lets you browse Freebase.
I thought a good starting point would be to mimic the Freebase Schema Explorer and allow the user of my app to "drill down" through Domains, Types in a Domain, then Instances in a Type.
Can someone please assist in how you retrieve a List of domains?
Then a list in that domain? etc...
The user can then select a domain and i would like to preset a list of types within that domain and so on until they have found the entry or entries they are investigating.
MQL for domains:
[{
"id": null,
"name": null,
"type": "/type/domain",
"!/freebase/domain_category/domains": {
"id": "/category/commons"
}
}]
The "!/freebase/domain_category/domains" clause in there is to restrict things to just the Commons (official) domains - otherwise you get the domain which is automatically created for every user and probably isn't what you're after.
Types in a domain:
[{
"id": null,
"name": null,
"type": "/type/type",
"domain": "/cvg"
}]
Replace "/cvg" as appropriate.
Instances of a type:
[{
"id": null,
"name": null,
"type": "/cvg/computer_videogame"
}]
Replace "/cvg/computer_videogame" as appropriate.
This should at least get you started.