[Developers] Category list

David Flanagan david at davidflanagan.com
Thu Apr 17 16:31:46 UTC 2008


Zodiac Seven wrote:

> 
> I only need the names and I could parse those out of the string but is 
> there a cleaner way to do it like using javascript's eval or some sort 
> of freebase support function? I think if I could get a array of objects 
> I could iterate through them copying 'object[i].name'.
> Any sample code would be helpful.
> 

Freebase queries and response are in JSON. You should be using a JSON 
library to serialize queries and parse responses.

Also, it sounds as if you have not yet read the documentation which you 
can find here:

http://www.freebase.com/view/freebase/api

	David Flanagan

> 
> On 4/16/08, *Kurt Bollacker* <kurt at metaweb.com 
> <mailto:kurt at metaweb.com>> wrote:
> 
> 
> 
>     On Wed, Apr 16, 2008 at 08:44:36PM +0530, Zodiac Seven wrote:
>      > I'm writing a small app on FreeBase.
>      > I'm trying to build a category tree which shows the main
>     categories (sports,
>      > arts & crafts, etc.) and lets the user drill down to additional sub
>      > categories.
>      > Is there something like this already built which I can use?
> 
> 
>     Something close to what you want can be found as a MJT app at:
> 
>     http://www.mjtemplate.org/examples/schemas/
> 
>     More about MJT can be found at:
> 
>     http://www.mjtemplate.org/
> 
> 
>      > I notice that I can get a list of the categories for "Sports"
>     like this:
>      >
>      > { "query" : [ { "domains" : [ { "id" : null, "name" : null, "type" :
>      > "/type/domain" } ], "name" : "Sports", "type" :
>     "/freebase/domain_category"
>      > } ]}
>      >
>      > but I can't figure out how to get a list of categories under
>      > "Sports/Basketball"
> 
> 
>     The hierarchy you are looking at has this order:
> 
>     Domain Category
>       Domain
>         Type
>           Property
> 
>     Your query above retrieves all of the domains in a domain category.
>     To get the types (e.g. Basketball Team) in a domain (e.g. Basketball),
>     you can use a similar query:
> 
>     {
>       "query" : [
>         {
>           "name" : "Basketball",
>           "type" : "/type/domain",
>           "types" : [
>             {
>               "id" : null,
>               "name" : null,
>               "type" : "/type/type"
>             }
>           ]
>         }
>       ]
>     }
> 
>     Hope this helps...                                              Kurt :-)
> 
> 
> 
>      > Regards,
>      >
>      > Deepak.
> 
>      > _______________________________________________
>      > Developers mailing list
>      > Developers at freebase.com <mailto:Developers at freebase.com>
>      > http://lists.freebase.com/mailman/listinfo/developers
> 
>     _______________________________________________
>     Developers mailing list
>     Developers at freebase.com <mailto:Developers at freebase.com>
>     http://lists.freebase.com/mailman/listinfo/developers
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers



More information about the Developers mailing list