Behaviour of GROUP_CONCAT function

I do receive as result
:x :y “Belastingdienst” , “CBS” , “UWV”.

while I had expected
:x :y “Belastingdienst, CBS, UWV”

SELECT ?x  (GROUP_CONCAT(?y; separator=', ') as ?relatie)
WHERE 
{?x sc:eigenaar ?y.
?x sc:basisregistratie <http://data.stelselvanbasisregistraties.nl/overheid/id/basisregistratie/Polis>. }
GROUP BY ?x
    }

In the source
:x :y “Belastingdienst” ;
:y “CBS” ;
:y “UWV” ;

Hi Paul,

Your expectation is correct and corresponds to what I get from 5.0 pre-release:

pavel$ sd query test "select ?s (group_concat(?o;separator=', ') as ?r) where { ?s ?p ?o } group by ?s"
+-------+-----------------------------+
|   s   |              r              |
+-------+-----------------------------+
| urn:a | "Belastingdienst, CBS, UWV" |
| urn:b | "test"                      |
+-------+-----------------------------+

Data:

<urn:a> <urn:p1> "Belastingdienst" .
<urn:a> <urn:p2> "CBS" .
<urn:a> <urn:p3> "UWV" .
<urn:b> <urn:p1> "test" .

Which version do you use and how do you run the query?

Cheers,
Pavel

Hi Pavel,

With a SELECT I get:
Logius Stelselcatalogus - Linked Data | "Belastingdienst, CBS, UWV" |
| emievrijstelling_marginale_arbeid

With a DESCRIBE:
http://data.stelselvanbasisregistraties.nl/polis/id/gegevenselement/Indicatie_premievrijstelling_marginale_arbeid a sc:Gegevenselement ;
sc:eigenaar "Belastingdienst" , "CBS" , "UWV" ;

It is version 5RC that I'm using.

Paul

Hi Paul,

The DESCRIBE output is simply the short-hand Turtle serialization of three triples with the same subject and the same predicate which seems like the correct output. Are you getting that kind of output with GROUP_CONCAT function too?

Best,
Evren

My bad, apologies

The update action was not carried out:

PREFIX sc: <http://data.stelselvanbasisregistraties.nl/stelselcatalogus/def#>
DELETE {?x sc:eigenaar ?y.}
INSERT {?x sc:eigenaar ?relatie.}
WHERE 
{?x sc:eigenaar ?y.
?x sc:basisregistratie <http://data.stelselvanbasisregistraties.nl/overheid/id/basisregistratie/Polis>. 
{SELECT ?x  (GROUP_CONCAT(?y; separator=', ') as ?relatie)
WHERE 
{?x sc:eigenaar ?y.
?x sc:basisregistratie <http://data.stelselvanbasisregistraties.nl/overheid/id/basisregistratie/Polis>. }
GROUP BY ?x
    }}

Now I have
sc:eigenaar “Belastingdienst, CBS, UWV”

as expected.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.