Skip to content

Commit

Permalink
Update relations cache
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Jan 4, 2024
1 parent 0d006f8 commit edab6cb
Show file tree
Hide file tree
Showing 5 changed files with 992 additions and 35 deletions.
10 changes: 7 additions & 3 deletions src/bioontologies/relations/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
),
("bfo", None),
("oboinowl", None),
("owl", None),
("rdf", None),
("rdfs", None),
("bspo", None),
("iao", None),
("omo", None),
("vo", None),
("obi", None),
]
PREFIX_OBO = "http://purl.obolibrary.org/obo/"
PREFIX_OIO = "http://www.geneontology.org/formats/oboInOwl#"
Expand Down Expand Up @@ -143,6 +142,11 @@ def main():
tuple(sorted(synonym.value for synonym in node.synonyms)),
)
)

for p in ["rdf", "rdfs", "owl"]:
j = json.loads(HERE.joinpath(f"data_{p}.json").read_text())
rows.extend(tuple(row.get(h, tuple()) for h in HEADER) for row in j)

rows = sorted(set(rows))
row_dicts = [{k: v for k, v in zip(HEADER, row) if v} for row in rows]
PATH.write_text(json.dumps(row_dicts, indent=2, sort_keys=True))
Expand Down
Loading

0 comments on commit edab6cb

Please sign in to comment.