[Developers] OR operator in query
Arthur van Hoff
AVH at zing.net
Fri Jun 20 03:19:26 UTC 2008
What you need to use is reflection. Try something like this:
{
"id": "/en/the_departed",
"/type/reflect/any_master": [{
"link": {"*": null}
}],
"/type/reflect/any_reverse": [{
"link": {"*": null}
}],
"/type/reflect/any_value": [{
"link": {"*": null}
}]
}
> -----Original Message-----
> From: developers-bounces at freebase.com [mailto:developers-
> bounces at freebase.com] On Behalf Of Christian Hirsch
> Sent: Thursday, June 19, 2008 8:04 PM
> To: Freebase developers
> Subject: [Developers] OR operator in query
>
> Hi,
>
> I'm starting with a topic id (e.g. /en/the_departed) and like to
> query
> all of its properties (e.g. all actors starring in the movie, awards
> won, etc.).
>
> At the moment I'm using separate queries for each type which is
> associated with the topic to get all these information, e.g.:
>
> {
> "*" : [],
> "id" : "/en/the_departed",
> "type" : "/film/film"
> }
>
> ------------
>
> {
> "*" : [],
> "id" : "/en/the_departed",
> "type" : "/award/award_winning_work"
> }
>
> ------------
>
> etc.
>
> This works well but is not very efficient.
> First of all a query is needed to get the types of the topic:
> {
> "id" : "/en/the_departed",
> "type" : []
> }
>
> ...and then a query is needed for each type as described above.
>
>
> What would be the best way to reduce the number of queries?
>
> I just tried to use an OR operator, e.g.:
>
> {
> "*" : [],
> "id" : "/en/the_departed",
> "type" : [],
> "type|=" : [
> "/film/film",
> "/award/award_winning_work"
> ]
> }
>
> but it doesn't give the desired results. Is there some syntax error,
> or does the OR not work in this case?
>
> Cheers,
> Christian
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
More information about the Developers
mailing list