Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[Feature] SPARQL INSERT using data from an EasyRdf Graph object. #66

deiu opened this Issue Jul 26, 2012 · 7 comments


None yet
5 participants

deiu commented Jul 26, 2012


I know how the title sounds, but I'm wondering if you've ever thought about the possibility of adding a SPARQL INSERT/UPDATE method to EasyRdf_Grapht. Actually (just thinking out loud)...I wonder if it's nothing more than just iterating through the triples and inserting them.


njh commented Jul 27, 2012

Yes, this is certainly a feature I want to add. Unfortunately my own triple store (RedStore) doesn't support SPARQL update yet. I should have a play with 4store.

deiu commented Jul 27, 2012

You got my full support. Let me know if I can help in any way (even if it's just tests).


njh commented Sep 15, 2012

Note that you can already insert data from an EasyRdf_Graph into a graph in a triplestore using the SPARQL 1.1 Graph Store HTTP Protocol:

// Use a local SPARQL 1.1 Graph Store (eg RedStore)
$gs = new EasyRdf_GraphStore('http://localhost:8080/data/');

// Add the current time in a graph
$graph1 = new EasyRdf_Graph();
$graph1->add('http://example.com/test', 'rdfs:label', 'Test');
$graph1->add('http://example.com/test', 'dc:date', time());
$gs->insert($graph1, 'time.rdf');

bdecarne commented Jan 22, 2013


Did anyone test the above code with Virtuoso or Sesame ? With Sesame i've got a "Bad Request" error from the server during the insert (while get works fine), with Virtuoso no error but no insert et no get.



indeyets commented Jan 22, 2013

@bdecarne which endpoint do you use with virtuoso? works for me

hi @indeyets @deiu @njh @bdecarne ,
ı tested insertion that endpoint :
but 've got "bad request" error from the server. How can ı solve that problem? (select query is perform well but insertion not)


njh commented Aug 12, 2013


I have added an update() method to EasyRdf_Sparql_Client:

Which you can use to execute any SPARQL 1.1 Update query on a store that supports it.

Would be interested in any feedback - in particular if you think that query() and update() should be throwing exceptions for failed querys, and what you think the return type should be for a successful update().

Next I will be adding insert() and delete() methods...


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment