query-cb301796f35099cbd2f0680dfa35129f
PropertiesPM20 geo code (P8483)instance of (P31)PM20 folder ID (P4293)facet of (P1269)main subject (P921)PM20 subject code (P8484)mapping relation type (P4390)number of works accessible online (P5592)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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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 ?docs ?viewer
where {
?country rdfs:label "Japan"@en ;
wdt:P8483 ?geoCode .
?item wdt:P31 wd:Q91257459 ;
wdt:P4293 ?folderId ;
wdt:P1269 ?country ;
wdt:P921 ?subjectCategory .
?subjectCategory wdt:P8484 ?subjectCode .
# restrict country to that with exact matching PM20 geo code
?country p:P8483 ?statement .
?statement ps:P8483 ?geoCode ;
pq:P4390 wd:Q39893449 .
# number of documents acessible online
?item p:P4293/pq:P5592 ?docs .
# construct URI for dfgviewer
bind(uri(concat('https://pm20.zbw.eu/dfgview/', ?folderId)) as ?viewer)
# obtain extended subjectCode (series ordial) from subjectCategory
# for correct sort order
?subjectCategory p:P8484/pq:P1545 ?sortCode .
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("?country")
v9("?docs"):::projected
v5("?folderId")
v3("?geoCode")
v4("?item"):::projected
v1("?sortCode")
v8("?statement")
v6("?subjectCategory")
v7("?subjectCode"):::projected
v10("?viewer"):::projected
a1((" "))
a2((" "))
c2([sJapan^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal
c21(["en"]):::literal
c5(["wd:Q91257459"]):::iri
c19(["bd:serviceParam"]):::iri
c13(["wd:Q39893449"]):::iri
v2 --"rdfs:label"--> c2
v2 --"p:direct/P8483"--> v3
v4 --"p:direct/P31"--> c5
v4 --"p:direct/P4293"--> v5
v4 --"p:direct/P1269"--> v2
v4 --"p:direct/P921"--> v6
v6 --"p:direct/P8484"--> v7
v2 --"p:P8483"--> v8
v8 --"p:statement/P8483"--> v3
v8 --"p:qualifier/P4390"--> c13
v4 --"p:P4293"--> a1
a1 --"p:qualifier/P5592"--> v9
bind0[/"concat('https://pm20.zbw.eu/dfgview/',?folderId)"/]
v5 --o bind0
bind0 --as--o v10
v6 --"p:P8484"--> a2
a2 --"p:qualifier/P1545"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c19 --"wikibase:language"--> c21
end