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

Open
deiu opened this Issue Jul 26, 2012 · 7 comments

Comments

Projects
None yet
5 participants

deiu commented Jul 26, 2012

Hey,

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.

Owner

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).

Owner

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:
http://www.w3.org/TR/sparql11-http-rdf-update/

// 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');
Contributor

bdecarne commented Jan 22, 2013

Hi,

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.

Thx,
Blaise

Collaborator

indeyets commented Jan 22, 2013

@bdecarne which endpoint do you use with virtuoso? http://127.0.0.1:8890//sparql-graph-crud works for me

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

Owner

njh commented Aug 12, 2013

Hello,

I have added an update() method to EasyRdf_Sparql_Client:
https://github.com/njh/easyrdf/blob/master/lib/EasyRdf/Sparql/Client.php#L143

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...

nick.

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