Freebase: format search result to display all properties of an object of unknown type (s)

I am trying to write an MQL query to format the search result in freebase (the "output" parameter in the search API). I really want to find the (simple) values ​​of all the properties of a given search result (without knowing anything about the result types a priori). By "simple" is meant only the default properties if the values ​​are complex objects.

For example, if I search for "Yo La Tengo" and this leads me to the result for "/ en / yo_la_tengo", I want to be able to get group members (I just need names, not tools or start dates), albums (again , only names), films contributed (again, only names), etc.

Is there an easy way to do this with an output search query , given that I don't know anything about types ? I guess there is some kind of reflection magic that I can use, and I tried to spoof "/ type / reflection", but I'm not going anywhere. I am new to MQL (although I have extensive SQL experience), so this is a bit complicated. Any ideas?

Change Therefore, to clarify, I think that the problem that I see is explained by such types of mediators as "performance" (the actor in the film) or "marriage". For example, with the query Yo La Tengo , I can see the most (everything?) Information that interests me, but a similar query about [The Muppet Movie] (freebase.com/api/service/search?limit=1&mql_output=%5B%7B % 22% 2Ftype% 2Freflect% 2Fany_reverse% 22% 3A% 5B% 7B% 7D% 5D% 2C% 22% 2Ftype% 2Freflect% 2Fany_master% 22% 3A% 5B% 7B% 7D% 5D% 2C% 22% 2Ftype% 2Freflect % 2Fany_value% 22% 3A% 5B% 7B% 7D% 5D% 7D% 5D & query = Value% 20Muppet% 20Movie - sorry, SO thinks I'm a spammer, so I can't make this a link), I don’t see the link at all Frank Oz (probably because his performance is mentioned instead). Is there a general way for me to “follow” the types of intermediaries in order to get all their properties? For example, is there one MQL output that would allow me to get an actor in performance (when it is related to the search result of the movie) and gives the spouse married (when it is connected to the person)

+4
source share
2 answers

Fulfilling a query not only for each property, but then following these properties, another layer in the depth of the graph for all search results will be an incredibly expensive operation. What is the precedent for this? Do you really have a user interface where the user can see and effectively absorb all this information? To answer the question directly, it is not possible to automatically unzip the types of mediators using mql_output in the search API.

I would suggest combining a basic set of information in a search query with a deeper set of information on a topic that a user has shown interest (for example, by hanging). This UI experience will be similar to the Freebase Suggest experience.

Over the years since the question arose, some additional useful things have been added, such as a “noticeable” pseudo-property that allows you to see what the topic notes.

Of course, everyone also needs to switch to the new API, so the requests will be: https://www.googleapis.com/freebase/v1/search?query=%22the%20muppet%20movie%22&limit=1&indent=true

https://www.googleapis.com/freebase/v1/topic/en/the_muppet_movie

+2
source

AFAIK there is no way to do this in direct MQL, but you can:

  • Get all properties of an object or object type, then
  • Programmatically build another MQL query to get the objects that you want to learn more about.

Check out this example :

[{ "type|=": [ "/film/actor", "/tv/tv_actor", "/celebrities/celebrity" ], "*": [{}] }]​ 

It captures all the properties of all objects that are of type actor , tv_actor or celebrity . When you run it, you will see all the possible “subsequent” points that you can explore.

This is not exactly what you want, but it should come closer to you.

+1
source

All Articles