EBISPOT / zooma

ZOOMA - Optimal Ontology Mapping Application. http://www.ebi.ac.uk/spot/zooma.
Apache License 2.0
24 stars 11 forks source link

Unexpected host in olslinks href #99

Closed fabianegli closed 2 years ago

fabianegli commented 2 years ago

There is some unexpected behaviour when using the zooma API2.

https://www.ebi.ac.uk/spot/zooma/v2/api/services/annotate?filters=ontologies%3A%5Bnbcitaxon%5D&propertyValue=human

Will return the following:

[{'_links': {'olslinks': [{'href': 'https://ves-oy-be:8080/ols/api/terms?iri=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FNCBITaxon_9606',
                           'semanticTag': 'http://purl.obolibrary.org/obo/NCBITaxon_9606'}]},
  'annotatedBiologicalEntities': [],
  'annotatedProperty': {'propertyType': 'factor',
                        'propertyValue': 'Human',
                        'uri': 'http://rdf.ebi.ac.uk/resource/zooma/69A7F59A19C8525E4C7B04C798596A69'},
  'confidence': 'HIGH',
  'derivedFrom': {'_links': {'olslinks': [{'href': 'http://purl.obolibrary.org/obo/NCBITaxon_9606',
                                           'semanticTag': 'http://purl.obolibrary.org/obo/NCBITaxon_9606'}]},
                  'annotatedBiologicalEntities': [{'name': 'metabo_219',
                                                   'studies': [{'accession': 'MTBLS176',
                                                                'types': ['http://www.w3.org/2002/07/owl#NamedIndividual',
                                                                          'http://rdf.ebi.ac.uk/terms/zooma/DatabaseEntrySource'],
                                                                'uri': 'http://rdf.ebi.ac.uk/resource/zooma/metabolights/A6AA403F9EF597D6BCFAAAFB79571724'}],
                                                   'types': ['http://www.w3.org/2002/07/owl#NamedIndividual',
                                                             'http://rdf.ebi.ac.uk/terms/zooma/Target'],
                                                   'uri': 'http://rdf.ebi.ac.uk/resource/zooma/metabolights/1846EDBCECE5A0D6E04AC107EF21F950'}],
                  'annotatedProperty': {'propertyType': 'factor',
                                        'propertyValue': 'Human',
                                        'uri': 'http://rdf.ebi.ac.uk/resource/zooma/69A7F59A19C8525E4C7B04C798596A69'},
                  'provenance': {'accuracy': 'NOT_SPECIFIED',
                                 'annotationDate': 1538852400000,
                                 'annotator': 'Zoe May Pendlington',
                                 'evidence': 'MANUAL_CURATED',
                                 'generatedDate': 1649104721000,
                                 'generator': 'https://www.ebi.ac.uk/metabolights',
                                 'source': {'name': 'metabolights',
                                            'type': 'DATABASE',
                                            'uri': 'https://www.ebi.ac.uk/metabolights'}},
                  'replacedBy': [],
                  'replaces': [],
                  'semanticTags': ['http://purl.obolibrary.org/obo/NCBITaxon_9606'],
                  'uri': 'http://rdf.ebi.ac.uk/resource/zooma/metabolights/8F94CFC1124A59BCEB894A9917CA77C2'},
  'provenance': {'accuracy': None,
                 'annotationDate': 1655307078247,
                 'annotator': 'ZOOMA',
                 'evidence': 'ZOOMA_INFERRED_FROM_CURATED',
                 'generatedDate': 1655307078247,
                 'generator': 'ZOOMA',
                 'source': {'name': 'zooma',
                            'type': 'DATABASE',
                            'uri': 'www.ebi.ac.uk/spot/zooma'}},
  'replacedBy': [],
  'replaces': [],
  'semanticTags': ['http://purl.obolibrary.org/obo/NCBITaxon_9606'],
  'uri': None}]

Note that the '_links'>'olslinks'[0]>'href' is

https://ves-oy-be:8080/ols/api/terms?iri=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FNCBITaxon_9606

which is definitely not a valid link. I believe it should instead be

https://www.ebi.ac.uk/ols/api/terms?iri=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FNCBITaxon_9606

To me this looks like the API backend might compose the url erroneously with some local network identifier instead of the public url.

henrietteharmse commented 2 years ago

Oh Wow! THAT is a problem! Thanks so much for reporting this! We will fix this, but it may be a while before we get to the bottom of this.

fabianegli commented 2 years ago

It seems to me that this comes from some configuration via addPrefixToAllOLSLinks:

https://github.com/EBISPOT/zooma/blob/e7aba114f7559498fa0773796b4245931efd4b0e/zooma-core/src/main/java/uk/ac/ebi/fgpt/zooma/access/Zooma.java#L79

henrietteharmse commented 2 years ago

I do not think this is a Zooma issue. It is more likely an OLS issue.

fabianegli commented 2 years ago

I am no Java developer - that's just as far as I was able to track the origin 🤷‍♂️ I hope you will soon get to the bottom of it 🤞

jamesamcl commented 2 years ago

Hi, this should be resolved now.

fabianegli commented 2 years ago

Following the link in the initial post now returns a json with a '_links'>'olslinks'[0]>'href' to "https://www.ebi.ac.uk/ols/api/terms?iri=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FNCBITaxon_9606".