query-22251027e6f10f5957d9d7fc778b3bc8

rq turtle/ttl

.on Mastodon and on TwitterOriginally posted

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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide": ["?statueLocation"]}
SELECT DISTINCT ?statue ?statueLabel ?statueLocation ?statueImage ?person ?personLabel ?personDescription WHERE {
  ?statue wdt:P31/wdt:P279* wd:Q860861;
          wdt:P180|wdt:P547 ?person.
  OPTIONAL { ?statue wdt:P625 ?statueLocation. }
  OPTIONAL { ?statue wdt:P18 ?statueImage. }
  ?person wdt:P31 wd:Q5.
  {
    VALUES ?occupation { wd:Q10076267 wd:Q17769800 }
    ?person wdt:P106 ?occupation.
  } UNION {
    ?person wdt:P1830|^wdt:P127 ?slave.
    ?slave wdt:P31 wd:Q5;
           p:P3716/ps:P3716 wd:Q12773225.
  }
  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; v5("?occupation") v2("?person"):::projected v6("?slave") v1("?statue"):::projected v4("?statueImage"):::projected v3("?statueLocation"):::projected a1((" ")) a2((" ")) c14(["wd:Q12773225"]):::iri c16(["bd:serviceParam"]):::iri c8(["wd:Q5"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q860861"]):::iri v1 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P547"--> v2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P180"--> v2 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P625".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P18".-> v4 end v2 --"p:direct/P31"--> c8 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; v6 --"p:direct/P127"--> v2 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P1830"--> v6 end union2r <== or ==> union2l end v6 --"p:direct/P31"--> c8 v6 --"p:P3716"--> a2 a2 --"p:statement/P3716"--> c14 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; bind0[/VALUES ?occupation/] bind0-->v5 bind00(["wd:Q10076267"]) bind00 --> bind0 bind01(["wd:Q17769800"]) bind01 --> bind0 v2 --"p:direct/P106"--> v5 end union1r <== or ==> union1l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end