Skip to content
New issue

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

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

Already on GitHub? # to your account

Relax relax #1060

Closed
matentzn opened this issue Oct 5, 2022 · 8 comments · Fixed by #1188
Closed

Relax relax #1060

matentzn opened this issue Oct 5, 2022 · 8 comments · Fixed by #1188

Comments

@matentzn
Copy link
Contributor

matentzn commented Oct 5, 2022

Right now, relax indiscriminately relaxes all equivalent class axioms regardless of their shape. The original idea was to be able to turn logical definitions of the form A = B and R some C and R some D and R some E (simple conjunctions) into

A sub B
A sub R some C
A sub R some D
A sub R some E

Using relax on all axioms indiscriminately does not make much sense, see here:

https://ols.monarchinitiative.org/ontologies/upheno2/terms?iri=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FFYPO_0004107

There is little value in relaxing a complex axiom like that.

I would like to propose adding a new option to relax:

--simple-equivalent-classes-only

Which restricts the operation of relax to only axioms of the form:

A = B and C and D

where B, C and D are all class names or simple existential restrictions.

Motivation:

The main use case of relax, as far as I understand, is to project a complex logical structure using equivalent class axioms into a more graphy structures that can be leveraged by graph processing. The workflow usually goes something like: relax->reduce-> delete equivalent class axioms to generate a simple representation of the ontology ala OBO format.

For uPheno, I need to be able to run relax, and then delete all equivalent class axioms in the ontology and rewrite them to something else. Unfortunately, because ODK mandates the relax->reduce chain in default releases, I do get these terrible subClassOf axioms everywhere now - which are much much harder to filter out after the fact with ROBOT.

@cmungall
Copy link
Contributor

cmungall commented Oct 5, 2022

no objections, but I don't think the relaxed forms are entirely useless. They still form a relational graph if you admit blank nodes. They are still easier to query with sparql. (Of course, we only have these complex subq patterns for abstruse reasons we don't need to go into here).

Anyway the option seems fine. "Simple" is doing a lot of work, what about --exclude-nested.

@matentzn
Copy link
Contributor Author

matentzn commented Oct 5, 2022

sounds good!

@matentzn
Copy link
Contributor Author

matentzn commented Oct 5, 2022

And the behaviour would be that if a conjunct of the definition contains a complex class the whole definition is excluded, or just the conjunct with the nested expression?

@dosumis
Copy link

dosumis commented Feb 19, 2023

Strong disagree that this should be default behaviour (looking back, I guess you're not asking for this). Important to have relax be as non-lossy as possible. These nested subClassOf axioms are far from useless - e.g. they can be the substrate for property chain reasoning.

Happy enough to have this as an optional arg as you suggest, as long as this doesn't end up in release pipeline for one of the main ODK products.

@matentzn
Copy link
Contributor Author

You see relax always in conjunction with the removal of equivalent class axioms, right @dosumis? I think the problem here is that relax serves to distinct purposes:

  1. Weakening equivalence class axioms so that classifications can be protected (here what you say make sense)
  2. Graphy-fying an ontology with complex axioms (i.e. making it possible to render certain links in the complex expressions straight forwardly in Ubergraph etc).

I guess these two use case will need different treatments?

@matentzn
Copy link
Contributor Author

A second issue is the relaxation of equivalence classes between named classes (NC)

A=B

A sub B
B sub A

It rarely makes sense to relax this way. In my conversations with @cmungall on slack he said:

I think relaxing equiv between NCs is universally confusing regardless of base files. I get that it logically makes sense but I think it was always a mistake to do this

I am also proposing hereby to have another option --exclude-equivalents-between-named-classes which prevents these axioms to be relaxed.

@dosumis
Copy link

dosumis commented Jan 15, 2024

I am also proposing hereby to have another option --exclude-equivalents-between-named-classes which prevents these axioms to be relaxed.

Agree. Or maybe make this the default and have an option to include?

@matentzn
Copy link
Contributor Author

I have implemented all this in #1188 if you want to take a look:

  • A way to exclude named classes from relaxation
  • A way to only assert simple existential restrictions and named subsumptions during relax

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

Successfully merging a pull request may close this issue.

3 participants