This will return unique values for name_1156_20_group_concat, e.g. 8 concat strings in row 1. However, if I simply use
\n(GROUP_CONCAT(?name_1156_20; SEPARATOR = \",\") AS ?name_1156_20_group_concat)
It will only use distinct strings, e.g. only two for row 1.
\nSimple question: Why does GROUP_CONCAT always uses DISTINCT? It doesn't matter if I use GROUP_CONCAT(DISTINCT ?name_1156_20; SEPARATOR = \",\")
or GROUP_CONCAT(?name_1156_20; SEPARATOR = \",\")
. I had expected a different behavior from specs:
\n","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"All aggregates may have the DISTINCT keyword as the first token in their argument list. If this keyword is present then first argument to func is Distinct(M).
\n
Should be fixed in v0.4.9
","upvoteCount":0,"url":"https://github.com/oxigraph/oxigraph/discussions/1205#discussioncomment-12441905"}}}-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX g17: <https://g17.dhi-roma.it/resources/>
PREFIX grace: <https://g17.dhi-roma.it/ontology/>
SELECT ?DIOCESE_1 ?DIOCESE_1_label ?PLACE_1 ?PLACE_1_label (COUNT(DISTINCT ?EVENT_7) AS ?EVENT_7_count)
(GROUP_CONCAT(
CONCAT(?name_1156_20, "_", STR(?EVENT_7))
; SEPARATOR = ","
) AS ?name_1156_20_group_concat)
WHERE {
?DIOCESE_1 rdf:type grace:diocese;
grace:called ?DIOCESE_1_label;
grace:primary_place ?PLACE_1.
?PLACE_1 rdf:type grace:place;
grace:called ?PLACE_1_label;
(grace:falls_within+) g17:place_719.
?DIOCESE_1 (^grace:pertains_to/(grace:object_related_to_object*)) ?BENEFICE_5.
?BENEFICE_5 rdf:type grace:benefice;
((grace:event_object*)|^(grace:object_object*)) ?EVENT_7.
?EVENT_7 rdf:type grace:event;
grace:called ?EVENT_7_label;
grace:refers_to ?TYPE_18.
?TYPE_18 rdf:type grace:type;
grace:called ?name_1156_20.
?DIOCESE_1 grace:place_object ?INSTITUTION_TERRITORY_16.
?INSTITUTION_TERRITORY_16 rdf:type grace:institution_territory.
}
GROUP BY ?DIOCESE_1 ?DIOCESE_1_label ?PLACE_1 ?PLACE_1_label
LIMIT 10000 This will return unique values for name_1156_20_group_concat, e.g. 8 concat strings in row 1. However, if I simply use
It will only use distinct strings, e.g. only two for row 1. Simple question: Why does GROUP_CONCAT always uses DISTINCT? It doesn't matter if I use
|
Beta Was this translation helpful? Give feedback.
-
Thanks for this great bug report. The issue is not with SELECT (GROUP_CONCAT(?v) AS ?c) WHERE {
VALUES ?v { "a" "a" }
} but with the SELECT (GROUP_CONCAT(?v; SEPARATOR = ",") AS ?c) WHERE {
VALUES ?v { "a" "a" }
} Fix: #1207 |
Beta Was this translation helpful? Give feedback.
Should be fixed in v0.4.9