sparqlgpviz icon indicating copy to clipboard operation
sparqlgpviz copied to clipboard

Problem using queries containing FILTER

Open polnischfrosch opened this issue 1 year ago • 1 comments

Hey,

I got your tool working with some very basic queries, I am running in some issues using queries containing the FILTER function. This might also come down to the package versions I am using, maybe you can provide some insight what versions I should be using for best compatibility. I am using the newest version of rdflib based on running into issues using 4.2.2 as in the Issue pointed out by Samuel

Python 3.7.16

Package            Version
------------------ ---------
certifi            2023.7.22
graphviz           0.20.1
importlib-metadata 4.13.0
isodate            0.6.1
pip                22.3.1
pygraphviz         1.7
pyparsing          3.1.1
rdflib             6.3.2
setuptools         65.6.3
six                1.16.0
typing_extensions  4.7.1
wheel              0.38.4
wincertstore       0.2
zipp               3.15.0

Using the following command in my anaconda environment:

python sparqlgraphviz.py -i query.rq

with query.rq being the following query

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?countryName
WHERE {
  ?country a dbo:Country ;
           rdfs:label ?countryName .
  FILTER (LANG(?countryName) = "en") # Filter to get English labels only
  FILTER (CONTAINS(?countryName, "land")) # Filter to get names that contain 'land'
}

Files Used.zip

This is the output:

query

And getting the following errors:

(sparqlgpviz) PS C:\Users\Aaron\Documents\GitHub\sparqlgpviz> python sparqlgraphviz.py -i query.rq
opening query.rq...
C:\Users\Aaron\anaconda3\envs\sparqlgpviz\lib\site-packages\pygraphviz\agraph.py:1390: RuntimeWarning: Warning: Could not load "C:\Users\Aaron\anaconda3\envs\sparqlgpviz\Library\bin\gvplugin_pango.dll" - It was found, so perhaps one of its dependents was not.  Try ldd.

  warnings.warn(b"".join(errors).decode(self.encoding), RuntimeWarning)
writing query.png...
C:\Users\Aaron\anaconda3\envs\sparqlgpviz\lib\site-packages\pygraphviz\agraph.py:1390: RuntimeWarning: Warning: Could not load "C:\Users\Aaron\anaconda3\envs\sparqlgpviz\Library\bin\gvplugin_pango.dll" - It was found, so perhaps one of its dependents was not.  Try ldd.
Warning: Could not load "C:\Users\Aaron\anaconda3\envs\sparqlgpviz\Library\bin\gvplugin_pango.dll" - It was found, so perhaps one of its dependents was not.  Try ldd.
Warning: Could not load "C:\Users\Aaron\anaconda3\envs\sparqlgpviz\Library\bin\gvplugin_pango.dll" - It was found, so perhaps one of its dependents was not.  Try ldd.
Warning: Could not load "C:\Users\Aaron\anaconda3\envs\sparqlgpviz\Library\bin\gvplugin_pango.dll" - It was found, so perhaps one of its dependents was not.  Try ldd.
Warning: Could not load "C:\Users\Aaron\anaconda3\envs\sparqlgpviz\Library\bin\gvplugin_pango.dll" - It was found, so perhaps one of its dependents was not.  Try ldd.

  warnings.warn(b"".join(errors).decode(self.encoding), RuntimeWarning)

Let me know what you think,

Cheers, Aaron

polnischfrosch avatar Aug 15 '23 17:08 polnischfrosch

Hi, this might be an issue from pygraphviz (esp. in Windows). try to use --dot parameter to produce the dot file and try running separately with graphviz

pebbie avatar Sep 30 '23 17:09 pebbie