Skip to content

Commit 793e73c

Browse files
committed
Reorg
1 parent ba9149d commit 793e73c

3 files changed

Lines changed: 22 additions & 9 deletions

File tree

src/pyobo/struct/jskos/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""JSKOS."""
2+
3+
from .reader import read_jskos
4+
5+
__all__ = [
6+
"read_jskos",
7+
]

src/pyobo/struct/jskos/demo.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Demo JSKOS."""
2+
3+
from pyobo.struct.jskos import read_jskos
4+
from tqdm import tqdm
5+
6+
7+
def _demo() -> None:
8+
url = "https://oer-repo.uibk.ac.at/w3id.org/vocabs/oefos2012/schema.json"
9+
o = read_jskos(url, prefix="oefos")
10+
tqdm.write(str(o))
11+
12+
13+
if __name__ == "__main__":
14+
_demo()
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import curies
88
import jskos
99
from jskos import ProcessedConcept, ProcessedKOS
10-
from tqdm import tqdm
1110

1211
from pyobo.struct import Obo, build_ontology
12+
from ...identifier_utils import get_converter
1313

1414
__all__ = [
1515
"from_pkos",
@@ -20,8 +20,6 @@
2020
def read_jskos(path: str | Path, *, prefix: str, converter: curies.Converter | None = None) -> Obo:
2121
"""Read JSKOS into an ontology."""
2222
if converter is None:
23-
from ..identifier_utils import get_converter
24-
2523
converter = get_converter()
2624
pkos = jskos.read(path).process(converter)
2725
return from_pkos(prefix=prefix, pkos=pkos)
@@ -47,9 +45,3 @@ def _iterate_concepts_inner(concept: ProcessedConcept):
4745
yield from _iterate_concepts_inner(broader)
4846
for _mapping in concept.mappings:
4947
raise NotImplementedError
50-
51-
52-
if __name__ == "__main__":
53-
url = "https://oer-repo.uibk.ac.at/w3id.org/vocabs/oefos2012/schema.json"
54-
o = read_jskos(url, prefix="oefos")
55-
tqdm.write(str(o))

0 commit comments

Comments
 (0)