In the tutorial available here, there is following statement added to the database: :cowriter owl:propertyChainAxiom (:writerOf :writer) .
This statement will translate to some triplets involving two blank nodes:
Now, how can I delete such (this) statement from the database? Using the "Remove data" widget does not affect the construct. I have tried to explicitly specify the triplets in DELETE statements, but I have trouble understanding when blank nodes can be directly addressed and when not.
Seems repetitive but it should work… Blanks bind to variables same way as others, but you can’t use them as constants (rigid designators) which is why DELETE DATA would not work. I’m sure there is a more elegant solution, or a better explanation (and sorry, I can’t try it out right now).
you are correct that the bnodes cause issues there. One can figure out a generic SPARQL query to correctly delete the RDF serialisation of such axioms (also rules, SHACL shapes, etc.) similarly to what Pierluigi describes. But it's a bit error-prone.
What usually works best in practice is maintaining your schema in a separate named graph so you can drop it altogether and then re-load the updated schema.
I am coming from the relational world, thus not being able to grab something by its identifier only makes me dizzy :).
I got the idea of having separated graphs for this, and Pierluigi's suggestion is also clear. I succeeded with it. While being error-prone doing it by hand, looks quite an automatic task. Practically, the graph I have visualized can be simply translated in such a selector. Stardog Studio could really be of help in this situation with a quite simple widget: adding the ability to manually select nodes and edges on the visualized graph (ctrl, shift, lasso, etc... or simply switching to a "select mode") and then being able to get the selector statement matching the selected subgraph with the push of a button. This might be helpful in other scenarios too, like saving the result of visual exploration for further use.
On the other hand, the "Remove data" widget is really misleading right now. There is absolutely no feedback on what was or wasn't deleted while getting confirmation.
Now I am familiarizing myself with the named graphs and I can't find the correct syntax for adding rules in named graph as you suggested. Actually, the rule is from the same tutorial:
RULE :CowriterRule
IF {
?s :writer ?w1.
?s :writer ?w2.
FILTER(?w1 != ?w2)
} THEN {
?w1 :cowriter ?w2
}
Could you give me a hint on how to change this statement to be enclosed in a named graph?