[Developers] OR operator in query
Christian Hirsch
hirsch.christian at gmail.com
Mon Jun 23 05:36:28 UTC 2008
...sorry, accidentally sent too early ;-)
ok, so what I'm doing is to query all "basic" information for any
topic. By basic I mean roughly all the content (properties) which also
shows an a topic page in Freebase.
More precisely, I'm starting with a topic ID (e.g. /en/the_departed)
and am interested in all related topics (name plus ID) and the type of
relationship (name plus ID), in the case of a movie this would be for
example:
- Country of origin (/film/film/country): United States (/en/united_states)
- Genres (/film/film/genre): Thriller (/en/thriller)
- Performances (...):
- list of actor / character ...
I am doing all this successfully at the moment but would like to
improve the performance (I'm using several queries which I guess can
be combined)
The way you suggested it works great, except that I don't get the
CVT's. Any suggestions on how to include them somehow in there?
This is the best "improved query" for that purpose so far (no CVT's, though)
{
"/type/reflect/any_master" : [
{
"link" : {
"master_property" : {
"id" : null,
"name" : null
},
"operation" : "insert",
"target" : {
"id" : null,
"name" : null
}
}
}
],
"id" : "/en/the_departed"
}
Cheers,
Christian
On Mon, Jun 23, 2008 at 5:30 PM, Christian Hirsch
<hirsch.christian at gmail.com> wrote:
> ok, so what I'm doing is to query all "basic" information for any
> topic. By basic I mean roughly all the content (properties) which also
> shows an a topic page in Freebase.
> More precisely, I'm starting with a topic ID (e.g. /en/the_departed)
> and am interested in all related topics (name plus ID) and the type of
> relationship (name plus ID), in the case of a movie this would be for
> example:
>
> - Country of origin (/film/film/country): United States (/en/united_states)
> - Genres (/film/film/genre): Thriller (/en/thriller)
> - Performances (...):
>
>
>
>
> On Mon, Jun 23, 2008 at 4:50 PM, John Giannandrea <jg at metaweb.com> wrote:
>>
>> Christian Hirsch wrote:
>>> Thanks. Can this query also be modified so that it also returns the
>>> CVT's? In the case of a movie it doesn't for example return the
>>> starring actors or the awards won.
>>
>> You can make the any_master, any_reverse queries two plys out but if
>> you want the CVTs you need to know more about what the schema is to be
>> able to use it in the reply. Perhaps it would be useful to know what
>> you are trying to do overall. If you want all the data about a film
>> for example why not write the query in terms of film properties?
>> Reflection is mostly useful when you have no idea what you are
>> inspecting.
>>
>>> Also, could the query be modified so that it additionally returns the
>>> actual label of the properties?
>>
>> Yes, add master_property:{id:null, name:null}
>>
>> -jg
>>
>> _______________________________________________
>> Developers mailing list
>> Developers at freebase.com
>> http://lists.freebase.com/mailman/listinfo/developers
>>
>
More information about the Developers
mailing list