ontolutils 0.4.0__tar.gz → 0.4.2__tar.gz
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.
- {ontolutils-0.4.0 → ontolutils-0.4.2}/PKG-INFO +1 -1
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/classes/thing.py +4 -1
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/utils/qudt_units.py +10 -3
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils.egg-info/PKG-INFO +1 -1
- {ontolutils-0.4.0 → ontolutils-0.4.2}/setup.cfg +1 -1
- {ontolutils-0.4.0 → ontolutils-0.4.2}/LICENSE +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/README.md +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/__init__.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/_version.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/cache.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/classes/__init__.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/classes/decorator.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/classes/query_util.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/classes/typing.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/classes/utils.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/__dev.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/__init__.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/_iana_utils.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/codemeta.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/m4i.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/obo.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/qudt_kind.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/qudt_unit.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/schema.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/namespacelib/ssno.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils/utils/__init__.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils.egg-info/SOURCES.txt +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils.egg-info/dependency_links.txt +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils.egg-info/requires.txt +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/ontolutils.egg-info/top_level.txt +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/pyproject.toml +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/setup.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/tests/test_classes.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/tests/test_decorator.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/tests/test_namespaces.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/tests/test_query.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/tests/test_readme.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/tests/test_typing.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/tests/test_utils.py +0 -0
- {ontolutils-0.4.0 → ontolutils-0.4.2}/tests/test_version.py +0 -0
|
@@ -347,7 +347,10 @@ class Thing(ThingModel):
|
|
|
347
347
|
|
|
348
348
|
def __repr__(self, limit: Optional[int] = None):
|
|
349
349
|
_fields = {k: getattr(self, k) for k in self.model_fields if getattr(self, k) is not None}
|
|
350
|
-
|
|
350
|
+
if self.model_extra:
|
|
351
|
+
repr_extra = ", ".join([f"{k}={v}" for k, v in {**_fields, **self.model_extra}.items()])
|
|
352
|
+
else:
|
|
353
|
+
repr_extra = ", ".join([f"{k}={v}" for k, v in {**_fields}.items()])
|
|
351
354
|
if limit is None or len(repr_extra) < limit:
|
|
352
355
|
return f"{self.__class__.__name__}({repr_extra})"
|
|
353
356
|
return f"{self.__class__.__name__}({repr_extra[0:limit]}...)"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import rdflib
|
|
2
2
|
|
|
3
3
|
from ontolutils import QUDT_UNIT
|
|
4
|
+
from typing import Optional
|
|
4
5
|
|
|
5
6
|
qudt_lookup = {
|
|
6
7
|
's': QUDT_UNIT.SEC, # time
|
|
@@ -61,7 +62,11 @@ qudt_lookup = {
|
|
|
61
62
|
'mm**3': QUDT_UNIT.MilliM3,
|
|
62
63
|
# volume flow rate
|
|
63
64
|
'm3/s': QUDT_UNIT.M3_PER_SEC,
|
|
65
|
+
'm^3/s': QUDT_UNIT.M3_PER_SEC,
|
|
64
66
|
'm3 s-1': QUDT_UNIT.M3_PER_SEC,
|
|
67
|
+
'm3 s^-1': QUDT_UNIT.M3_PER_SEC,
|
|
68
|
+
'm^3 s-1': QUDT_UNIT.M3_PER_SEC,
|
|
69
|
+
'm^3 s^-1': QUDT_UNIT.M3_PER_SEC,
|
|
65
70
|
'm3*s-1': QUDT_UNIT.M3_PER_SEC,
|
|
66
71
|
'm3*s^-1': QUDT_UNIT.M3_PER_SEC,
|
|
67
72
|
'm3*s**-1': QUDT_UNIT.M3_PER_SEC,
|
|
@@ -169,7 +174,7 @@ qudt_lookup = {
|
|
|
169
174
|
'mol': QUDT_UNIT.MOL,
|
|
170
175
|
'mol s-1': QUDT_UNIT.MOL_PER_SEC,
|
|
171
176
|
'mol m-2': QUDT_UNIT.MOL_PER_M2,
|
|
172
|
-
'g kg-1
|
|
177
|
+
'g kg-1': QUDT_UNIT.GM_PER_KiloGM,
|
|
173
178
|
'Pa m': QUDT_UNIT.PA_M,
|
|
174
179
|
'K m s-1': QUDT_UNIT.K_M_PER_SEC,
|
|
175
180
|
's-1 m-3': QUDT_UNIT.PER_M3_SEC,
|
|
@@ -214,7 +219,7 @@ qudt_lookup = {
|
|
|
214
219
|
}
|
|
215
220
|
|
|
216
221
|
|
|
217
|
-
def parse_unit(unit_str: str) -> rdflib.URIRef:
|
|
222
|
+
def parse_unit(unit_str: str) -> Optional[rdflib.URIRef]:
|
|
218
223
|
"""Return IRI for a unit str. E.g. 'm/s' returns QUDT_UNIT.M_PER_SEC.
|
|
219
224
|
|
|
220
225
|
Parameters
|
|
@@ -232,4 +237,6 @@ def parse_unit(unit_str: str) -> rdflib.URIRef:
|
|
|
232
237
|
KeyError
|
|
233
238
|
If the unit string is not in the lookup table
|
|
234
239
|
"""
|
|
235
|
-
|
|
240
|
+
if unit_str == '1e-3':
|
|
241
|
+
return qudt_lookup['dimensionless']
|
|
242
|
+
return qudt_lookup.get(unit_str, None)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|