query-61bd51afd742ac58a72900cd83caa464
Propertiesinstance of (P31)PM20 subject code (P8484)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 wd: <http://www.wikidata.org/entity/>
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 ?item ?subjectCode ?itemLabel ?pm20Category
where {
?item wdt:P31 wd:Q92707903 ;
wdt:P8484 ?subjectCode .
# extend for sorting
?item p:P8484 ?statement .
?statement ps:P8484 ?subjectCode ;
pq:P1545 ?sortCode .
# construct URI for category page access
bind(uri(concat('https://pm20.zbw.eu/category/subject/s/', ?subjectCode)) 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;
v2("?item"):::projected
v5("?pm20Category"):::projected
v1("?sortCode")
v4("?statement")
v3("?subjectCode"):::projected
c2(["wd:Q92707903"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["en"]):::literal
v2 --"p:direct/P31"--> c2
v2 --"p:direct/P8484"--> v3
v2 --"p:P8484"--> v4
v4 --"p:statement/P8484"--> v3
v4 --"p:qualifier/P1545"--> v1
bind0[/"concat('https://pm20.zbw.eu/category/subject/s/',?subjectCode)"/]
v3 --o bind0
bind0 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end