-
Notifications
You must be signed in to change notification settings - Fork 77
Remove foreign axioms to create base product #570
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
Conversation
Awesome @beckyjackson that’s really great. Please give me a two days to reviews this PR before merging it; I have battled with this issue quite a bit and I would like to get it right :) |
Hey all, thanks for making a push in this direction. I don't want to make this a decade long discussion like in the case of --signature true (:P, sorry), but at least I would like to let you know what we would need to be able to use this functionality. First of all, some terminology to agree on (hope this is undisputed):
There are three use cases here that I need to support:
So afaics, your notion of base namespace is in line with what I expect. However, I am not sure why we would want to make any exceptions at all when defining "external terms". You say an external term is everything that does not confirm to an internal namespace except for x, y, z. (as an aside, in your view of the term: What if Rather than focusing ROBOT on a notion of external or internal terms, I would prefer a notion of external or internal axioms (
How does this differ from your proposal? |
OBI, for example, has "adopted" some terms from other namespaces that are part of the base ontology but do not start with the OBI namespace. This allows for exceptions like this. Additionally, not all IAO annotation properties and RO object properties are excluded from being removed (although I would like to see if there are more we should add), so the base might lose important info if you don't have an exclusion case.
If R is not in the namespace and is not in the excluded terms, then it would be selected as foreign. As long as you use
This is definitely possible. Would this be easier to use? My concern here is that this differs from how we have used |
100% I have the same. My argument was only against hard-coding exceptions. The base parameters takes a set of IRI patterns instead of "namespaces", and then everyone can decide whether IAO:0000115 should be in it or not (you already have a nice language for representing IRI patterns, we could just use that). So I would suggest this:
Maybe something like this:
We should be a bit careful though with axiom annotations; these should, IMHO, never be removed (if the axiom is not removed). (Maybe not further complicate remove command if the behaviour is exactly the same as filter? I dont mind.) |
Since we are setting
I guess instead of hard coding it, people would just need to include it in their
Another alternative is allowing both full IRIs and IRI patterns in the I'm still worried about implementing this in the robot/robot-core/src/main/java/org/obolibrary/robot/OntologyHelper.java Lines 1272 to 1280 in 7cfc2fe
|
I agree with @beckyjackson that @matentzn If
Yes. The simplest thing would be to enhance
I don't understand this: wouldn't that make pretty much all class expressions count as internal?
These could be added with current I think this would be a simple extension that could work. I'm worried that we'll eventually need more powerful pattern matching and/or term exclusion patterns, but we'll keep forward-compatibility in mind. |
Now that I think of it; this comment was made in haste; this is NOT base. This is simple. Lets forget I ever said it. This PR is not affected by this issue, and I will make a ticket at a later state to deal with BASESEED.
That would work! Great idea! This would be all I need; be able to supply sets of iri-patterns to termfile (or one to term). If we do this, we dont really need the --base parameter anymore?
Yeah sorry, I mixed up two issues. Apologies, please ignore. |
After a lot of back and forth, I think we have finally come up with a solution. We ended up implementing your original suggestion to have The final implementation combines If you want a true "base", make sure to use For example, an OBI base:
And if you want to include/exclude certain terms, this implementation still has the |
From @matentzn
Only axioms that have a subject in base "A" are included. Therefore, in case 3, the xref using the internal term A would not be included because it doesn't point to an internal subject. Are axiom annotations behaving as you would expect them to in these cases you outlined above? |
@matentzn - just wanted to follow up on my last comment on this post. I'd like to make sure this is working well for your use cases 🙂 |
Hey Becky, where is the latest jar that reflects this branch? I can test today. |
Now that I added a |
Thanks James. This is really helpful! |
Thats it! This command will help making the OBO world a better place. And my live in particular. I tested it on the three cases I care about by running first something like this (make):
And then inspecting the two slices manually (and the diff, which is empty). I can confirm yes; I am happy with that. I have not looked at super fringe cases yet (axiom annotations on axiom annotations that annotate an internal axiom), but to be honest, l am happy to just let those occur and report them as bugs when they come. Thanks so much! |
New options for
remove
/filter
:--base <namespace>
: add one or more base namespaces for the input ontology, e.g.http://purl.obolibrary.org/obo/OBI_
--select foreign
: select all entities that have a foreign namespace (other than base, and other than a few defaults:oboInOwl
,owl
,rdf
,rdfs
,xsd
as well asIAO:0000115
)--exclude-term <term>
/--exclude-terms <term-file>
: term or term file to exclude from being removed or filtered forAre there other IAO terms that should be hard-coded to be excluded?