[Developers] Merge two queries
Arthur van Hoff
AVH at zing.net
Wed Dec 5 16:49:34 UTC 2007
Is there an explanation of /type/reflect/any_reverse?
The best I can find is this:
http://www.freebase.com/view/guid/9202a8c04000641f80000000041ea213
-----Original Message-----
From: developers-bounces at freebase.com
[mailto:developers-bounces at freebase.com] On Behalf Of Sebastian Kurt
Sent: Wednesday, December 05, 2007 4:34 AM
To: For discussions about MQL,Freebase API and apps built on Freebase
Subject: Re: [Developers] Merge two queries
Thanks for your help, but it is not what i was looking for. Perhaps not
exactly defined by me. I will try again:
I query for ID's belonging to a <keyword>
{
"someids":{
"query":[{
"name":null,
"name~=":"<keyword>",
"type":[{
"id":null,
}]
}]
}
}
after that (extracting IDs with PHP), I query foreach ID what CATEGORY
it is in and whats its name:
{
"category":{
"query":[{
"/type/type/domain":{
"/type/reflect/any_reverse":[{
"name":null,
"type":"/freebase/domain_category"
}],
"name":null
},
"id":"myIdForKeyword",
"name":null
}]
}
}
Now the question is, if it is possible to merge both:
"Query for CATEGORIES (and name of given IDs) of a given <keyword>"
Examplequery for "id" == "/location/country",
{
"category" : {
"query" : [
{
"/type/type/domain" : {
"/type/reflect/any_reverse" : [
{
"name" : null,
"type" : "/freebase/domain_category"
}
],
"name" : null
},
"id" : "/location/country",
"name" : null
}
]
}
}
John Giannandrea schrieb:
>> Sebastian Kurt wrote:
>>> What should it do?
>>> "[1] answering ID an DOMAIN of <keyword>, ID is used in [2] (as
>>> myIdForKeyword) to ask for CATEGORY of it"
>>>
>
>
> it wasnt clear to me if you are trying to find a domain or a type.
> Here is an example of constraining both the domain name and the type
> name and getting the enclosing category. You can remove the
> constraints you dont want
> -jg
>
> {
> "query" : [
> {
> "domains" : {
> "name" : null,
> "name~=" : "film",
> "type" : "/type/domain",
> "types" : [
> {
> "name" : null,
> "name~=" : "director"
> }
> ]
> },
> "name" : null,
> "type" : "/freebase/domain_category"
> }
> ]
> }
>
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
--
mailto:kurt at inf.fu-berlin.de
0179 7923088
http://vIdentity.de
http://skurt.de
_______________________________________________
Developers mailing list
Developers at freebase.com
http://lists.freebase.com/mailman/listinfo/developers
More information about the Developers
mailing list