query-4e2621506621af00d12f97307c401fad
Map of economists in PM20 by place of birth
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide":"?geo"}
select ?image ?item ?itemLabel ?pobLabel ?viewer ?geo
where {
?item wdt:P106 ?occupation ;
# with PM20 id
wdt:P4293 ?pm20Id ;
# with place of birth
wdt:P19 ?pob .
# occupation: economist or business economist
filter(?occupation in (wd:Q188094, wd:Q1860032))
# restrict to items with online accessible articles
?item p:P4293/pq:P5592 ?workCount .
filter(?workCount > 0)
# geo coordinates for pob
?pob wdt:P625 ?geo .
# optional image
optional { ?item wdt:P18 ?image . }
# viewer link
bind(substr(?pm20Id, 4, 4) as ?numStub)
bind(substr(?pm20Id, 4, 6) as ?num)
bind(uri(concat('http://dfg-viewer.de/show/?tx_dlf[id]=http://zbw.eu/beta/pm20mets/pe/', ?numStub, 'xx/', ?num, '.xml')) as ?viewer)
# add labels
service wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en, de, fr, es, nl, pl, ru". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?geo"):::projected
v7("?image"):::projected
v3("?item"):::projected
v9("?num")
v8("?numStub")
v2("?occupation")
v4("?pm20Id")
v5("?pob")
v10("?viewer"):::projected
v1("?workCount")
a1((" "))
c14(["#91;AUTO_LANGUAGE#93;,en, de, fr, es, nl, pl, ru"]):::literal
c12(["bd:serviceParam"]):::iri
f0[["?workCount > '0^^xsd:integer'"]]
f0 --> v1
list0c2(["wd:Q1860032"]):::iri
list0c1(["wd:Q188094"]):::iri
list0c1 --o f1
list0c2 --o f1
f1[[" in "]]
f1 --> v2
v3 --"p:direct/P106"--> v2
v3 --"p:direct/P4293"--> v4
v3 --"p:direct/P19"--> v5
v3 --"p:P4293"--> a1
a1 --"p:qualifier/P5592"--> v1
v5 --"p:direct/P625"--> v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P18".-> v7
end
bind2[/"substring(?pm20Id,'4^^xsd:integer','4^^xsd:integer')"/]
v4 --o bind2
bind2 --as--o v8
bind3[/"substring(?pm20Id,'4^^xsd:integer','6^^xsd:integer')"/]
v4 --o bind3
bind3 --as--o v9
bind4[/"concat('http://dfg-viewer.de/show/?tx_dlf#91;id#93;=http://zbw.eu/beta/pm20mets/pe/',?numStub,'xx/',?num,'.xml')"/]
v8 --o bind4
v9 --o bind4
bind4 --as--o v10
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end