[redland-dev] Rasqal query to insert elements
Shashank Bandari
mail at shashank-bandari.in
Thu Jan 27 10:41:28 CET 2011
Hi,
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.
The part of the code
written by me to insert the triple is as follows
rasqal_query *tquery;
query_string="PREFIX cim:
PREFIX rdf:
PREFIX base:
INSERT DATA
{base:" +name +" rdf:type cim:GeographicalRegion .}";
tquery=rasqal_new_query(rql_world,"sparql11",NULL);
int res=
rasqal_query_add_data_graph(tquery,data_graph);
rasqal_query_prepare(tquery,(const unsigned
char*)query_string.c_str(),NULL);
results=rasqal_query_execute(tquery);
rasqal_free_query(tquery);
Is
it the right way to insert the triple?
--
_Thanking You,_
Shashank
Bandari
shashank.bandari at ieee.org [3]
Links:
------
[1]
http://iec.ch/TC57/2008/CIM-schema-cim14
[2]
http://www.w3.org/1999/02/22-rdf-syntax-ns
[3]
mailto:shashank.bandari at ieee.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.librdf.org/pipermail/redland-dev/attachments/20110127/479f466a/attachment.htm
More information about the redland-dev
mailing list