sparqlunicorn / sparqlunicornGoesGIS

SPARQLing Unicorn QGIS Plugin (Documentation: https://sparqlunicorn.github.io/sparqlunicornGoesGIS/)
https://plugins.qgis.org/plugins/sparqlunicorn/
GNU General Public License v2.0
27 stars 6 forks source link

Error when adding endpoint #36

Closed MathiasVDA closed 11 months ago

MathiasVDA commented 1 year ago

Hello,

When adding a SPARQL endpoint with the following settings:

image

Endpoint: https://linked.ec-dataplatform.eu/sparql

All steps go through well and I get a success message at the end stating the properties of the endpoint. But when I click 'Yes' to add the endpoint, then I receive the following error:

An error has occurred while executing Python code: 

TypeError: Object of type set is not JSON serializable 
Traceback (most recent call last):
  File "C:\Users/VBP8501/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\sparqlunicorn\tasks\query\detecttriplestoretask.py", line 80, in finished
    f.write(json.dumps(self.triplestoreconf, indent=2))
  File "C:\OSGeo4W\apps\Python39\lib\json\__init__.py", line 234, in dumps
    return cls(
  File "C:\OSGeo4W\apps\Python39\lib\json\encoder.py", line 201, in encode
    chunks = list(chunks)
  File "C:\OSGeo4W\apps\Python39\lib\json\encoder.py", line 429, in _iterencode
    yield from _iterencode_list(o, _current_indent_level)
  File "C:\OSGeo4W\apps\Python39\lib\json\encoder.py", line 325, in _iterencode_list
    yield from chunks
  File "C:\OSGeo4W\apps\Python39\lib\json\encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "C:\OSGeo4W\apps\Python39\lib\json\encoder.py", line 438, in _iterencode
    o = _default(o)
  File "C:\OSGeo4W\apps\Python39\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type set is not JSON serializable

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] 
QGIS version: 3.30.3-'s-Hertogenbosch 's-Hertogenbosch, 2411cec1 

Python Path:
C:\Users\VBP8501\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\sparqlunicorn\dependencies
C:/OSGeo4W/apps/qgis/./python
C:/Users/VBP8501/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/VBP8501/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis/./python/plugins
C:\OSGeo4W\apps\grass\grass82\etc\python
C:\Users\VBP8501\Documents
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:\OSGeo4W\apps\Python39\lib\site-packages\win32
C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin
C:/Users/VBP8501/AppData/Roaming/QGIS/QGIS3\profiles\default/python

This happens when the "add endpoint permanently" option is selected. When it isn't, the error doesn't occur. Afterwards, the endpoint seems to have been added to the list but when I restart QGIS, the endpoint is no longer in the list. I assume something is wrong when trying to permanently save the endpoint.

situx commented 1 year ago

Hi! Thanks for the hint. The bug is fixed with this commit https://github.com/sparqlunicorn/sparqlunicornGoesGIS/commit/6510f0e8bcce302c564448de6985539d26fcae6a and will be part of the next release.

MathiasVDA commented 1 year ago

Great, thanks!

situx commented 11 months ago

Solved in version 0.16, closing here