Does Stardog support something like optimistic locking

see also


Optimistic locking is implemented by the application, not by Stardog, so it’s certainly possible. You can express it in SPARQL like so:

  :foo :hasProp ?p ; :hasVersion ?v
  :foo :hasProp "newProp" ; :hasVersion ?newVersion
  BIND(3 as ?v)
  BIND(4 as ?newVersion)
  :foo :hasProp ?p ; :hasVersion ?v.

If you execute this query on the data given in your question, it will change the hasProp and hasVersion values to “newProp” and 4 respectively. However, if you execute it again, it will not change anything because the where clause only matches when the current version is 3 (but it’s now 4).

Hope this helps.


That was what I was looking for, but I still have troubles formulating my own update queries.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.