How can I get information about the artists if it was changed after certain date? - freebase

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.

Related

Why does Freebase think that all wineries lack official websites?

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.

/film/film/runtime always returns null

Whenever I try to query for the length of a film I get lists of null. The query I use is directly from the "Build query" button on their site and looks like this:
[{
"id": null,
"name": null,
"type": "/film/film",
"/film/film/runtime": []
}]
Ufortunately all the responses I get look like this:
{
"name": "4D Man",
"type": "/film/film",
"/film/film/runtime": [
null
],
"id": "/en/4d_man"
}
I can hover over the links you can see on the query page and see the runtime (in this case 85 minutes) but as you can see all I get from the query is null. This may be a Freebase bug, but any help is appreciated. Thank you.
There's not a single runtime of a film, the same film can have different runtimes (original version, director's cut, etc...) Freebase use the film_cut type to contain the different runtimes of a movie
You can use this query to get the runtimes:
[{
"id": null,
"name": null,
"/film/film/runtime": [{
"runtime": null
}]
}]
Tune this query to your needs, you may need type_of_film_cut or film_release_region.

How to gather Freebase Aliases for type location/location?

I'd like to pull information (MID and US English name) about all locations in Freebase AND also their Korean names and any Korean aliases via an MQL query. This is as far as I've gotten:
[{
"id": null,
"name": null,
"mid": null,
"type": "/location/location",
"Korean:name": [{
"lang": "/lang/ko",
"value": null
}]
}]
I'm only getting the Korean name, but not any Korean aliases. I don't know how to write a query that outputs properties of 2 different types in the same query. Can you get data about both /location/location AND common/topic/alias for the same entity in the same MQL query/output? Is my approach just wrong here?
Any help appreciated.
When you need to combine properties from many different types you need to use the fully qualified property ID like this:
[{
"id": null,
"name": null,
"mid": null,
"type": "/location/location",
"Korean:name": [{
"lang": "/lang/ko",
"value": null
}],
"/common/topic/alias": [{
"lang": "/lang/ko",
"value": null,
"optional": true
}]
}]
Whenever you use shortened property IDs they are assumed to be in the same type as the type you specify in your query (or /type/object if no type is given). So for example, if you were to use "geolocation" in your query it would be interpreted as "/location/location/geolocation". The only excepts are "id", "name" and "type" which you can use without using the full IDs eg. "/type/object/name".
You'll also note that I made aliases "optional" so that it would return results for locations that don't have any aliases.

Freebase MQL Query

I have a couple of questions.
I have a MQL query that gets some movie information. The trimmed query looks like this.
[{
"id": "/en/a_beautiful_mind",
"name": null,
"type": "/film/film",
"/common/topic/article": [{
"id": null,
"optional": true,
"limit": 3
}]
}]
it works just fine, I can retrieve the ID but is there a way to also get the article text without having to run a separate text query?
Second is I am trying to figure out how to get the featured song performer. I can do this and get the songs name.
[{
"id": "/en/a_beautiful_mind",
"name": null,
"type": "/film/film",
"featured_song": [{
"name": null,
"optional": true
}],
}]
But cant seem to figure out how to get the songs performer. Is it possible?
thanks for the help
Scott
One simple way to get this type of information about a film is to use the Topic API like this:
https://www.googleapis.com/freebase/v1/topic/en/a_beautiful_mind?filter=suggest&filter=/film/film
This won't get the featured song artist though. At least not without an additional API call. To do that in MQL you just nest additional queries inside the featured song like this:
[{
"id": "/en/a_beautiful_mind",
"name": null,
"type": "/film/film",
"featured_song": [{
"name": null,
"/music/recording/artist": [{}],
"/film/film_featured_song/performed_by": [{}],
"optional": true
}]
}]
Note that I've added two separate properties one for the artist who originally recorded the song and one for the artist who performed it in the film. In this case, the second property is empty implying that the original recording was used. Since I'm mixing properties from different types I need to use the fully-qualified property names.
All Freebase types are documented in the graph so you can look up types like /music/recording and /film/film_featured_song to see how they are meant to be used.

List all Freebase Domains with MQL query or API call

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.

Resources