Thank you Kurt,<br><br>An off topic question:<br>The query returns a result like this<br><br>{<br> "status": "200 OK", <br> "code": "/api/status/ok", <br> "results": {<br>
"code": "/api/status/ok", <br> "result": [<br> {<br> "type": "/freebase/domain_category", <br> "name": "Sports"<br> }<br>
...<br><br>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'.<br>
Any sample code would be helpful.<br><br><br><br><div><span class="gmail_quote">On 4/16/08, <b class="gmail_sendername">Kurt Bollacker</b> <<a href="mailto:kurt@metaweb.com">kurt@metaweb.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
<br><br> On Wed, Apr 16, 2008 at 08:44:36PM +0530, Zodiac Seven wrote:<br> > I'm writing a small app on FreeBase.<br> > I'm trying to build a category tree which shows the main categories (sports,<br> > arts & crafts, etc.) and lets the user drill down to additional sub<br>
> categories.<br> > Is there something like this already built which I can use?<br><br><br>Something close to what you want can be found as a MJT app at:<br><br> <a href="http://www.mjtemplate.org/examples/schemas/">http://www.mjtemplate.org/examples/schemas/</a><br>
<br> More about MJT can be found at:<br><br> <a href="http://www.mjtemplate.org/">http://www.mjtemplate.org/</a><br><br><br> > I notice that I can get a list of the categories for "Sports" like this:<br> ><br>
> { "query" : [ { "domains" : [ { "id" : null, "name" : null, "type" :<br> > "/type/domain" } ], "name" : "Sports", "type" : "/freebase/domain_category"<br>
> } ]}<br> ><br> > but I can't figure out how to get a list of categories under<br> > "Sports/Basketball"<br><br><br>The hierarchy you are looking at has this order:<br><br> Domain Category<br> Domain<br>
Type<br> Property<br><br> Your query above retrieves all of the domains in a domain category.<br> To get the types (e.g. Basketball Team) in a domain (e.g. Basketball),<br> you can use a similar query:<br><br> {<br>
"query" : [<br> {<br> "name" : "Basketball",<br> "type" : "/type/domain",<br> "types" : [<br> {<br> "id" : null,<br>
"name" : null,<br> "type" : "/type/type"<br> }<br> ]<br> }<br> ]<br> }<br><br> Hope this helps... Kurt :-)<br><br>
<br><br> > Regards,<br> ><br> > Deepak.<br><br> > _______________________________________________<br> > Developers mailing list<br> > <a href="mailto:Developers@freebase.com">Developers@freebase.com</a><br>
> <a href="http://lists.freebase.com/mailman/listinfo/developers">http://lists.freebase.com/mailman/listinfo/developers</a><br><br> _______________________________________________<br> Developers mailing list<br> <a href="mailto:Developers@freebase.com">Developers@freebase.com</a><br>
<a href="http://lists.freebase.com/mailman/listinfo/developers">http://lists.freebase.com/mailman/listinfo/developers</a><br></blockquote></div><br>