I want to insert multiple objects into a triplestore like Jena fuseki or virtuoso.
In my case, the subject equal to a primary key. It is similar to a relational database. How can I make sure that the subject is only present once or is already in use? Can an ASK be combined with an insert in Sparql? Or can a key be generated?
As long as you use an instance of the backend you can make sure that the subject only exists once, but with more instance the query and insert must occur simultaneously to save the transaction.
An update can be of the form INSERT .. WHERE
and the WHERE
part can include a test of whether to update or not.
The SPARQL protocol for update requires actions to be atomic.