Replies: 6 comments 5 replies
-
|
Hi, |
Beta Was this translation helpful? Give feedback.
-
|
Good news: the issue with literals has meanwhile been fixed in QLever. However, its behaviour is still different from other SPARQL-implementations — e.g. the one used by Wikidata. Specifically, when an IRI appears in the list for GROUP_CONCAT, other implementations return the literal string value of the IRI (i.e. the result of STR(<...>)), but QLever returns an empty string. For illustration: consider this query with an IRI in the list passed to PREFIX wd: <http://www.wikidata.org/entity/>
SELECT (GROUP_CONCAT(STR(?x); separator=", ") AS ?vals) WHERE {
VALUES ?x { wd:Q42 "b" "c"}
}
Things work as expected by explicitly calling PREFIX wd: <http://www.wikidata.org/entity/>
SELECT (GROUP_CONCAT(STR(?x); separator=", ") AS ?vals) WHERE {
VALUES ?x { wd:Q42 "b" "c"}
} |
Beta Was this translation helpful? Give feedback.
-
|
@retog Your two queries look identical, did you mean to omit the |
Beta Was this translation helpful? Give feedback.
-
|
@joka921 @RobinTF I just checked the reference engine, and there should indeed be an automatic conversion of IRIs to strings. This should be easy to fix, right? $ cat one-triple.ttl
@prefix ex: <http://example.org/> .
ex:s ex:p ex:o .
$ bin/sparql --engine ref --data one-triple.ttl --query <(echo 'PREFIX ex: <http://example.org/> SELECT (GROUP_CONCAT(?x; separator=", ") AS ?concat) WHERE { VALUES ?x { ex:a 42 } }')
------------------------------
| concat |
==============================
| "http://example.org/a, 42" |
------------------------------ |
Beta Was this translation helpful? Give feedback.
-
|
@RobinTF I think you misunderstood. The engine behind https://sparql.org/query-validator.html is not a reference engine. But And yes, you are right regarding |
Beta Was this translation helpful? Give feedback.
-
|
@RobinTF Good point, I also don't see a hint in the standard why |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
From the definition of GroupConcat I would assume that the inputs of the function are converted to strings and the output is the concatenation of the strings to one string.
For example for the following query
I would assume the result
"a.b.c"(order of strings not important) as stated by the definition. The wikidata wndpoint does return this result but QLever returns"a"."b"."c".If a language tag is added e.g.
@enthe QLever result becomes"a"@en."b"@en."c"@enwhereas the wikidata endpoint returnsa.b.cSince GROUP_CONCAT is specified as string concatenation I would expect that the quotes of a single value are not included in the concat result so that the concatenation result only contains the values separated by the defined separator.
Beta Was this translation helpful? Give feedback.
All reactions