robot icon indicating copy to clipboard operation
robot copied to clipboard

Relax relax

Open matentzn opened this issue 3 years ago • 8 comments

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.

matentzn avatar Oct 05 '22 08:10 matentzn

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.

cmungall avatar Oct 05 '22 13:10 cmungall

sounds good!

matentzn avatar Oct 05 '22 14:10 matentzn

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?

matentzn avatar Oct 05 '22 14:10 matentzn

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.

dosumis avatar Feb 19 '23 09:02 dosumis

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 avatar Feb 19 '23 09:02 matentzn

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.

matentzn avatar Jan 15 '24 14:01 matentzn

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?

dosumis avatar Jan 15 '24 15:01 dosumis

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

matentzn avatar Mar 10 '24 17:03 matentzn