Skip to content

Commit

Permalink
Improve construction of unit nodes
Browse files Browse the repository at this point in the history
- use proper curies
- skip UMUC until biopragmatics/bioregistry#648 is resolved
- add dual labels
  • Loading branch information
cthoyt committed Nov 15, 2022
1 parent 2a525f6 commit 9370099
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions mira/dkg/construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,11 @@ def main(add_xref_edges: bool, summaries: bool, do_upload: bool):

click.secho("Units", fg="green", bold=True)
for wikidata_id, label, description, xrefs in tqdm(get_unit_terms(), unit="unit"):
node_sources[term.id].add("wikidata")
nodes[term.id] = NodeInfo(
curie=f"wikidata:{wikidata_id}",
prefix="wikidata",
curie = f"wikidata:{wikidata_id}"
node_sources[curie].add("wikidata")
nodes[curie] = NodeInfo(
curie=curie,
prefix="wikidata;unit",
label=label,
synonyms="",
deprecated="false",
Expand Down
5 changes: 4 additions & 1 deletion mira/dkg/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def get_unit_terms():
rv = []
for record in records:
xrefs = []
for prefix in ["umuc", "qudt"]:
for prefix in [
# "umuc",
"qudt",
]:
value = record.get(prefix)
if value:
xrefs.append(f"{prefix}:{value['value']}")
Expand Down

0 comments on commit 9370099

Please sign in to comment.