identifiers-org / identifiers-org.github.io

MIT License
8 stars 1 forks source link

Not able to access sabiork.compound namespace with specific search such as ChebiID:15355 #65

Closed ak-chinmay closed 4 years ago

ak-chinmay commented 5 years ago

Hi, I have been trying to access sabiork.compound namespace in the identifiers.org by passing ChebiID:15355 as query but I am getting following error:

For namespace 'sabiork.compound', provided local ID 'ChebiID:15355' DOES NOT MATCH local IDs definition pattern '^\d+$'

I think the regex for this namespace need to be changed since currently it is not supporting the specific searches.

Thanks in advance.

mbdebian commented 4 years ago

Hi @ak-chinmay ,

Thanks for getting back to us with this issue.

I've had a look at the namespace details via the following query:

curl -i https://registry.api.identifiers.org/restApi/namespaces/search/findByMirId?mirId=MIR:00000002

Getting this information from the registry:

{
  "prefix" : "chebi",
  "mirId" : "MIR:00000002",
  "name" : "ChEBI",
  "pattern" : "^CHEBI:\\d+$",
  "description" : "Chemical Entities of Biological Interest (ChEBI) is a freely available dictionary of molecular entities focused on 'small' chemical compounds.",
  "created" : "2019-06-11T14:15:26.925+0000",
  "modified" : "2019-06-11T14:15:26.925+0000",
  "deprecated" : false,
  "deprecationDate" : null,
  "sampleId" : "36927",
  "namespaceEmbeddedInLui" : true,
  "_links" : {
    "self" : {
      "href" : "https://registry.api.identifiers.org/restApi/namespaces/1"
    },
    "namespace" : {
      "href" : "https://registry.api.identifiers.org/restApi/namespaces/1"
    },
    "contactPerson" : {
      "href" : "https://registry.api.identifiers.org/restApi/namespaces/1/contactPerson"
    }
  }
}

As I suspected, this is one of those special namespaces where the LUI (Locally Unique Id) already looked like a compact identifier, e.g. as shown in the Sample Compact Identifier section of the namespace description page, CHEBI:36927

This means that a namespace called chebi was register for CHEBI IDs, which look like CHEBI:36927. Thus, a CHEBI Compact Identifier would look like chebi:CHEBI:36927. Because the registrant didn't like this, we extended to it the same beautifying mechanism we offer for Ontologies, i.e. the possibility of not specifying the prefix 'chebi' so the resolver would recognise CHEBI LUIs straight away.

In this case, when resolving a CHEBI ID, you have to use the CHEBI ID itself, as specified by CHEBI, i.e. CHEBI:15355 (as an example using the provided CHEBI ID in this request)

If we try it this way:

curl -i https://identifiers.org/CHEBI:15355

We get the following response:

HTTP/2 302 
location: https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:15355
content-type: text/plain;charset=UTF-8
content-length: 0
date: Tue, 31 Mar 2020 10:19:00 GMT
via: 1.1 google
alt-svc: clear

Which is a redirection to the correct CHEBI entry, after the LUI being validated by the resolver.

I hope you find this information useful, @ak-chinmay

Please, don't hesitate to get back to us in case you need anything else.

Kind Regards, Manuel