<docbook><section><title>VirtTipsAndTricksSPARQL11Create</title><title>Virtuoso SPARQL 1.1.
 CREATE Usage Examples</title>Virtuoso SPARQL 1.1.
 CREATE Usage Examples
<bridgehead class="http://www.w3.org/1999/xhtml:h2">What?</bridgehead>
 This guide contains Virtuoso SPARQL 1.1.
 CREATE Usage examples queries which you can run against any SPARQL endpoint that supports SPARQL 1.1 and the ability to allow a verified user perform INSERT operations.<bridgehead class="http://www.w3.org/1999/xhtml:h2">Why?</bridgehead>
 Use to add a named graph in the RDF Quad Store.<bridgehead class="http://www.w3.org/1999/xhtml:h2">How?</bridgehead>
<para>Here are some examples showcasing Virtuoso&#39;s support for this functionality:</para>
<para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">CREATE Example</bridgehead>
<para>This example creates named graph identified by the IRI &lt;urn:sparql:tests:create:data&gt; :</para>
<orderedlist spacing="compact"><listitem>Assume the following Raw Data Representation in Turtle: <programlisting>&lt;#book1&gt; &lt;#price&gt; 41 .
&lt;#book2&gt; &lt;#price&gt; 42 .
&lt;#book3&gt; &lt;#price&gt; 43 .
&lt;#book4&gt; &lt;#price&gt; 44 .
</programlisting></listitem>
<listitem>Create a named graph identified by the IRI &lt;urn:sparql:tests:create:data&gt; : <programlisting>CREATE GRAPH &lt;urn:sparql:tests:create:data&gt;;
</programlisting></listitem>
<listitem>Load the sample data: <programlisting>INSERT DATA
  { 
    GRAPH &lt;urn:sparql:tests:create:data&gt; 
      { 
        &lt;#book1&gt; &lt;#price&gt; 41 . 
        &lt;#book2&gt; &lt;#price&gt; 42 . 
        &lt;#book3&gt; &lt;#price&gt; 43 . 
        &lt;#book4&gt; &lt;#price&gt; 44 .  
      } 
  }
</programlisting></listitem>
<listitem>Query &lt;urn:sparql:tests:create:data&gt; graph data: <programlisting>SELECT * 
FROM &lt;urn:sparql:tests:create:data&gt; 
WHERE 
  {
    ?s ?p ?o
  }
</programlisting><itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://bit.ly/Z3BZ7m">View the SPARQL Query Definition via SPARQL Protocol URL</ulink>; </listitem>
<listitem><ulink url="http://bit.ly/178Wery">View the SPARQL Query Results via SPARQL Protocol URL</ulink></listitem>
</itemizedlist></listitem>
</orderedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://www.w3.org/TR/2012/PR-sparql11-update-20121108/#create">SPARQL 1.1 CREATE</ulink> </listitem>
<listitem><ulink url="VirtTipsAndTricksGuideRenameGraph">Rename RDF Graph Example</ulink> </listitem>
<listitem><ulink url="http://www.w3.org/TR/rdf-sparql-protocol/">SPARQL Protocol (HTTP based Query Service)</ulink> </listitem>
<listitem><ulink url="VirtTipsAndTricksGuide">Virtuoso Tips and Tricks Collection</ulink> </listitem>
<listitem><ulink url="VirtTipsAndTricksSPARQL11FeaturesExamplesCollection">Virtuoso SPARQL 1.1 Usage Examples Collection</ulink> </listitem>
<listitem><ulink url="http://virtuoso.openlinksw.com/tutorials/sparql/SPARQL_Tutorials_Part_9/SPARQL_Tutorials_Part_9.html">Virtuoso SPARQL 1.1 Syntax Tutorial</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html">Virtuoso Documentation</ulink></listitem>
</itemizedlist></section></docbook>