title: SPARQL functions in CONSTRUCT/WHERE
body: <p>I mostly use SPARQL SELECT while working on a query for debugging purposes but in the end I want to use the final result it in a CONSTRUCT way; as I want to work with a graph and not key/value query results.</p>
  
  <p>What I don't get yet (and can't seem to find with search engines/docs) is if I can use functions as well that way. As an example, I use a property path to concatenate titles I get into a "superstring", which I later use for building a Lucene index to increase plain text search quality:</p>
  
  <pre class="lang-sql prettyprint-override"><code>PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;    
  
  SELECT (group_concat(?title ; separator = " ") AS ?fancytitle) WHERE { 
    GRAPH ?graph {
      &lt;http://data.staatsarchiv-bs.ch/id/archivalresource/CH-000027-1/pa-633c-a-312-fasc-163&gt;  dc:relation+ ?relation .
      ?relation dc:title ?title .
    }
  }
  </code></pre>
  
  <p>Now I would like to have the same <code>?fancytitle</code>as a new triple like</p>
  
  <pre><code>&lt;http://data.staatsarchiv-bs.ch/id/archivalresource/CH-000027-1/pa-633c-a-312-fasc-163&gt; &lt;fancytitle&gt; ?fancytitle .
  </code></pre>
  
  <p>So I can store it directly in a new graph. Is this possible? I played with some queries but couldn't manage to get it accepted by the SPARQL processor. FYI I'm using Fuseki.</p>
  
  <p>You can try it out at my <a href="http://data.alod.ch/sparql/?outputFormat=table&amp;query=PREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX%20skos%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3E%0APREFIX%20rdf%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0APREFIX%20prov%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2Fns%2Fprov%23%3E%0APREFIX%20time%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2006%2Ftime%23%3E%0APREFIX%20alod%3A%20%3Chttp%3A%2F%2Fdata.alod.ch%2Falod%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0APREFIX%20locah%3A%20%3Chttp%3A%2F%2Fdata.archiveshub.ac.uk%2Fdef%2F%3E%0APREFIX%20owl%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0APREFIX%20level%3A%20%3Chttp%3A%2F%2Flocalhost%3A3030%2Falod%2Flevel%3E%0APREFIX%20bs%3A%20%3Chttp%3A%2F%2Flocalhost%3A3030%2Falod%2Fbs%3E%0APREFIX%20bar%3A%20%3Chttp%3A%2F%2Flocalhost%3A3030%2Falod%2Fbar%3E%0APREFIX%20ge%3A%20%3Chttp%3A%2F%2Flocalhost%3A3030%2Falod%2Fge%3E%0APREFIX%20ne%3A%20%3Chttp%3A%2F%2Flocalhost%3A3030%2Falod%2Fne%3E%0APREFIX%20dct%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20loc%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2007%2Fuwa%2Fcontext%2Flocation.owl%23%3E%0A%0ASELECT%20(group_concat(%3Ftitle%20%3B%20separator%20%3D%20%22%20%22)%20AS%20%3Ffancytitle)%20WHERE%20%7B%20%0A%20%20GRAPH%20%3Fgraph%20%7B%0A%20%20%20%20%3Chttp%3A%2F%2Fdata.staatsarchiv-bs.ch%2Fid%2Farchivalresource%2FCH-000027-1%2Fpa-633c-a-312-fasc-163%3E%20%20dc%3Arelation%2B%20%3Frelation%20.%0A%20%20%20%20%3Frelation%20dc%3Atitle%20%3Ftitle%20.%0A%20%20%7D%0A%7D&amp;contentTypeConstruct=text%2Fturtle&amp;contentTypeSelect=application%2Fsparql-results%2Bjson&amp;endpoint=http%3A%2F%2Fdata.alod.ch%2Falod%2Fsparql&amp;requestMethod=POST&amp;tabTitle=Query%201" rel="noreferrer" title="SPARQL endpoint">SPARQL Endpoint</a></p>