I want to achieve something like "optimistic locking" as mentioned in Optimistic vs. Pessimistic locking
I have the following data
:foo 
    :hasProp 'bar';
    :hasVersion '3'^^xsd:nonNegativeInteger
.
A sessions queries this data and keeps the information in memory. Then it wants to issue an update.
I only want an update to succeed, when the passed version is '3', which means that no update occurred since the session has read :foo. 
Is there a way to make an update query that fails when the passed version is != 3 but otherwise succeeds and updates :hasVersion to '4'^^xsd:nonNegativeInteger and for example :hasProp to baz? 
 
     
    