ontology-development-kit icon indicating copy to clipboard operation
ontology-development-kit copied to clipboard

ODK import doesn't seem to work with EFO

Open shawntanzk opened this issue 3 years ago • 1 comments

I've checked multiple application ontologies I work with + one that @bvarner-ebi works with It seems that EFO doesn't get imported properly. On checking, efo_import.owl is empty (mirror seems fine)

The yaml config is as follows:

import_group:
  products: 
    - id: ro
    - id: pato
    - id: efo
      module_type: filter
      mirror_from: https://www.ebi.ac.uk/efo/efo-base.owl
      base_iris: 
      - http://www.ebi.ac.uk/efo/EFO_

This creates the following in Makefile:

$(IMPORTDIR)/efo_import.owl: $(MIRRORDIR)/efo.owl $(IMPORTDIR)/efo_terms_combined.txt
	if [ $(IMP) = true ]; then $(ROBOT) merge -i $< \
		query --update ../sparql/preprocess-module.ru \
		remove --base-iri $(URIBASE)/EFO --axioms external --preserve-structure false --trim false \
		remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/efo_terms_combined.txt --select complement \
		query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \
		annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output [email protected] && mv [email protected] $@; fi

Currently using this custom make point seems to do the trick for me

## Temp fix for EFO import

$(IMPORTDIR)/efo_import.owl: $(MIRRORDIR)/efo.owl $(IMPORTDIR)/efo_terms_combined.txt
	if [ $(IMP) = true ]; then $(ROBOT) merge -i $< \
		query --update ../sparql/preprocess-module.ru \
		extract --method MIREOT -B $(IMPORTDIR)/efo_terms_combined.txt \
		query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \
		annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output [email protected] && mv [email protected] $@; fi

I hence suspect its something on the remove command

shawntanzk avatar Oct 13 '22 12:10 shawntanzk

btws testing out on a merged_import atm -> I think initially it didn't pull terms in cause the mirror was empty, with mirror redirect, hoping it will work.

shawntanzk avatar Oct 13 '22 12:10 shawntanzk

https://github.com/BICCN/TMN <- one that I have been working with that has that issue

shawntanzk avatar Oct 31 '22 14:10 shawntanzk

Sorry misspoke previously in call. Seems to work fine with base module and all, just needing this

    - id: efo
      mirror_from: https://www.ebi.ac.uk/efo/efo-base.owl
      base_iris: 
      - http://www.ebi.ac.uk/efo/EFO_

The problem was when non base module with filter type, somehow we couldn't get it to work, the product was always empty even though we added terms in the term file

Not 100% sure whats going on in reality though

shawntanzk avatar Oct 31 '22 15:10 shawntanzk

@shawntanzk any further insight on this issue here?

matentzn avatar Nov 13 '22 11:11 matentzn

@shawntanzk any further insight on this issue here?

nope :( but im using the above yaml config with merged import and that seems to work ok

shawntanzk avatar Nov 13 '22 12:11 shawntanzk

Finally, I understood the issue here. ROBOT doesn't know the EFO prefix in the efo_terms.txt file. Simply changing the terms to the complete URI works.

anitacaron avatar Sep 26 '23 16:09 anitacaron

Alternatively you have to overwrite the goal and add --prefix deflations to the command.. we should probably figure out a way to leverage curies prefix maps for this or at least add a simple prefix map feature to ODK that can be odk figured

matentzn avatar Sep 28 '23 08:09 matentzn