SINTEF / dlite

DLite - a lightweight data-centric framework for semantic interoperability
https://SINTEF.github.io/dlite
MIT License
28 stars 5 forks source link

Tripper IRI error in Windows (for pint unit registry) #497

Open ajeklund opened 1 year ago

ajeklund commented 1 year ago

When using tripper on Windows 10 (but not Linux) to load the QUDT vocabulary in units.py, it returns a NoSuchIRIError.

The tested Windows Python version is 3.10.10. On Linux, Python version 3.10.6.

Output from test_units.py:

(units) c:\Users\<USER>\Documents\GitHub\dlite\bindings\python\triplestore>python test_units.py
C:\Users\<USER>\.venv\units\lib\site-packages\tripper\triplestore.py:97: UnusedArgumentWarning: base_iri
  self.backend = cls(base_iri=base_iri, database=database, **kwargs)
Traceback (most recent call last):
  File "c:\Users\<USER>\Documents\GitHub\dlite\bindings\python\triplestore\test_units.py", line 4, in <module>
    ureg = get_pint_registry(force_recreate=True)
  File "c:\Users\<USER>\Documents\GitHub\dlite\bindings\python\triplestore\units.py", line 87, in get_pint_registry
    pint_registry_lines = pint_registry_lines_from_qudt()
  File "c:\Users\<USER>\Documents\GitHub\dlite\bindings\python\triplestore\units.py", line 171, in pint_registry_lines_from_qudt
    for s, p, o in ts.triples([None, QUDT.hasDimensionVector, None]):
  File "C:\Users\<USER>\.venv\units\lib\site-packages\tripper\namespace.py", line 146, in __getattr__
    raise NoSuchIRIError(self._iri + name)
tripper.errors.NoSuchIRIError: http://qudt.org/schema/qudt/hasDimensionVector
jesper-friis commented 10 months ago

@ajeklund, this issue should be moved to tripper.