sssom-py
sssom-py copied to clipboard
New method: flip
@kevinscharper noted in https://github.com/monarch-initiative/monarch-ingest/issues/326 that if you are not careful and "blindly apply" a mapping file to a dataset, you may end up applying it the wrong way. For example, Mondo SSSOM mappings have Mondo IDs in as subject_id and external ID's such as OMIM as object_ids.
I propose the development of a flip method that allows to swap subject and object. This is not just about "flipping IDs", you have to
- make sure that all
subjectandobjectspecific fields are flipped accordingly, and - skos:broadMatch gets flipped to skos:narrowMatch etc.
This method could be useful, I think, because it allows us to centralise the logic by which we permit flipping. For example, we can simply ignore cases where flipping would be clearly wrong, or the "inverse" properties are not known.
Yes, flip and also normalizing to a canonical subject or object Id space
@hrshdhgd from a priority perspective this comes after oak-synonimizer and https://github.com/monarch-initiative/mondo-ingest/issues/78.
I second this proposal and was actually about to open a ticket to request such a feature.
Being able to automatically “flip” a mapping set would be helpful for the Uberon/CL-to-taxon-specific-ontology mappings, if we plan (as was the idea) to allow for them to be managed either on the Uberon/CL side or on the taxon-specific side, because we might then have to deal with mapping sets that are in a different “direction” (Uberon-maintained mappings would likely be using Uberon terms as subjects and the foreign terms as objects, whereas externally maintained mappings would likely be the other way round).
Its in the high priority issues and will be addressed before end of March I think
Do we agree on how the semapv:crossSpecies*Match predicates should be inverted?
For me, it should be:
A semapv:crossSpeciesExactMatch B->B semapv:crossSpeciesExactMatch AA semapv:crossSpeciesNarrowMatch B->B semapv:crossSpeciesBroadMatch AA semapv:crossSpeciesBroadMatch B->B semapv:crossSpeciesNarrowMatch AA semapv:crossSpeciesCloseMatch B-> cannot invert, drop
Makes sense?
We have a draft document for this here: https://mapping-commons.github.io/sssom/chaining_rules/
Feel free to review and give feedback!
Proposal to add rules for these predicates: https://github.com/mapping-commons/sssom/pull/261