query-80497cad8d35523bb76d0e659243edde

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
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 ?name ?nameLabel ?nameLang ?nameLangLabel WHERE {
    {?item wdt:P27 wd:Q28} UNION {?item wdt:P27 wd:Q171150}  UNION {?item wdt:P27 wd:Q655621} . 
    ?item wdt:P31 wd:Q5 .
    ?item p:P735 ?nameStatement .
    ?nameStatement ps:P735 ?name .
    ?nameStatement pq:P407 ?nameLang .
    FILTER(COALESCE(?nameLang, wd:Q9067) != wd:Q9067) .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item") v4("?name"):::projected v1("?nameLang"):::projected v3("?nameStatement") c4(["wd:Q171150"]):::iri c3(["wd:Q28"]):::iri c5(["wd:Q655621"]):::iri c12(["bd:serviceParam"]):::iri c7(["wd:Q5"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?nameLang'wd:Q9067' != 'wd:Q9067'"]] f0 --> v1 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 --"p:direct/P27"--> c5 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P27"--> c4 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P27"--> c3 end union0r <== or ==> union0l end v2 --"p:direct/P31"--> c7 v2 --"p:P735"--> v3 v3 --"p:statement/P735"--> v4 v3 --"p:qualifier/P407"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end