Created
November 2, 2024 13:41
-
-
Save cthoyt/89e427061a4d553ee85b6bbfd1791de5 to your computer and use it in GitHub Desktop.
Generate SSSOM for the negative mappings in the Bioregistry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import bioregistry | |
if __name__ == "__main__": | |
r = json.load(open("mismatch.json")) | |
with open("mismatches.sssom.tsv", "w") as file: | |
print( | |
"subject_id", | |
"subject_label", | |
"predicate_id", | |
"predicate_modifier", | |
"object_id", | |
"object_label", | |
"mapping_justification", | |
"author_id", | |
sep="\t", | |
file=file, | |
) | |
for k, v in r.items(): | |
for metaprefix, value in v.items(): | |
print( | |
f"bioregistry:{k}", | |
bioregistry.get_name(k), | |
"skos:exactMatch", | |
"NOT", | |
f"{metaprefix}:{value}", | |
"", | |
"semapv:ManualMappingCuration", | |
"orcid:0000-0003-4423-4370", | |
sep="\t", | |
file=file, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment