robot icon indicating copy to clipboard operation
robot copied to clipboard

Alternative ways of removing imports

Open areleu opened this issue 1 year ago • 4 comments

So I am looking to ways to work around this error that I face when I try to build an ontolgy in a Gitlab CI pipeline:

org.semanticweb.owlapi.model.UnloadableImportException: Could not load imported ontology: <ontology-iri> Cause: Connection refused
Use the -vvv option to show the stack trace.
Use the --help option to see usage information.

It seems that there is a problem with the configuration of gitlab that does not allow certain applications to make internet requests.

And I came across this suggestion https://github.com/ontodev/robot/issues/310 but the problem is that when I try to remove the imports of the ontology, the API tries to import them beforehand.

On one side I could figure a solution for the requests issue in gitlab, but I think is too much effort for something that I do not really need, and other kinds of requests are working.

I also faced this issue and its solution https://github.com/ontodev/robot/issues/1150#issuecomment-1726499825 and I considered using a similar solution but since I am using a large number of files so it seems to be error prone to me. Unless there is some way in which I can programmatically build a catalog using robot, since I could theoretically wget each of the missing imports and add them to the catalog.

areleu avatar Mar 07 '24 15:03 areleu

Would robot merge --collapse-import-closure true work? http://robot.obolibrary.org/merge

jamesaoverton avatar Mar 07 '24 16:03 jamesaoverton

Would robot merge --collapse-import-closure true work? http://robot.obolibrary.org/merge

Just tried it and got the same outcome, it tries to import everything before merging. I will hardcode a big catalog for now as a temporary fix, but it gets very large with ontologies having multiple dependencies.

EDIT: This is my home account, the other one I can only get in my work computer.

Eugenio2192 avatar Mar 07 '24 21:03 Eugenio2192

So you do not want to fetch the imports at all? If that's right, you can remove the <owl:import ...> elements from your .owl file, either using Unix tools such as sed or grep -v, or using robot query --update.

jamesaoverton avatar Mar 07 '24 21:03 jamesaoverton

So you do not want to fetch the imports at all? If that's right, you can remove the <owl:import ...> elements from your .owl file, either using Unix tools such as sed or grep -v, or using robot query --update.

In this particular case I don't want the imports, mainly because I am extracting portions of several ontologies that have a multiple imports. But you are right, I think I will have to rely on such a solution. Feel free to close if you think this is not a very needed feature, thanks!

Eugenio2192 avatar Mar 07 '24 23:03 Eugenio2192