Sunday, January 13, 2008
by Nik Kalyani
Sunday, January 13, 2008 11:43:13 PM (Pacific Standard Time, UTC-08:00)
When you go to the Freebase Data page, there is a list of categories. Drilling down into these, you can see the top-level domains and their types. Looking at all the types in a domain is easy enough, but I could not figure out a way to get the categories and top-level domains. The documentation was no help.

I finally found the answer by looking at the mjt source code at this site:
http://mjtemplate.org/examples/schemas/index.html

Here's the query to retrieve the categories:
{
  "query" : [
    {
      "name" : null,
      "type" : "/freebase/domain_category"
    }
  ]
}


And here's the query to retrieve the top-level domains for a category:
(Caution: This query will take a long time to run as it returns the top-level domains and their properties
{
  "query" : [
    {
      "domains" : [
        {
          "id" : null,
          "name" : null,
          "type" : "/type/domain",
          "types" : [
            {
              "/freebase/type_profile/instance_count" : null,
              "/type/reflect/any_reverse" : {
                "limit" : 1,
                "link" : {
                  "master_property" : "/freebase/type_hints/hinted_type"
                },
                "mediator" : null,
                "optional" : true,
                "type" : "/freebase/type_hints"
              },
              "id" : null,
              "name" : null,
              "optional" : true,
              "properties" : [],
              "sort" : "name"
            }
          ]
        }
      ],
      "name" : null,
      "type" : "/freebase/domain_category"
    }
  ]
}
I wish some of the types such as "/freebase/domain_category" or "/freebase/type_hints" were documented somewhere.

RSS feed
Search and Links
Bling

View Nik Kalyani's profile on LinkedIn

TechBubble
www.flickr.com
This is a Flickr badge showing public photos from techbubble. Make your own badge here.
Statistics
Total Posts: 216
This Year: 19
This Month: 0
This Week: 0
Comments: 226
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Nik Kalyani
Sign In
All Content © 2008, Nik Kalyani