query-6a689bde31ea4124c33de71c06c66677

rq turtle/ttl

Individuals connected (somehow) to objects in multiple Khalili Collections

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?i1 ?i1Label ?i2 ?i2Label ?topic ?topicLabel WHERE {
?i1 wdt:P195 ?coll1. ?coll1 wdt:P361 wd:Q63160499. # Object from Khalili Collections
?i2 wdt:P195 ?coll2. ?coll2 wdt:P361 wd:Q63160499. # Object from Khalili Collections
  FILTER (STR(?coll1) > STR(?coll2)) # Different collections
  ?i1 ?rel1 ?topic . ?topic wdt:P31 wd:Q5 . # Both connected to the same topic
  ?i2 ?rel2 ?topic .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?topicLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?coll1") v3("?coll2") v4("?i1"):::projected v5("?i2"):::projected v6("?rel1") v8("?rel2") v7("?topic"):::projected v1("?topicLabel"):::projected c7(["bd:serviceParam"]):::iri c5(["wd:Q5"]):::iri c3(["wd:Q63160499"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["str(?coll1) > str(?coll2)"]] f0 --> v2 f0 --> v3 v4 --"wdt:P195"--> v2 v2 --"wdt:P361"--> c3 v5 --"wdt:P195"--> v3 v3 --"wdt:P361"--> c3 v4 -->v6--> v7 v7 --"wdt:P31"--> c5 v5 -->v8--> v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end