query-9044bdc54fda328ba1a153b65d8ff12b
Propertiesculture (P2596)instance of (P31)country of citizenship (P27)residence (P551)
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 DISTINCT ?person ?en_name WHERE {
{?person wdt:P2596 wd:Q11772. ?person wdt:P31 wd:Q5 } # Person & Culture: Ancient Greece
UNION {?person wdt:P27/wdt:P31 wd:Q148837} # Citizen of a Polis
UNION {?person wdt:P551/wdt:P31 wd:Q148837 } # Resident of a Polis
OPTIONAL{ ?person rdfs:label ?en_name FILTER(lang(?en_name) = "en")}
} ORDER BY ?en_name
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?en_name"):::projected
v2("?person"):::projected
a1((" "))
a2((" "))
c3(["wd:Q11772"]):::iri
c7(["wd:Q148837"]):::iri
c5(["wd:Q5"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P551"--> a2
a2 --"wdt:P31"--> c7
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P27"--> a1
a1 --"wdt:P31"--> c7
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P2596"--> c3
v2 --"wdt:P31"--> c5
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."rdfs:label".-> v1
end