query-ca151aeca742536591deb10fd5759c80
09:16, 26 August 2024 (UTC)) talk (VicarageSPARQL doesn't support this. But if you have basic programming skills you can fix it by changing the downloaded data. You basically:Concatenate the array with your preferred separator an write the string back. Sort the array. In your script, split the string by the sentinel value to an array. In the query group_concat() by using a sentinel value that is unlikely to appear in your data, for example "##".12:29, 26 August 2024 (UTC)) talk (Vicarage sites use lots of mediawiki extensions which I've extended to make the whole setup really, really clever, and of course I can post-process the data, just hoping not to. expounder.infoWow, something simple SPARQL can't do!!! My 11:56, 26 August 2024 (UTC)) talk (Infrastruktur. MVC design patternThat will do it. I noticed you use Mediawiki on your site, that might be overkill if you don't need crowdsourcing. A LAMP stack with a framework that does caching (!), routing and templating will work just as well. After all getting data from a database endpoint is just a network request which fits nicely in a BTW, I know that wrapping the query in another select level can work
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?item (GROUP_CONCAT(DISTINCT ?keywordlist; SEPARATOR=", ") AS ?keywords)
WHERE {
{
SELECT DISTINCT ?item ?keywordlist WHERE {
VALUES ?item {wd:Q1180981 wd:Q950970 wd:Q2543161}.
{?item wdt:P31 ?k. ?k rdfs:label ?keywordlist. FILTER (LANG(?keywordlist) = "en")}
}
ORDER BY ?item ?keywordlist
}
}
GROUP BY ?item