ontodev / robot

ROBOT is an OBO Tool
http://robot.obolibrary.org
BSD 3-Clause "New" or "Revised" License
257 stars 70 forks source link

Alternative ways of removing imports #1185

Open areleu opened 3 months ago

areleu commented 3 months ago

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.

jamesaoverton commented 3 months ago

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

Eugenio2192 commented 3 months ago

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.

jamesaoverton commented 3 months ago

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.

Eugenio2192 commented 3 months ago

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!