ontodev / robot

ROBOT is an OBO Tool
http://robot.obolibrary.org
BSD 3-Clause "New" or "Revised" License
264 stars 74 forks source link

Question: ROBOT command for axiom addition and subtraction #1132

Open ShahimEssaid opened 1 year ago

ShahimEssaid commented 1 year ago

A brief review of the documentation gave me the impression that addition and subtraction functionality is at the entity level. In my case I need to do axiom level subtraction and addition. Is this possible with ROBOT?

My use case in more detail is the following. I need a CLI tool that will load an OWL ontology (and resolve imports) and then do subtraction and addition for axioms contained in configurable OWL documents. Optimally, the tool would then write the source OWL files (the ontology) in place but an output to a merged OWL file (after the subtraction and addition) is still useful.

The subtraction is the main part since I can implement the additions through imports.

cmungall commented 1 year ago

You could do the subtraction using:

https://robot.obolibrary.org/unmerge

The name is unintuitive (I think I am responsible). But it's basically axiom subtraction. I am not sure if it has been extensively tested for this use case though. There may be edge cases. E.g. if your serialization is RDF based then there may be cases where you need to add declarations such as ObjectProperty declarations in order to get the right interpretations, but it's not your intent to subtract these. My intuition is that if you stick with OWL direct serializations it should work.

For axiom addition you could just use the plain merge command