query-3e8f1fc039dd577dbb7f597643939602
Propertiesfield of work (P101)country of citizenship (P27)subclass of (P279)instance of (P31)
Use at
- https://query.wikidata.org/sparql
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#>
SELECT ?person ?name ?field ?fieldname ?nationality WHERE {
?person wdt:P101 ?field; #?field = Q39680 for macroeconomics # Q39072 for microeconomics
wdt:P27 ?place .
?field wdt:P279+ wd:Q8134 .
?person rdfs:label ?name filter (lang(?name) = "en")
?place rdfs:label ?nationality filter (lang(?nationality) = "en")
?field rdfs:label ?fieldname filter (lang(?fieldname) = "en")
MINUS{ ?person wdt:P31/wdt:P279? wd:Q15632617 } # exclude fictional people
} ORDER BY ASC(?fieldname)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?field"):::projected
v1("?fieldname"):::projected
v3("?name"):::projected
v2("?nationality"):::projected
v4("?person"):::projected
v6("?place")
a1((" "))
c5(["wd:Q8134"]):::iri
c8(["wd:Q15632617"]):::iri
f0[["?fieldname = 'en'"]]
f0 --> v1
f1[["?nationality = 'en'"]]
f1 --> v2
f2[["?name = 'en'"]]
f2 --> v3
v4 --"wdt:P101"--> v5
v4 --"wdt:P27"--> v6
v5 --"wdt:P279"--> c5
v4 --"rdfs:label"--> v3
v6 --"rdfs:label"--> v2
v5 --"rdfs:label"--> v1
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
v4 --"wdt:P31"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P279"--> c8
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
end