[Developers] Category list

Kurt Bollacker kurt at metaweb.com
Wed Apr 16 15:47:42 UTC 2008



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



More information about the Developers mailing list