query-0f3205d6713726c4926447088b1804a7

rq turtle/ttl

Here is code to insert thousand separators in positive integers with up to 15 digits (e.g. population numbers). It could be expanded to decimal numbers, negative numbers or more digits, but I will leave that as an exercise for interested persons. I don't really recommend using this code. 12:23, 16 March 2020 (UTC)) talk (Dipsacus fullonumI think it is possible to do it in SPARQL but I think it is better to do complicated formatting of data like this with other tools after retrival as WDQS is a limited resource. But I wonder which SPARQL functions you are missing. I have never experienced correct SPARQL code not working (expect for timeouts) at WDQS. -- 10:30, 16 March 2020 (UTC)) talk (Tomastvivlaren: for a professional solution. Nowadays when the listeria bot allows several SPARQL variables in the template, not only ?item, it should also be possible to output numbers formatted as strings using SPARQL code, but I have not succeeded yet. Neither the Query service, nor listeria, seems to allow all functions mentioned in the SPARQL documentation. TweetsFactsAndQueriesThankyou @:Tomastvivlaren@

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT * { wd:Q2 wdt:P1082 ?p . BIND( CONCAT("{","{formatnum:",str(?p),"}","}") as ?pop)  }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?p"):::projected v2("?pop"):::projected c1(["wd:Q2"]):::iri c1 --"wdt:P1082"--> v1 bind0[/"concat('{','{formatnum:',str(?p),'}','}')"/] v1 --o bind0 bind0 --as--o v2