Skip to content

Commit

Permalink
Merge pull request #44 from linkml/update_bioregistry
Browse files Browse the repository at this point in the history
update dependencies and registry contents to resolve teh prefix 'action' in the merge file not having a canonical expansion
  • Loading branch information
sierra-moxon authored Oct 12, 2023
2 parents 589ded6 + 52f647a commit 932cbda
Show file tree
Hide file tree
Showing 11 changed files with 1,878 additions and 1,303 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11", "3.7" ]
python-version: [ "3.11", "3.8" ]

steps:

Expand Down
2,295 changes: 1,085 additions & 1,210 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "prefixmaps"
version = "0.1.4"
version = "0.1.6"
description = "A python library for retrieving semantic prefix maps"
readme = "README.md"
authors = ["cmungall <[email protected]>"]
Expand All @@ -23,7 +23,7 @@ homepage = "https://github.com/linkml/prefixmaps"


[tool.poetry.dependencies]
python = "^3.7.6"
python = "^3.8.0"
pyyaml = ">=5.3.1"
sphinx-rtd-theme = {version = "^1.0.0", extras = ["docs"]}
Sphinx = {version = "^5.3.0", extras = ["docs"]}
Expand All @@ -32,9 +32,13 @@ sphinx-click = {version = "^4.3.0", extras = ["docs"]}
myst-parser = {version = "^0.18.1", extras = ["docs"]}
click = ">=8.1.3"
requests = {version = "^2.28.1", extras = ["refresh"]}
bioregistry = {version = "^0.8.0", extras = ["refresh"]}
bioregistry = {version = "^0.10.0", extras = ["refresh"]}
rdflib = {version = "^6.2.0", extras = ["refresh"]}
curies = ">=0.5.3"
tox = "^4.11.3"
# this forces tox to use pydantic ^1 instead of installing pydantic 2 as part of its "refresh" environment.
# bioregistry is still at pydantic 1.0, so this is necessary to avoid refresh failure.
pydantic = "^1.8.2"

[tool.poetry.dev-dependencies]
pytest = ">=6.2"
Expand Down
122 changes: 116 additions & 6 deletions src/prefixmaps/data/bioregistry.csv

Large diffs are not rendered by default.

122 changes: 116 additions & 6 deletions src/prefixmaps/data/bioregistry.upper.csv

Large diffs are not rendered by default.

216 changes: 185 additions & 31 deletions src/prefixmaps/data/merged.csv

Large diffs are not rendered by default.

216 changes: 185 additions & 31 deletions src/prefixmaps/data/merged.oak.csv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/prefixmaps/data/obo.csv
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ obo,MAO,http://purl.obolibrary.org/obo/MAO_,canonical
obo,MAT,http://purl.obolibrary.org/obo/MAT_,canonical
obo,MAXO,http://purl.obolibrary.org/obo/MAXO_,canonical
obo,MCO,http://purl.obolibrary.org/obo/MCO_,canonical
obo,MCRO,http://purl.obolibrary.org/obo/MCRO_,canonical
obo,MF,http://purl.obolibrary.org/obo/MF_,canonical
obo,MFMO,http://purl.obolibrary.org/obo/MFMO_,canonical
obo,MFO,http://purl.obolibrary.org/obo/MFO_,canonical
Expand Down
77 changes: 64 additions & 13 deletions src/prefixmaps/data/prefixcc.csv

Large diffs are not rendered by default.

107 changes: 106 additions & 1 deletion src/prefixmaps/data/w3id.csv

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion src/prefixmaps/datamodel/context.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Classes for managing individual Contexts."""

import re
import warnings
from collections import defaultdict
from dataclasses import dataclass, field
from enum import Enum
Expand Down Expand Up @@ -294,8 +295,18 @@ def as_extended_prefix_map(self) -> List[curies.Record]:

prefix_synonyms = defaultdict(set)
for expansion in self.prefix_expansions:
if expansion.status == StatusType.namespace_alias:
if (
expansion.status == StatusType.namespace_alias
and expansion.namespace in reverse_prefix_map
):
prefix_synonyms[reverse_prefix_map[expansion.namespace]].add(expansion.prefix)
elif (
expansion.status == StatusType.namespace_alias
and expansion.namespace not in reverse_prefix_map
):
warnings.warn(
f"Namespace {expansion.namespace} has no canonical prefix", stacklevel=2
)

return [
curies.Record(
Expand Down

0 comments on commit 932cbda

Please sign in to comment.