<docbook><section><title>VirtTipsAndTricksConvertPropertiesToString</title><title>How do I use SPARUL to change a selection of property values from URI References to Literals?</title>How do I use SPARUL to change a selection of property values from URI References to Literals?
 Assume a given graph where triples are comprised of property values that are mixed across URI References and Typed Literals as exemplified by the results of the query below:<programlisting>SELECT DISTINCT ?sa ?oa 
FROM &lt;http://ucb.com/nbeabase&gt;
WHERE 
  { 
    ?sa a &lt;http://ucb.com/nbeabase/resource/Batch&gt; .
    ?sa &lt;http://ucb.com/nbeabase/resource/chemAbsNo&gt; ?oa . FILTER regex(?oa, &#39;-&#39;,&#39;i&#39;)
  }
</programlisting><para> You can use the following SPARUL pattern to harmonize the property values across relevant triples in a specific graph, as shown below:</para>
<programlisting>SQL&gt; SPARQL 
INSERT INTO GRAPH &lt;http://ucb.com/nbeabase&gt; 
  { 
    ?sa &lt;http://ucb.com/nbeabase/resource/sampleId&gt; `str (?oa)` 
  }  
WHERE 
  { 
    ?sa &lt;http://ucb.com/nbeabase/resource/chemAbsNo&gt; ?oa .  FILTER regex(?oa, &#39;-&#39;,&#39;i&#39;)   
  }
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtTipsAndTricksGuide">Virtuoso Tips and Tricks Collection</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfandsparql.html">RDF Data Access and Data Management</ulink> </listitem>
</itemizedlist></section></docbook>