title: How to recursively expand blank nodes in SPARQL construct query?
body: <p>There is probably an easy to answer to this, but I can't even figure out how to formulate the Google query to find it.</p>
  
  <p>I'm writing SPARQL construct queries against a dataset that includes blank nodes. So if I do a query like</p>
  
  <p><code>CONSTRUCT {?x ?y ?z .}
  WHERE {?x ?y ?z .}</code></p>
  
  <p>Then one of my results might be:</p>
  
  <p><code>nm:John nm:owns _:Node</code></p>
  
  <p>Which is a problem if all of the </p>
  
  <p><code>_:Node nm:has nm:Hats</code></p>
  
  <p>triples don't also get into the query result somehow (because some parsers I'm using like rdflib for Python really don't like dangling bnodes).</p>
  
  <p>Is there a way to write my original CONSTRUCT query to recursively add all triples attached to any bnode results such that no bnodes are left dangling in my new graph? </p>