EBISPOT / OLS

Ontology Lookup Service from SPOT at EBI
http://www.ebi.ac.uk/ols
Apache License 2.0
96 stars 40 forks source link

Load custom ontology from local file #484

Open rpandey19 opened 3 years ago

rpandey19 commented 3 years ago

How can we load a custom ontology from a local file. I have setup the local installation of OLS but when I try to provide the path for a local owl / obo file in the config it gives me argument exception java.lang.IllegalArgumentException: Illegal character in opaque part at index 2: fulllocalpath\config\ref_assay.owl at java.net.URI.create(URI.java:852) at uk.ac.ebi.spot.ols.config.YamlBasedLoadingService.getOntologyPURL(YamlBasedLoadingService.java:253) at uk.ac.ebi.spot.ols.config.YamlBasedLoadingService.getConfiguration(YamlBasedLoadingService.java:48) at uk.ac.ebi.spot.ols.YamlLoader.updateDocument(YamlLoader.java:88) at uk.ac.ebi.spot.ols.YamlLoader.run(YamlLoader.java:76)

matentzn commented 3 years ago

Here is an example: https://github.com/monarch-initiative/ols_monarch/blob/master/ols/ols-config.yaml

Does this way of doing it work for you?

matentzn commented 3 years ago

Can you share your config?

rpandey19 commented 3 years ago

I got it working but setting a httpd container and hosting the file in it. But this is how I used it and the error I got-

Error- FileUpdatingService.run - Error checking: Custom Assay Ontology 2Failed to download file: sun.net.www.protocol.ftp.FtpURLConnection cannot be cast to java.net.HttpURLConnection uk.ac.ebi.spot.ols.exception.FileUpdateServiceException: Failed to download file: sun.net.www.protocol.ftp.FtpURLConnection cannot be cast to java.net.HttpURLConnection at uk.ac.ebi.spot.ols.util.FileUpdater.getFile(FileUpdater.java:138)

matentzn commented 3 years ago

could it have been one too many slashes after the file:?, i.e.:

ontology_purl: file:/Users/user/dev/work/test/ref_assay0.owl

That worked for me.

rpandey19 commented 3 years ago

It still fails. I just tried it. The indexer fails. It seems to be looking for http url. When I host the file on server it works fine.

BTW by any chance have you tried the OXO installation with docker? I am having trouble with that installation

henrietteharmse commented 2 years ago

@rpandey19 Have you been to resolve the issues you experienced with OLS and OxO installations?