[Developers] Merge two queries

Sebastian Kurt kurt at inf.fu-berlin.de
Wed Dec 5 12:34:03 UTC 2007


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


More information about the Developers mailing list