query-644f027ddd7c25d65d9b817aae3b9abb

rq turtle/ttl

yields 114,0000000123530985 ... 192,0000000072462811 20,0000000122989524 206,0000000078496895 207,000000012102267X 21,0000000122934507 212,0000000123587973 ... 101942,0000000039979739 24427278,0000000116205025 991,0000000121462392 15:42, 9 August 2017 (UTC) 77.179.20.183, thanks a lot. I tested, and ORDER BY has an effect, and for the first items displayed it even had a reproducible order. Thanks for the BIND statement, works fineMatěj Suchánek 16:40, 9 August 2017 (UTC)) talk (Matěj Suchánek. BIND( xsd:integer( STRAFTER( STR( ?item ), STR( wd:Q ) ) ) AS ?qid ) is unstable, the order is arbitrary but different. Anyway, use (Q181593)sorting algorithm How do you know it has no effect? If a 16:31, 9 August 2017 (UTC) 77.179.20.183, so one can add statements to Wikidata SPARQL service that have no effect without getting a warning or an error? Users might trust that their ORDER BY statements work by string sort, since the CSV download gives strings. Apart from that, how can one numerically sort by QID? Matěj Suchánek 16:17, 9 August 2017 (UTC)) talk (Matěj Suchánek. undefinedActually, the ordering does not work and the order is completely random since you are ordering bounds with "wd:" predicates which is 16:01, 9 August 2017 (UTC) 77.179.20.183, how is order Q192 , Q20, Q101942 normal string ordering? ArthurPSmith 15:52, 9 August 2017 (UTC)) talk (ArthurPSmithThat's not what it yields, it yields a list of URI's (?item is a URI) which are ordered in normal string ordering. If you want numeric ordering you need to bind another variable that is just the numeric part of the id, and sort on that.

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?qid ?isni
WHERE 
{
  BIND( xsd:integer( STRAFTER( STR( ?item ), STR( wd:Q ) ) ) AS ?qid )
  ?item wdt:P213 ?isni
}
ORDER BY ?qid

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?isni"):::projected v2("?item") v2("?qid"):::projected bind0[/"http://www.w3.org/2001/XMLSchema#integer(substring-after(str(?item),str('wd:Q')))"/] v2 --o bind0 bind0 --as--o v2 v2 --"wdt:P213"--> v3