Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement URI mapping service (#773)
Closes #686 This adds the URI mapping service implemented in biopragmatics/curies#41. It will allow for SPARQL queries to be written that call the Bioregistry as a service for generating URI mappings (e.g., between OBO PURLs, Identifiers.org URIs, and first-party URIs whose URI prefixes are stored in the Bioregistry). Here's a simplified example that doesn't require any triple store, and can be directly executed with RDFLib: ```sparql SELECT DISTINCT ?s ?o WHERE { VALUES ?s { <http://purl.obolibrary.org/obo/CHEBI_24867> <http://purl.obolibrary.org/obo/CHEBI_24868> } SERVICE <https://bioregistry.io/sparql> { ?s owl:sameAs ?o } } ``` returns the following (some not shown, you should get the idea): | subject | object | |---------------------------------------|------------------------------------------------- | | http://purl.obolibrary.org/obo/CHEBI_24867 | http://purl.obolibrary.org/obo/CHEBI_24867 | | http://purl.obolibrary.org/obo/CHEBI_24867 | http://identifiers.org/chebi/24867 | | http://purl.obolibrary.org/obo/CHEBI_24867 | https://www.ebi.ac.uk/chebi/searchId.do?chebiId=24867 | | ... | ... | This is built on top of the [`curies.Converter.expand_pair_all`](https://curies.readthedocs.io/en/latest/api/curies.Converter.html#curies.Converter.expand_pair_all), which itself is populated by all of the URI format strings available in the Bioregistry. To see examples of the possible ChEBI URIs, see https://bioregistry.io/registry/chebi.
- Loading branch information