Onto-Med / top-backend

Spring Boot based backend of the TOP Framework
MIT License
0 stars 1 forks source link

Follow redirect to terminology server #199

Closed KonradHoeffner closed 8 months ago

KonradHoeffner commented 9 months ago

I want to have some test data in my local copy of the framework, so I exported "BMI-Schulung" as TopJsonFormat in https://top.imise.uni-leipzig.de/. However when I import that in my local copy, I get the following error on the console and no feedback on the frontend.

backend-1   | 2024-02-14 10:06:50.384  INFO 1 --- [nio-8080-exec-9] org.reflections.Reflections              : Reflections took 211 ms to scan 4 urls, producing 137 keys and 535 values
backend-1   | 2024-02-14 10:06:55.098 ERROR 1 --- [nio-8080-exec-9] c.s.t.b.r.ols.CodeSystemRepository       : 301 Moved Permanently from GET https://www.ebi.ac.uk/ols/api/ontologies?page=0&size=1000; nested exception is org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type 'text/html' not supported for bodyType=care.smith.top.backend.service.ols.OLSOntologiesResponse

bmi-schulung.json

The page https://www.ebi.ac.uk/ols/api/ontologies?page=0&size=1000 redirects to https://www.ebi.ac.uk/ols4/api/ontologies?page=0&size=1000.

I propose the following changes:

ChristophB commented 8 months ago

Hi, I cannot reproduce this error with the standard configuration provided in docker-compose.env.tpl, but setting TERMINOLOGY_SERVICE_ENDPOINT to "https://www.ebi.ac.uk/ols/api" shows the warning you described.

So I think your first task can be skipped, but 301 redirects really need to be handled correctly.

BTW, the error is not directly related to the phenotype import.

KonradHoeffner commented 8 months ago

I think I already changed it from ols to ols4, maybe that is why the error didn't occur anymore?

ChristophB commented 8 months ago

I think I already changed it from ols to ols4, maybe that is why the error didn't occur anymore?

Yes, but I think the changes I made are still useful.

KonradHoeffner commented 8 months ago

Absolutely agree! However it does not seem to work, I am investigating whether my local version still runs an old version and not the newly build one.

KonradHoeffner commented 8 months ago

The error is thrown in care.smith.top.backend.repository.ols.CodeSystemRepository which extends OlsRepository where your pull request handles redirects, is it possible that the error is thrown by another method? Does it not occur in your local installation?

ChristophB commented 8 months ago

I don't get an error and I think this is the only place where an OLS web client is built. Actually, this is not my code, so it could be that I missed something.