title: Recursive queries in SPARQL to browse collections of collections
body: <p>I am trying to create an RDF graph from a Mulgara RDF store, using a Sparql query to return results.  I'm just beginning to get comfortable with simple queries, effectively asking, "which objects are Members of a particular collection?"  </p>
  
  <p>My question is, and I would greatly appreciate any advice, whether I can take the results from this simple query and reroute them back through as the object of the query?</p>
  
  <p>For example, I have this sparql query:</p>
  
  <pre><code>SELECT ?x WHERE {?x  &lt;fedora-rels-ext:isMemberOfCollection&gt; &lt;info:fedora/collection:ramsey&gt;}
  </code></pre>
  
  <p>With these results:</p>
  
  <pre><code>"x"
  info:fedora/ramsey:ThelifeandadventuresofRobinsonCrusoe 
  info:fedora/ramsey:Jackanapes 
  info:fedora/ramsey:SundayJournalvol01no0219951126 
  info:fedora/ramsey:Ideologyandchange 
  info:fedora/ramsey:theshepherdofthepyrenees 
  info:fedora/ramsey:ScenesinAmerica
  ...
  </code></pre>
  
  <p>My goal, is to then take these unique identifiers and replace the object, <code>&lt;info:fedora/collection:ramsey&gt;</code>, from the original query and run the query again.</p>
  
  <p>I'm imagining a scenario where I would identify a root element in the initial query, have the results return all member objects, then return all <em>those</em> objects' member objects, <em>ad infinitum...</em></p>
  
  <p>Is this possible with Sparql queries?  Specifically, I believe I'm querying a Mulgara RDF database.  Any thoughts, even if its' not doable, greatly appreciated.</p>