<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
William Pietri wrote:
<blockquote cite="mid4601ACC6.9080108@scissor.com" type="cite">
  <pre wrap="">John Giannandrea wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">yes, MQL supports cursors.
<a class="moz-txt-link-freetext" href="http://www.freebase.com/view/documentation/ch04.html#cursors">http://www.freebase.com/view/documentation/ch04.html#cursors</a>
  
    </pre>
  </blockquote>
  <pre wrap=""><!---->
And in case it helps, this is a little different than a normal cursor, 
where you grab it and keep pulling results from it.

  </pre>
</blockquote>
The reason for this is that our "cursors" are stateless. The binary
data you get in the cursor is actually an encoding of the "position" of
the next item in the given query. <br>
<br>
Minus a few bugs here and there, this means you can re-run the same
query with the same cursor over and over and keep getting the same
results back - I believe this will work even if the results change,
because the cursor should be recording the state of the graph when the
query was run. Think of it as kind of a 'bookmark' into the query
results.<br>
<br>
(At least for the next few months however, you shouldn't persist
cursors for longer than a few minutes - we have at least one pending
change to the cursor format that will render current cursors useless..)<br>
<br>
Alec<br>
<br>
<br>
<blockquote cite="mid4601ACC6.9080108@scissor.com" type="cite">
  <pre wrap="">When you get your first set of MQL results, you get a pointer to the 
next set. In that next set, you will get a pointer to the following set. 
In the following set, you get yet another pointer. Just keep getting the 
pointer out of the new set to get to the next set and you'll be fine.

Oh, and also unlike a normal cursor, it doesn't appear that you have to 
close or free up the cursor when you're done.

William


_______________________________________________
Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Developers@freebase.com">Developers@freebase.com</a>
<a class="moz-txt-link-freetext" href="http://lists.freebase.com/mailman/listinfo/developers">http://lists.freebase.com/mailman/listinfo/developers</a>
  </pre>
</blockquote>
<br>
</body>
</html>