I'm trying out GraphDB to see if it would fit my usecase or not and I have created a simple ontology in the form of (block) - has_content - (string). I have populated the database with a few triples matching this schema and created a React frontend that displays this data by requesting a response from the SPARQL endpoint. This works well so far.
I have then added the possibility to change the content with simple text fields to update the text content by calling the REST SPARQL template endpoint with a simple delete/insert query:
PREFIX ns: <http://www.example.com#>
DELETE {
?block ns:has_content ?oldContent .
} INSERT {
?block ns:has_content ?value .
} WHERE {
?block ns:has_content ?oldContent .
}
This works in principle but I have observed the following:
When I directly and quickly write in a textfield the text doesn't get updated but new has_content triples are added after each keypress as if the system would not be waiting for each request to finish deleting/inserting triples but trying to delete/add these triples in parallell. If I debounce the requests so they are not fired so quickly, everything works as expected, the has_content triple is deleted before the new data is inserted.
This leads me to my question: I have gotten the impression from the GraphDB documentation that all updates are transactional and that they would be transacted sequential. Is this wrong or do I have to configure GraphDB somehow? Or is my query wrong, I'm new to SPARQL.