<div>This thread might be helpful:</div>
<div><a href="http://markmail.org/message/uwfaeinosbmlorvw#query:+page:1+mid:lxet5u5eh64eljua+state:results">http://markmail.org/message/uwfaeinosbmlorvw#query:+page:1+mid:lxet5u5eh64eljua+state:results</a></div>
<div>Warren suggested a query to retrieve all properties for a given topic...<br></div>
<div>Cheers,</div>
<div>Christian<br></div>
<div>&nbsp;</div>
<div class="gmail_quote">On Mon, Jul 7, 2008 at 10:14 AM, Kendra Kuhl &lt;<a href="mailto:kendra.kuhl@juggle.com">kendra.kuhl@juggle.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div lang="EN-US" vlink="purple" link="blue">
<div>
<p>I need some advice on the best way to do something. What I have isn't working for me anymore.</p>
<p>&nbsp;</p>
<p>A while ago I had asked for a way to get all the properties associated to a topic and Alexander was nice enough to give me this query:</p>
<p>&nbsp;</p>
<p>{</p>
<p>&nbsp; &quot;query&quot; : [</p>
<p>&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;master_property&quot; : null,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;source&quot; : {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;id&quot; : &quot;topicId&quot;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;target&quot; : {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;id&quot; : null</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;target_value&quot; : null,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;type&quot; : &quot;/type/link&quot;</p>
<p>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp; ]</p>
<p>}</p>
<p>&nbsp;</p>
<p>So, I modified it a bit to look like this:</p>
<p>&nbsp;</p>
<p>{</p>
<p>&nbsp; &quot;query&quot; : [</p>
<p>&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;master_property&quot; : null,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;source&quot; : {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;id&quot; : null,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; "guid" : null,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; "name" : "Something"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;target_value&quot; : null,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;type&quot; : &quot;/type/link&quot;</p>
<p>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp; ]</p>
<p>}</p>
<p>&nbsp;</p>
<p>That worked out quite nicely until I started messing around with locations (and I'm sure locations aren't unique in this regard). But, if you send that query to freebase with Kansas as the name, you wind up getting back 2700 properties. Most of them "/location/location/contains" but still, 2700. It takes forever if it doesn't time out on me. &nbsp;(Even if I send in the exact guid, I still wind up with 2400 properties – 2300 of which are the /location/location/contains.). </p>

<p>&nbsp;</p>
<p>What I do with those properties is loop through them, filter out anything that starts with /guid, /type, /user as well as any duplicates and create another query to get the values for those properties. </p>
<p>&nbsp;</p>
<p>So, my question is this: given what I'm trying to accomplish, is there an easier way to go about it? Is there a way to get the properties for the topic, without duplicates, without /type, /guid, /user so I can then query to get the information I really want about the topic? I don't really want to hard code all the properties I want to go after for each and every type. I know I could use cursors to "page" through the data, but that would still take forever and I'm trying to make it as fast as possible.</p>

<p>&nbsp;</p>
<p>Thanks,</p>
<p>&nbsp;</p><font color="#888888">
<p>Kendra</p></font></div></div><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" target="_blank">http://lists.freebase.com/mailman/listinfo/developers</a><br>
<br></blockquote></div><br>