-
Notifications
You must be signed in to change notification settings - Fork 204
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
Submit OBO prefixes to prefix.cc #1038
Comments
Will prefix.cc also start allowing uppercase prefixes? |
It would be easy to load, if only to test, that batch of prefixes into n2t.net. I see some conflicts with existing prefixes in n2t.net, such as for CHEBI and DOID; normally, n2t resolves such conflicts by letting the earliest definition take precedence. |
What is the status of this? |
FYI, prefix.cc has been updated to allow underscores as the final character in a namespace URI. |
Thanks @cygri How should we progress with synchronizing with prefix.cc (either directly from OBO, or from a registry that consumes from OBO, such as n2t or bioregistry.io?)? Is it possible to have some kind of semi-automated process, or do you recommend manual submission? It would also be good to be able to batch update prefix.cc. For example, for GO on http://prefix.cc/context you have "go": "http://purl.org/obo/owl/GO#", This has not been in use for over a decade there are other odd entries e.g |
FYI here's the Python code you'd need to automate updating prefix.cc: import requests
import bioregistry
def create(curie_prefix: str, uri_prefix: str) -> requests.Response:
return requests.post(
f"https://prefix.cc/{curie_prefix}",
data={"create": uri_prefix},
)
def main():
prefix_cc_map = requests.get("https://prefix.cc/context").json()["@context"]
for record in bioregistry.resources():
if not record.get_obofoundry_prefix():
continue
uri_prefix = record.get_uri_prefix()
if not uri_prefix:
continue
if uri_prefix == prefix_cc_map.get(record.prefix):
# No need to re-create something that's already
# both available and correct wrt Bioregistry/OBO
continue
print("Creating record for", record.prefix, uri_prefix)
res = create(record.prefix, uri_prefix)
print(res.text)
# We're breaking here since we can only make one
# update per day
break
if __name__ == "__main__":
main() As of biopragmatics/bioregistry#1056, this is now possible with Unfortunately, there seems to be some kind of rate-limiting, and you can only post one per day. @cygri is there the possibility of adding some kind of authentication for trusted posters? |
I implemented the script from above in a GitHub action in biopragmatics/bioregistry#1056 that will run nightly until it gets all of the OBO Foundry prefixes into Prefix.cc, then will continue with the remaining. Note that this is rate limited to a given IP address at 1 upload per day. The first successful CI run was on: https://github.com/biopragmatics/bioregistry/actions/runs/8325600134/job/22779554502 |
We release prefixes using shacl vocab here: https://raw.githubusercontent.com/OBOFoundry/OBOFoundry.github.io/master/registry/obo_prefixes.ttl
(still need a PURL for this...)
We are now able to submit OBO purls to http://prefix.cc which is maintained by @cygri (see also
cygri/prefix.cc#27). Rather than submit all manually it would be good to figure out an automatic sync.
Or maybe this is better done indirectly via identifiers.org or n2t.net? cc @jkunze
The text was updated successfully, but these errors were encountered: