Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlap command? It would be nice to compute overlap between two or more OWL files #1232

Open
hoganwr opened this issue Dec 3, 2024 · 6 comments

Comments

@hoganwr
Copy link

hoganwr commented Dec 3, 2024

It would be nice to compute overlap, where it would most easily be defined as shared IRIs. The basic overlap command would NOT be lexically driven (that gets complicated quickly).

The output could be configurable, but at a minimum, if two OWL files have the same IRI, output the IRI, the rdfs:label, and the type of object (owl:Class, owl:ObjectProperty, etc.). Of course that raises issues such as (1) what if the two OWL files have different labels (output them both vs. one vs. the other) and less likely but certainly worse (2) one OWL file says owl:Class and the other says owl:ObjectProperty (although you'd certainly want to know that too!).

There's almost certainly issues with imports. Probably need to just bring those in and merge and then overlap, although that might a configurable option at some point.

Obviously, many ontologies compared in this manner will show things that they both import like BFO or IAO, but right now I want to see that. The fact that they both have BFO as top level, or that they both import IAO, is interesting to me. I can see other use cases where some might like to see more concise results that exclude those things.

I thought about whether it's possible to do this with sequential diffs, but I am not sure (for starters, is the diff an OWL file?).

@balhoff
Copy link
Contributor

balhoff commented Dec 3, 2024

@hoganwr one way you could do this is with three applications of unmerge:

robot unmerge -i left.owl -i right.owl -o only-left.owl
robot unmerge -i right.owl -i left.owl -o only-right.owl
robot merge -i left.owl -i right.owl unmerge -i only-left.owl -i only-right.owl -o intersection.owl

This should give you an ontology that has only the axioms shared between the two.

@jamesaoverton
Copy link
Member

I can see how this would be useful. I don't have time for ROBOT development at the moment, myself.

Another workaround: If you're focused on a table of ID,LABEL,TYPE, then you could robot export from the two ontologies (make sure they're sorted), then use a Unix utility such as comm, or something more like SQL join, to find the common rows.

@hoganwr
Copy link
Author

hoganwr commented Dec 5, 2024 via email

@balhoff
Copy link
Contributor

balhoff commented Dec 6, 2024

There is a blob of RDF/XML in the intersection with the class IRI annotated with its label, but it doesn't show up in Protege for some reason (and even searching for a bit of the IRI and the label both return nothing)

Educated guess: the class declaration axiom is found in both and so removed. Then when ROBOT writes the label axiom, it's not attached to any entity; just a label axiom on a bare IRI. Protégé isn't able to show those annotations unfortunately. I think somebody should add a panel which can show these annotations.

@cmungall
Copy link
Contributor

cmungall commented Dec 6, 2024

Why not https://robot.obolibrary.org/diff? Just filter the output for declaration changes or label changes depending on use case. If the filtering is a bit janky then I would focus on adding axiom type filters to the existing diff than a new command

@jamesaoverton
Copy link
Member

James O: since you don't have time for this, should we close it now?

I don't mind leaving the issue open. Your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants