query-f6683779b4517a194e82e7b4e28ad825

rq turtle/ttl

same-sex supercouples SELECT DISTINCT ?item ?itemLabel ?workLabel ?sexLabel WHERE { ?item wdt:P31 wd:Q1274180; wdt:P527 ?one, ?two . FILTER ( ?one != ?two ) ?one wdt:P21 ?sex . ?two wdt:P21 ?sex . OPTIONAL { ?item wdt:P1441 ?work . } SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } }

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#>
# same-sex supercouples
SELECT DISTINCT ?item ?itemLabel ?workLabel ?sexLabel
WHERE {
  ?item wdt:P31 wd:Q1274180;
        wdt:P527 ?one, ?two . FILTER ( ?one != ?two )
  ?one wdt:P21 ?sex . ?two wdt:P21 ?sex .
  OPTIONAL { ?item wdt:P1441 ?work . }
  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; v3("?item"):::projected v1("?one") v4("?sex") v2("?two") v5("?work") c7(["bd:serviceParam"]):::iri c2(["wd:Q1274180"]):::iri c9(["en"]):::literal f0[["?one != ?two"]] f0 --> v1 f0 --> v2 v3 --"wdt:P31"--> c2 v3 --"wdt:P527"--> v1 v3 --"wdt:P527"--> v2 v1 --"wdt:P21"--> v4 v2 --"wdt:P21"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P1441".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end