query-bedb6d855de7bcf6e163511e2031e1b9

rq turtle/ttl

Levana Taylor

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 ?item ?label_en
WHERE
{
  { ?item wdt:P31 wd:Q101352 . }
  UNION
  { ?item wdt:P31 wd:Q202444 . }

  { ?item wdt:P407 wd:Q1860 . }
  UNION
  {
    ?item wdt:P1705 ?local_name .
    FILTER (LANG(?local_name) = "en")
  }

  FILTER NOT EXISTS { ?item wdt:P3880 [] . }

  OPTIONAL
  {
    ?item rdfs:label ?label_en .
    FILTER (LANG(?label_en) = "en")
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v2("?label_en"):::projected v3("?local_name") a1((" ")) c4(["wd:Q101352"]):::iri c5(["wd:Q202444"]):::iri c7(["wd:Q1860"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P3880"--> e0a1 e0v1("?item"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> a1 v1 --"wdt:P3880"--> a1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c4 end union0r <== or ==> union0l end subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; f1[["?local_name = 'en'"]] f1 --> v3 v1 --"wdt:P1705"--> v3 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P407"--> c7 end union1r <== or ==> union1l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."rdfs:label".-> v2 end