query-4f5f20b5e9c3097fe7e961b495258dd1

rq turtle/ttl

Controlling and ownerships in Denmark

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#>
#defaultView:Graph
# Controlling Denmark
SELECT ?controller ?controllerLabel ?controlled ?controlledLabel WHERE {
  {
    ?controller p:P39 ?position_statement.
    ?position_statement ps:P39 wd:Q2824523.
    ?position_statement pq:P642 ?controlled.
    ?controlled wdt:P17 wd:Q35.
  }
  UNION {
    ?controlled wdt:P3320|wdt:P127|wdt:P749|wdt:P1037|wdt:P169 ?controller.
    ?controlled wdt:P17 wd:Q35.
  }
  UNION {
    ?controller wdt:P1830|wdt:P355 ?controlled.  
    ?controlled wdt:P17 wd:Q35 
  }
  minus { ?controlled wdt:P570 ?date_of_death }
  OPTIONAL { ?controller wdt:P18 ?controller_image. }
  OPTIONAL { ?controlled wdt:P18 ?controlled_image. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?controlled"):::projected v6("?controlled_image") v1("?controller"):::projected v5("?controller_image") v4("?date_of_death") v2("?position_statement") c6(["wd:Q35"]):::iri c17(["bd:serviceParam"]):::iri c19(["da,en"]):::literal c3(["wd:Q2824523"]):::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; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P355"--> v3 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P1830"--> v3 end union2r <== or ==> union2l end v3 --"p:direct/P17"--> c6 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; subgraph union6[" Union "] subgraph union6l[" "] style union6l fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P169"--> v1 end subgraph union6r[" "] style union6r fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P1037"--> v1 end union6r <== or ==> union6l end end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P749"--> v1 end union5r <== or ==> union5l end end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P127"--> v1 end union4r <== or ==> union4l end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P3320"--> v1 end union3r <== or ==> union3l end v3 --"p:direct/P17"--> c6 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:P39"--> v2 v2 --"p:statement/P39"--> c3 v2 --"p:qualifier/P642"--> v3 v3 --"p:direct/P17"--> c6 end union0r <== or ==> union0l end subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v3 --"p:direct/P570"--> v4 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P18".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P18".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c17 --"wikibase:language"--> c19 end