[Developers] Category list

Zodiac Seven zodiac.seven at gmail.com
Thu Apr 17 15:51:58 UTC 2008


Thank you Kurt,

An off topic question:
The query returns a result like this

{
"status": "200 OK",
"code": "/api/status/ok",
"results": {
"code": "/api/status/ok",
"result": [
{
"type": "/freebase/domain_category",
"name": "Sports"
}
...

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.



On 4/16/08, Kurt Bollacker <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
> > http://lists.freebase.com/mailman/listinfo/developers
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20080417/e4c6894c/attachment-0001.htm 


More information about the Developers mailing list