vliz-be-opsci / py-RDF-store

module to interact with a memory or uristore
0 stars 0 forks source link

memorystore fails on verify_max_age of named_graphs it does not yet know about with a KeyError #47

Closed cedricdcc closed 7 months ago

cedricdcc commented 7 months ago

When using the cli of pytravharv I ran into the following issue.

  File "C:\Users\cedric\Documents\GitHub\py-trav-harv\travharv\config_build.py", line 406, in _check_snooze
    return not self._rdf_store_access.verify_max_age_of_config(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\cedric\Documents\GitHub\py-trav-harv\travharv\store.py", line 146, in verify_max_age_of_config
    return self.verify_max_age(ng, age_minutes)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\cedric\AppData\Local\pypoetry\Cache\virtualenvs\pysyncfstriples-uCPLWiOR-py3.11\Lib\site-packages\pyrdfstore\store.py", line 89, in verify_max_age
    named_graph_lastmod = self.lastmod_ts(named_graph)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\cedric\AppData\Local\pypoetry\Cache\virtualenvs\pysyncfstriples-uCPLWiOR-py3.11\Lib\site-packages\pyrdfstore\store.py", line 360, in lastmod_ts
    return self._core.lastmod_ts(named_graph)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\cedric\AppData\Local\pypoetry\Cache\virtualenvs\pysyncfstriples-uCPLWiOR-py3.11\Lib\site-packages\pyrdfstore\store.py", line 325, in lastmod_ts
    return self._admin_registry[named_graph]
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'urn:traversal-harvesting:C%3A%5CUsers%5Ccedric%5CDocuments%5CGitHub%5Cpy-trav-harv%5C./tests/config/config_sparql_uri_string_fail.yml'
Error asserting path for subject: http://dev.marineinfo.org/id/collection/919****
marc-portier commented 7 months ago

I need more context or a test to understand the issue

marc-portier commented 7 months ago

it looks like the mentioned key does not yet exist in the memory_store

in that case, the verify_age should not fail but return false