query-6627e359e68714b255faa072a6d5587a

rq turtle/ttl

Propertiesculture (P2596)country of citizenship (P27)instance of (P31)residence (P551)name in native language (P1559)

Use at

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 ?name WHERE {
{?person wdt:P2596 wd:Q11772} # 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
?person wdt:P1559 ?name;
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 v3("?name"):::projected v2("?person"):::projected a1((" ")) a2((" ")) c3(["wd:Q11772"]):::iri c6(["wd:Q148837"]):::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"--> c6 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P27"--> a1 a1 --"wdt:P31"--> c6 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P2596"--> c3 end union0r <== or ==> union0l end v2 --"wdt:P1559"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."rdfs:label".-> v1 end