-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GROUP_CONCAT with OPTIONAL returns 'None' #1467
Comments
@KonradHoeffner could you give some more detail on this? What was the actual graph you were querying or were you using a remote store? |
I am using the default graph with a remote SPARQL endpoint. Here is a complete minimal example of the problem: RDFLib Example Codeimport rdflib
g = rdflib.Graph()
qres = g.query(
"""
PREFIX dce: <http://purl.org/dc/elements/1.1/>
PREFIX hito: <http://hitontology.eu/ontology/>
SELECT ?classified (GROUP_CONCAT(DISTINCT(STR(?dce_source));separator="|") AS ?dce_sources)
{
SERVICE <https://hitontology.eu/sparql>
{
?classified a hito:FeatureClassified.
OPTIONAL {?classified dce:source ?dce_source.}
}
}
LIMIT 3
"""
)
for row in qres:
print(row) RDFLib Output
Manual Query on https://hitontology.eu/sparqlPREFIX dce: <http://purl.org/dc/elements/1.1/>
PREFIX hito: <http://hitontology.eu/ontology/>
SELECT ?classified (GROUP_CONCAT(DISTINCT(STR(?dce_source));separator="|") AS ?dce_sources)
{
?classified a hito:FeatureClassified.
OPTIONAL {?classified dce:source ?dce_source.}
}
LIMIT 3 Manual Query ResultComparisonRDFLib generates "None|None|None|..." but Virtuoso SPARQL generates an empty string as intended. |
Thanks a bunch for the detailed info, very helpful, will see what I can do about it. |
fwiw, adding a |
I can more or less reproduce this, but should |
A query such as the following on https://hitontology.eu/sparql returns empty strings for nonexisting GROUP_CONCAT results using Virtuoso:
However when querying an RDFLib graph, I get
rdflib.term.Literal('None')
values in my result set. Is that intended?The text was updated successfully, but these errors were encountered: