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.

Thursday, January 17, 2008 12:19:08 PM (Pacific Standard Time, UTC-08:00)
Hi Nik, I agree that the Freebase documentation is out of date. Hopefully some work will be done on this soon. In the meantime, the developer email list is a great place to get help on undocumented features.

regards, -Will
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, i, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
RSS feed
Search and Links
Bling

View Nik Kalyani's profile on LinkedIn

Contact me: nik*kalyani.com (replace "*")

TechBubble
www.flickr.com
This is a Flickr badge showing public photos from techbubble. Make your own badge here.
Statistics
Total Posts: 213
This Year: 31
This Month: 8
This Week: 0
Comments: 235
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