query-7006d216b66d7b0d6f67aaf651f4c016

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?spouse1 ?spouse1Label ?spouse2 ?spouse2Label
WHERE
{
  ?spouse1 wdt:P8286 [].
  ?spouse2 wdt:P8286 [].
  ?spouse1 p:P26/ps:P26 ?item.
  ?spouse2 p:P26/ps:P26 ?item.
  FILTER(str(?spouse1) < str(?spouse2))
  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; v3("?item"):::projected v1("?spouse1"):::projected v2("?spouse2"):::projected a1((" ")) a2((" ")) a3((" ")) a4((" ")) c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["str(?spouse1) < str(?spouse2)"]] f0 --> v1 f0 --> v2 v1 --"p:direct/P8286"--> a1 v2 --"p:direct/P8286"--> a2 v1 --"p:P26"--> a3 a3 --"p:statement/P26"--> v3 v2 --"p:P26"--> a4 a4 --"p:statement/P26"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end