query-d6229d30685c57ca113dd8811502716f

rq turtle/ttl

Chidgk1Pxxxcolumns}}Wikidata list{{?fieldname

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 prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?inception ?owner
WHERE
{
  ?item wdt:P31 / wdt:P279 * wd:Q6558431 . # ?item is a coal-fired powerplant
  ?item wdt:P17 wd:Q43 . # ?item is in Turkey

  # inception
  OPTIONAL
  {
    ?item p:P571 ?inception_statement .
    ?inception_statement ps:P571 ?inception .
    ?inception_statement a wikibase:BestRank .
    ?inception_statement prov:wasDerivedFrom ?inception_reference .
    FILTER NOT EXISTS { ?inception_reference pr:P143 [] . } # Exclude "Imported from" references
  }

  # owner
  OPTIONAL
  {
    ?item p:P127 ?owner_statement .
    ?owner_statement ps:P127 ?owner .
    ?owner_statement a wikibase:BestRank .
    ?owner_statement prov:wasDerivedFrom ?owner_reference .
    FILTER NOT EXISTS { ?owner_reference pr:P143 [] . } # Exclude "Imported from" references
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?inception"):::projected v2("?inception_reference") v4("?inception_statement") v3("?item"):::projected v7("?owner"):::projected v1("?owner_reference") v6("?owner_statement") a2((" ")) a1((" ")) a3((" ")) c10(["wikibase:BestRank"]):::iri c6(["wd:Q43"]):::iri c4(["wd:Q6558431"]):::iri v3 --"p:direct/P31"--> a3 a3 --"p:direct/P279"--> c4 v3 --"p:direct/P17"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:P571".-> v4 v4 --"p:statement/P571"--> v5 v4 --"a"--> c10 v4 --"prov:wasDerivedFrom"--> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:P127".-> v6 v6 --"p:statement/P127"--> v7 v6 --"a"--> c10 v6 --"prov:wasDerivedFrom"--> v1 end