1

Is it possible to sort the items being grouped using group_concat in SPARQL? I have read that this works in SQL, but dunno about SPARQL. Thanks!

posfan12
  • 2,541
  • 8
  • 35
  • 57
  • 1
    I don't think so,`GROUP_CONCAT` is a so-called *set function* whose arguments are multisets. – UninformedUser Oct 27 '17 at 19:58
  • That seems like a strange limitation from a practical point of view. Is there an alternate way to achieve the same thing? – posfan12 Oct 27 '17 at 21:02
  • 2
    The standard doesn't provide this, but putting the query pattern in a sub query that's sorted, and then grouping in the outer query will work in some implementations, but it's not guaranteed. – Joshua Taylor Oct 28 '17 at 20:42
  • 2
    Have a look at https://lists.w3.org/Archives/Public/public-sparql-dev/2011AprJun/0005.html – Joshua Taylor Oct 28 '17 at 21:38
  • 1
    This is being considered as part of the [SPARQL 1.2 effort](https://github.com/w3c/sparql-12/issues/9). – TallTed Oct 04 '19 at 19:31

0 Answers0