Skip to content

Commit bc9dfcd

Browse files
committed
Update
1 parent 55a9540 commit bc9dfcd

3 files changed

Lines changed: 17 additions & 12 deletions

File tree

src/pyobo/struct/jskos_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
from pathlib import Path
44

55
import curies
6-
7-
from .struct import Obo, build_ontology
86
import jskos
97
from jskos import ProcessedConcept, ProcessedKOS
108

9+
from .struct import Obo, build_ontology
10+
1111
__all__ = [
12-
"read_jskos",
1312
"from_pkos",
13+
"read_jskos",
1414
]
1515

1616

1717
def read_jskos(path: str | Path, *, prefix: str, converter: curies.Converter | None = None) -> Obo:
1818
"""Read JSKOS into an ontology."""
1919
if converter is None:
2020
from ..identifier_utils import get_converter
21+
2122
converter = get_converter()
2223
kos = jskos.read(path)
2324
pkos = jskos.process(kos, converter)

src/pyobo/utils/misc.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
import logging
66
from collections.abc import Callable, Iterable
77
from datetime import datetime
8-
from typing import TYPE_CHECKING, TypeAlias
8+
from typing import TypeAlias
99

1010
import bioversions.utils
11-
from pyobo.constants import ONTOLOGY_GETTERS, OntologyFormat
1211
from bioregistry.schema.struct import AnnotatedURL
1312

13+
from ..constants import ONTOLOGY_GETTERS, OntologyFormat
14+
1415
__all__ = [
1516
"VERSION_GETTERS",
1617
"cleanup_version",
@@ -49,8 +50,8 @@
4950
"https://w3id.org/lehrplan/ontology/", # like in https://w3id.org/lehrplan/ontology/1.0.0-4
5051
"http://www.ebi.ac.uk/swo/version/", # http://www.ebi.ac.uk/swo/version/6.0
5152
"https://w3id.org/emi/version/",
52-
"https://nfdi4culture.de/ontology/", # https://nfdi4culture.de/ontology/3.0.0
53-
"http://purls.helmholtz-metadaten.de/mwo/mwo.owl/", # http://purls.helmholtz-metadaten.de/mwo/mwo.owl/3.0.0
53+
"https://nfdi4culture.de/ontology/", # https://nfdi4culture.de/ontology/3.0.0
54+
"http://purls.helmholtz-metadaten.de/mwo/mwo.owl/", # http://purls.helmholtz-metadaten.de/mwo/mwo.owl/3.0.0
5455
]
5556
VERSION_PREFIX_SPLITS = [
5657
"http://www.ebi.ac.uk/efo/releases/v",
@@ -59,7 +60,7 @@
5960
"http://ontology.neuinfo.org/NIF/ttl/nif/version/",
6061
"http://nmrml.org/cv/v", # as in http://nmrml.org/cv/v1.1.0/nmrCV
6162
"http://enanomapper.github.io/ontologies/releases/", # as in http://enanomapper.github.io/ontologies/releases/10.0/enanomapper
62-
"https://w3id.org/sulo/sulo-", # as in https://w3id.org/sulo/sulo-0.2.4.ttl
63+
"https://w3id.org/sulo/sulo-", # as in https://w3id.org/sulo/sulo-0.2.4.ttl
6364
]
6465
BAD = {
6566
"http://purl.obolibrary.org/obo",

tests/test_struct/test_jskos/test_jskos.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Test JSKOS."""
22

33
import unittest
4-
from pyobo.struct.jskos_utils import read_jskos
54

65
import curies
76

7+
from pyobo.struct.jskos_utils import read_jskos
8+
89
URL = "https://skohub.io/KDSF-FFK/kdsf-ffk/heads/main/w3id.org/kdsf-ffk/index.json"
910

1011

@@ -13,9 +14,11 @@ class TestJSKOS(unittest.TestCase):
1314

1415
def test_jskos(self) -> None:
1516
"""Test JSKOS."""
16-
converter = curies.Converter.from_prefix_map({
17-
"ksdf.fkk": "https://w3id.org/kdsf-ffk/",
18-
})
17+
converter = curies.Converter.from_prefix_map(
18+
{
19+
"ksdf.fkk": "https://w3id.org/kdsf-ffk/",
20+
}
21+
)
1922
ontology = read_jskos(prefix="ksdf.fkk", path=URL, converter=converter)
2023
names = ontology.get_id_name_mapping()
2124
self.assertIn("ArbeitUndWirtschaft", names)

0 commit comments

Comments
 (0)