Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement URI mapping service #773

Merged
merged 2 commits into from
Mar 16, 2023
Merged

Implement URI mapping service #773

merged 2 commits into from
Mar 16, 2023

Conversation

cthoyt
Copy link
Member

@cthoyt cthoyt commented Mar 16, 2023

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:

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, 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.

TODO

  • release new version of curies and bump version requirements in setup.cfg

Follow-up

@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.05 🎉

Comparison is base (fe8674f) 39.67% compared to head (88e2471) 39.72%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #773      +/-   ##
==========================================
+ Coverage   39.67%   39.72%   +0.05%     
==========================================
  Files         132      132              
  Lines        7494     7502       +8     
  Branches     1735     1736       +1     
==========================================
+ Hits         2973     2980       +7     
- Misses       4342     4343       +1     
  Partials      179      179              
Impacted Files Coverage Δ
src/bioregistry/app/impl.py 74.07% <100.00%> (+1.52%) ⬆️
src/bioregistry/resolve.py 55.74% <100.00%> (-0.19%) ⬇️
src/bioregistry/resource_manager.py 73.54% <100.00%> (+0.10%) ⬆️
src/bioregistry/version.py 68.42% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cthoyt cthoyt marked this pull request as ready for review March 16, 2023 16:45
@cthoyt cthoyt merged commit 25beec8 into main Mar 16, 2023
@cthoyt cthoyt deleted the add-mapping-service branch March 16, 2023 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add URI mapping service via SPARQL endpoint
2 participants