pymetadata 0.5.2__py3-none-any.whl → 0.5.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pymetadata might be problematic. Click here for more details.

pymetadata/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  from pathlib import Path
4
4
 
5
5
  __author__ = "Matthias Koenig"
6
- __version__ = "0.5.2"
6
+ __version__ = "0.5.3"
7
7
 
8
8
 
9
9
  program_name: str = "pymetadata"
@@ -9,7 +9,6 @@ from pymetadata.chebi import ChebiQuery
9
9
  pymetadata.CACHE_PATH = Path.home() / ".cache" / "pymetadata"
10
10
 
11
11
  if __name__ == "__main__":
12
-
13
12
  chebis = ["CHEBI:2668", "CHEBI:138366", "CHEBI:9637", "CHEBI:155897"]
14
13
  for chebi in chebis:
15
14
  d = ChebiQuery.query(chebi=chebi, cache=True)
@@ -19,7 +19,7 @@ import requests
19
19
  import pymetadata
20
20
  from pymetadata import log
21
21
  from pymetadata.cache import DataclassJSONEncoder, read_json_cache, write_json_cache
22
-
22
+ from pymetadata.console import console
23
23
 
24
24
  logger = log.get_logger(__name__)
25
25
 
@@ -123,14 +123,6 @@ def ols_namespaces() -> Dict[str, Namespace]:
123
123
 
124
124
  # Custom namespaces for OLS ontology, for simple support
125
125
  namespaces = [
126
- Namespace(
127
- id=None,
128
- prefix="snomed",
129
- pattern=r"^\d+$",
130
- name="SNOMED",
131
- description="SNOMED CT or SNOMED Clinical Terms is a systematically organized computer processable collection of medical terms providing codes, terms, synonyms and definitions used in clinical documentation and reporting.",
132
- namespaceEmbeddedInLui=True,
133
- ),
134
126
  Namespace(
135
127
  id=None,
136
128
  prefix="omim",
@@ -180,14 +172,6 @@ def ols_namespaces() -> Dict[str, Namespace]:
180
172
  description="OPMI: Ontology of Precision Medicine and Investigation",
181
173
  namespaceEmbeddedInLui=True,
182
174
  ),
183
- Namespace(
184
- id=None,
185
- prefix="mondo",
186
- pattern=r"^MONDO:\d+$",
187
- name="MONDO",
188
- description="MONDO",
189
- namespaceEmbeddedInLui=True,
190
- ),
191
175
  Namespace(
192
176
  id=None,
193
177
  prefix="atol",
@@ -237,6 +221,14 @@ def ols_namespaces() -> Dict[str, Namespace]:
237
221
  description="Measurement method ontology",
238
222
  namespaceEmbeddedInLui=True,
239
223
  ),
224
+ Namespace(
225
+ id=None,
226
+ prefix="symp",
227
+ pattern=r"^SYMP:\d+$",
228
+ name="Symptom ontology",
229
+ description="The Symptom Ontology has been developed as a standardized ontology for symptoms of human diseases.",
230
+ namespaceEmbeddedInLui=True,
231
+ ),
240
232
  ]
241
233
 
242
234
  for ns in namespaces:
@@ -344,21 +336,6 @@ class Registry:
344
336
  ns_dict = {}
345
337
  for _, data in enumerate(namespaces):
346
338
  ns = Namespace.from_dict(data)
347
-
348
- # bugfix OLS4 (https://github.com/identifiers-org/identifiers-org.github.io/issues/231)
349
- if ns.resources:
350
- for resource in ns.resources:
351
- if resource.urlPattern.startswith("https://www.ebi.ac.uk/ols/"):
352
- resource.urlPattern = resource.urlPattern.replace(
353
- "/ols/", "/ols4/"
354
- )
355
- if resource.resourceHomeUrl.startswith(
356
- "https://www.ebi.ac.uk/ols/"
357
- ):
358
- resource.resourceHomeUrl = resource.resourceHomeUrl.replace(
359
- "/ols/", "/ols4/"
360
- )
361
-
362
339
  ns_dict[ns.prefix] = ns
363
340
 
364
341
  if custom_namespaces is not None:
@@ -394,4 +371,5 @@ class Registry:
394
371
  REGISTRY = Registry()
395
372
 
396
373
  if __name__ == "__main__":
397
- registry = Registry()
374
+ registry = Registry(cache=False)
375
+ console.print(registry.ns_dict)