Skip to content

Commit

Permalink
Clean up SSSOM export code
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Sep 23, 2023
1 parent a954b26 commit a57a962
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/biomappings/export_sssom.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ def get_sssom_df(use_tqdm: bool = False):
if any(source.startswith(x) for x in ["orcid:", "wikidata:"]):
prefixes.add(source.split(":")[0])
creators.add(source)
try:
prefixes.add(mapping["relation"].split(":")[0])
except ValueError:
pass # TODO make sure all relations are valid CURIEs
prefixes.add(mapping["relation"].split(":")[0])

rows.append(
(
Expand Down Expand Up @@ -123,10 +120,8 @@ def sssom():
df.to_csv(TSV_PATH, sep="\t", index=False)

# Get a CURIE map containing only the relevant prefixes
prefix_map = {
"RO": "http://purl.obolibrary.org/obo/RO_", # Default
}
for prefix in prefixes:
prefix_map = {}
for prefix in sorted(prefixes, key=str.casefold):
uri_prefix = bioregistry.get_uri_prefix(prefix)
if uri_prefix is None:
raise ValueError(f"could not look up URI prefix for {prefix}")
Expand Down

0 comments on commit a57a962

Please sign in to comment.