I have more records of the same subject and predicate, but different object, like:
Alex hasFriend A
Alex hasFriend B
Alex hasFriend C
Alex hasFriend D
How could I query the data to get the result with comma separated values, like:
Alex hasFriend A, B, C, D
The SPARQL query is like this:
select distinct ?person ?friend where {
?person <http://www.example.com/hasFriend> ?friend.
}