query-cd7af4edc3f34b76db7abebcb7f13ec6
Split a query output into two or more listsHi: We use this query to generate eswiki anexes: } .Q23712:wd P1435:wdt ?item .?cod_IAPH P8425:wdt ;Q82142:wd )*P131:wdt( ?item { WHERE ?cod_IAPH ?item DISTINCT SELECTFor technical limitations we need to limit the number of the listed elements to some number. I would like to split this query in two: the first, say, 500 elements and the second query listing the next 500 elements. Any help? 18:44, 4 July 2021 (UTC)) talk (Olea--You need to sort it by some value and then you can use offset and limit, e.g.
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?item ?cod_IAPH
WHERE
{
?item (wdt:P131*) wd:Q82142;
wdt:P8425 ?cod_IAPH.
?item wdt:P1435 wd:Q23712.
}
ORDER BY ?cod_IAPH
OFFSET 500 LIMIT 500
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?cod_IAPH"):::projected
v2("?item"):::projected
c2(["wd:Q82142"]):::iri
c5(["wd:Q23712"]):::iri
v2 --"wdt:P131"--> c2
v2 --"wdt:P8425"--> v1
v2 --"wdt:P1435"--> c5