Hi,<br /> I am trying to use rasqal to use SPARQL1.1 queries to insert a triple into the data graph. However when I retrieve the triple using SELECT, I do not get the inserted triple. Could someone send me a sample code to insert triples into the data graph.<br /><br />The part of the code written by me to insert the triple is as follows<br /><br />
<p> rasqal_query *tquery;</p>
<p> query_string="PREFIX cim:<<a href="http://iec.ch/TC57/2008/CIM-schema-cim14">http://iec.ch/TC57/2008/CIM-schema-cim14</a>#> \<br /> PREFIX rdf:<<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns">http://www.w3.org/1999/02/22-rdf-syntax-ns</a>#> \<br /> PREFIX base:<"+ std::string((const char *)raptor_uri_as_string(uri))+"#> \<br /> INSERT DATA {base:" +name +" rdf:type cim:GeographicalRegion .}";</p>
<p> <br /> tquery=rasqal_new_query(rql_world,"sparql11",NULL);<br /> int res= rasqal_query_add_data_graph(tquery,data_graph);<br /> rasqal_query_prepare(tquery,(const unsigned char*)query_string.c_str(),NULL);<br /> results=rasqal_query_execute(tquery);<br /> rasqal_free_query(tquery); </p>
<br /><br />Is it the right way to insert the triple?<br />
<div>-- <br />
<pre><span style="color: #0000ff;"><em>Thanking You,</em></span><br /><span style="color: #0000ff;"><strong><em>Shashank Bandari<br /><br /><br /><br /><br /></em></strong></span><br /><a href="mailto:shashank.bandari@ieee.org">shashank.bandari@ieee.org</a><br /></pre>
</div>