biopragmatics / bioregistry

📮 An integrative registry of biological databases, ontologies, and nomenclatures.
https://bioregistry.io
MIT License
107 stars 47 forks source link

Add lowercase preferred prefix for semweb resources, update rdf example #1091

Closed bgyori closed 2 months ago

bgyori commented 2 months ago

This PR adds the default lower case prefix for each prefix corresponding to a semantic web context resource (see https://bioregistry.io/collection/0000002) as a preferred_prefix. It also updates the example identifier for rdf to a valid one.

Fixes #1090.

cthoyt commented 2 months ago

This all looks good to me. Thanks @bgyori.

Note that the semantic web list in the Bioregistry is larger/partially overlapping with curated resource in the prefixmaps package (https://github.com/linkml/prefixmaps/blob/main/src/prefixmaps/data/linked_data.curated.yaml). There isn't some kind of reference for semantic web prefixes, so we're just doing our best here to show the most popular/relevant ones

cthoyt commented 2 months ago

Extra note, I ran the following script and noticed that BioLink, LinkML, and NCIT are in LinkML's semantic web list, but not in the Bioregistry's. I'm not sure if it makes sense to add BioLink and LinkML to the semantic web list, but I'm pretty sure NCIT doesn't belong there. Either way, I added preferred prefixes for BioLink and LinkML in 7f899d69 and an additional prefix synonym for NCIThesaurus in 96ee766b to cover any future bases.

Code ```python import requests import yaml import bioregistry URL = "https://raw.githubusercontent.com/linkml/prefixmaps/main/src/prefixmaps/data/linked_data.curated.yaml" def main(): collection = bioregistry.get_collection("0000002").resources res = requests.get(URL) data = yaml.safe_load(res.text) prefixes = set(data["prefixes"]) for prefix in prefixes: xx = bioregistry.normalize_prefix(prefix) if xx is None: print(f"No prefix in Bioregistry for LinkML prefix: {prefix}") elif xx not in collection: print(f"Prefix is not in Bioregistry's semantic web collection: {prefix}") if __name__ == "__main__": main() ```