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

--individuals exclude does not exclude all individuals #1111

Open
pfabry opened this issue Apr 18, 2023 · 5 comments
Open

--individuals exclude does not exclude all individuals #1111

pfabry opened this issue Apr 18, 2023 · 5 comments

Comments

@pfabry
Copy link

pfabry commented Apr 18, 2023

Using the --individuals exclude parameter with the extract function does not remove all individuals.

See example here: https://github.com/pfabry/ROBOT_individuals_exclude

I used obi.owl as test (https://github.com/obi-ontology/obi) and tried the following commands:

 robot extract --input obi.owl --method TOP --term BFO:0000001 --output obiV1.owl
 robot extract --input obi.owl --method TOP --term BFO:0000001 --individuals exclude --output obiV2.owl

In the first case obiV1.owl has 282 individuals
In the second case, obiV2.owl has 44 individuals
I found the same behavior with other ontologies (OMO, OMRSE for example).
The remaining individuals have different namespaces (OBI, UO, IAO, etc.). However, they didn't have a class type associated anymore. For a given individual present in both obiV1 and obiV2, it will have a class type in obiV1 but not anymore in obiV2.

@jamesaoverton
Copy link
Member

jamesaoverton commented Apr 19, 2023

Are the remaining individuals used in the logical axioms of classes, e.g. IAO:0000078 curation status specification? I suspect so, in which case there's no way to get rid of them without removing those class axioms.

We could update the docs to clarify this.

@pfabry
Copy link
Author

pfabry commented Apr 19, 2023

Indeed they are. As a workaround I preprocess the input file with remove --select individuals with the "inconvenient" of having to create custom import module in ODK.
On a side note, I was expecting that remove --axioms abox and remove --select individuals both produce the same result but it seems that --axioms abox doesn't select any abox related axioms in the input ontology.

@matentzn
Copy link
Contributor

Maybe can add a new exclusion code to extract --individuals exclude-incl-assertions - this is natural for many extraction use cases. A more complex solution would be a parameter --ignore individuals which explicitly does not remove them, but does the following:

  1. Remove all axioms which contain 1 or more individuals from O (O1)
  2. Extract module M1 from O1.
  3. Extract filter module M2 from O (!, not O1).
  4. Merge M1 and M2.

The advantage is with this latter solution is that the individual axioms do not impact the SLME module extraction, but are still included in the output if the user explicitly says so.

Neither of these would break the existing functionality.

@pfabry
Copy link
Author

pfabry commented Apr 20, 2023

Maybe can add a new exclusion code to extract --individuals exclude-incl-assertions - this is natural for many extraction use cases.

Shouldn't we get the same result with remove --select individuals or remove --axioms abox ?

@matentzn
Copy link
Contributor

Shouldn't we get the same result with remove --select individuals or remove --axioms abox ?

Not exactly:

EquivalentClass(:A,{:i, :j}), where :i and :j are individuals, is not an Abox axiom ({:i, :j} is a nominal expression that basically defines a set in terms of some specific individuals.

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

3 participants