query-40cfbaeafb23af2187bd37469864b6e1
PropertiesPM20 geo code (P8483)series ordinal (P1545)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select distinct ?geoCode ?item ?itemLabel ?pm20Category
where {
?item wdt:P8483 ?geoCode .
# extend for sorting
?item p:P8483 ?statement .
?statement ps:P8483 ?geoCode ;
pq:P1545 ?sortCode .
# construct URI for category page access
bind(uri(concat('https://pm20.zbw.eu/category/geo/s/', ?geoCode)) as ?pm20Category)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
order by ?sortCode
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?geoCode"):::projected
v2("?item"):::projected
v5("?pm20Category"):::projected
v1("?sortCode")
v4("?statement")
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
v2 --"p:direct/P8483"--> v3
v2 --"p:P8483"--> v4
v4 --"p:statement/P8483"--> v3
v4 --"p:qualifier/P1545"--> v1
bind0[/"concat('https://pm20.zbw.eu/category/geo/s/',?geoCode)"/]
v3 --o bind0
bind0 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end