I'm trying to create a SPARQL statement that inserts some triples only if a certain pattern isn't yet in the graph.
PREFIX ssb: <ssb:ontology:>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT {
<ssb:message/some=> rdf:type ssb:Message;
ssb:seq 7;
ssb:raw "some text";
ssb:author 1.
} WHERE {
FILTER NOT EXISTS {
[] ssb:seq 7; ssb:author 1
}
}
Unfortunately, this seems to create the new triples even if a resource with that ssb:seq and ssb:author already exist, tried the with quadstorejs and with oxigraph.
Any suggestion on how to perform such a conditional insert? The goal is that I don't end up with several resources having the same sequence number and author.