Hello,
Thank you for your support.
The screenshot has not been attached to my email. Sorry for this.
It seems that using group_concat and group_by is a good workaround to
resolve the issue.
SELECT ?pl (group_concat(distinct ?al; separator=', ') AS ?labels )
> WHERE {
> [...]
> }
> GROUP BY ?pl
>
Have a good day,
Regards,
Brice
2018-02-20 15:21 GMT+01:00 Paul Tyson <[email protected]>:
> Data and query samples would help. (I could not see the image.)
>
> But from your problem description, you might try GROUP BY and the
> GROUP_CONCAT aggregate function. This would put (for example) all the
> properties of a subject in one result field, separated by the delimiter
> of your choice.
>
> See the discussion of aggregates in SPARQL at
> https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#aggregates
>
> Regards,
> --Paul
>
> On Tue, 2018-02-20 at 13:39 +0100, Brice Sommacal wrote:
> > Hi dear jena users,
> >
> >
> > Here is a question regarding how to output a SPARQL result set into a
> > Google SpreadSheet with a concatenation mode.
> >
> >
> > We have been using a SPARQL RESULT set in order to feed a google
> > spreadsheet.
> > The result is below. There is nothing new, we get one line result for
> > each match found in our Jena Model.
> >
> >
> > Images intégrées 1
> >
> >
> >
> > However, we would like to get concatenated values for equivalent
> > rows.
> > As you can see from row 1 to 5 in SPARQL QUERY RESULT, we have found 2
> > results for Apple. 2 for Microsoft and 1 for John Doe. All these line
> > have one common value: "Entité morale réalisant des activités" (eg.
> > column in midle side, column 3).
> > From EXPECTED RESULT, row 1, these values have been concatenated with
> > respect to the unicity of the value "Entité morale réalisant des
> > activités".
> >
> >
> > Some times ago, I have been able to restitute this exact use case by
> > developping a specific API going through the result set and outputing
> > it in a tabular file. However, I would like to keep best practices in
> > place, and I wonder if there is a new way to resolve this using
> > SPARQL.
> >
> >
> > I was thinking of using SPARQL SUB SELECT, but last time I have been
> > using string methods, I haven't get what I wanted. Do you have an
> > example showing how to achieve this results?
> > I may be missing others solutions empowered by JENA and ARQ. Any
> > others ways to resolve this will be considered.
> >
> >
> >
> >
> > Your insights and helps would be very much appreciated.
> > With best regards,
> >
> >
> >
> >
> > Brice
> >
>
>
>