Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top