query-a6ad61a111687e56288105169ec2b30b

rq turtle/ttl

TODO

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 ?person ?personLabel ?spouse1 ?spouse1Label ?spouse2 ?spouse2Label WHERE
{
   {
  SELECT ?person ?spouse1 WHERE 
  {
    VALUES ?olympics { wd:Q159821 wd:Q82414 }
    ?person wdt:P26 ?spouse1.
    ?spouse1 wdt:P1344 ?event1.
    ?event1 wdt:P31 ?olympics.
    } }  VALUES ?olympics { wd:Q159821 wd:Q82414 }
  ?person wdt:P26 ?spouse2.
  ?spouse2 wdt:P1344 ?event2.
  ?event2 wdt:P31 ?olympics.
  filter(str(?spouse1) < str(?spouse2) )
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?event1") v6("?event2") v6("?olympics") v4("?person"):::projected v1("?spouse1"):::projected v2("?spouse2"):::projected c5(["bd:serviceParam"]):::iri c7(["en"]):::literal f0[["str(?spouse1) < str(?spouse2)"]] f0 --> v1 f0 --> v2 bind1[/VALUES ?olympics/] bind1-->v6 bind10(["wd:Q159821"]) bind10 --> bind1 bind11(["wd:Q82414"]) bind11 --> bind1 v4 --"wdt:P26"--> v1 v1 --"wdt:P1344"--> v5 v5 --"wdt:P31"--> v6 bind2[/VALUES ?olympics/] bind2-->v6 bind20(["wd:Q159821"]) bind20 --> bind2 bind21(["wd:Q82414"]) bind21 --> bind2 v4 --"wdt:P26"--> v2 v2 --"wdt:P1344"--> v6 v6 --"wdt:P31"--> v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end