I have a problem with a very simple SPARQL Update query. It does DELETE but it doesn't INSERT. If the insert failed, I understood it should give an exception and rollback the deletion, but none of these happen. Everything seems normal except from the fact that the data are deleted and not inserted.If I modify the query string ?name for \"harcoded\" , it works fine. So it seems something related to the parametrisation of the INSERT clause.The Java code is:UpdateQuery aQuery = aCon.update(QUERY);aQuery.parameter(ID, Values.iri(id));aQuery.parameter(NAME,"New name");aQuery.execute();The query is:DELETE { ?id ex:name ?oldname .}INSERT { ?id ex:name ?name .}WHERE { OPTIONAL { ?id ex:name ?oldname }}The replacement seems correct:# Overrides by the API:# PARAMETERS ( ?name ?id ) {# "New name"# }
Distinct [cardinality=1]Projection(?id, ?_const_ced134bd_uri, ?oldname) [cardinality=1]DELETEProjection(?id AS ?subject, ?_const_ced134bd_uri AS ?predicate, ?oldname AS ?object) [cardinality=?]Bind((<http://www.example.com/d#name> AS ?_const_ced134bd_uri)) [cardinality=?]INSERTProjection(?id AS ?subject, ?_const_ced134bd_uri AS ?predicate, ?name AS ?object) [cardinality=?]Bind((<http://www.example.com/d#name> AS ?_const_ced134bd_uri)) [cardinality=?]WHERELoopJoinOuter[_] [cardinality=0]Singleton [cardinality=1]Bind((<http://www.example.com/d#doc1> AS ?id)) [cardinality=0]Scan[POS](<http://www.example.com/d#doc1>, ex:name, ?oldname){all} [cardinality=0]
--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Stardog" group.
To unsubscribe from this topic, visit https://groups.google.com/a/clarkparsia.com/d/topic/stardog/8nn5ha8ESDU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stardog+u...@clarkparsia.com.
Thanks Mike, the issue has been driving me crazy for days.Mmm.. is there any technical reason or that?
So is there any recommendation to avoid injections or should I simply concatenate the strings?
Yes, I know it is a very bad practice and it will make me redesign the clean method I created in my Java program to execute my queries, but how am I suppose to avoid injection in Stardog?
Is "insert parametrization" a new feature that might be contemplated in future releases?