query-2bccea8d453c0a55205fd4ad3ba5a10f

rq turtle/ttl

.on Mastodon and on TwitterOriginally posted

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 ?person1 ?person2 ?person1Label ?person1Description ?person2Label ?person2Description WHERE {
  ?person1 wdt:P31 wd:Q5;
           wdt:P21 ?gender;
           wdt:P569 ?dob1;
           wdt:P26 ?person2.
  ?person2 wdt:P31 wd:Q5;
           wdt:P569 ?dob2;
           wdt:P21 ?gender.
  MINUS { ?person1 wdt:P91 ?orientation. }
  MINUS { ?person2 wdt:P91 ?orientation. }
  # arbitrarily filter out some early results, we’re more likely to find references for recent people
  FILTER(?dob1 >= "1950-01-01"^^xsd:dat)
  FILTER(?dob2 >= "1950-01-01"^^xsd:dat)
  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; v2("?dob1") v1("?dob2") v4("?gender") v6("?orientation") v3("?person1"):::projected v5("?person2"):::projected c9(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?dob2 >= s1950-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f0 --> v1 f1[["?dob1 >= s1950-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f1 --> v2 v3 --"wdt:P31"--> c3 v3 --"wdt:P21"--> v4 v3 --"wdt:P569"--> v2 v3 --"wdt:P26"--> v5 v5 --"wdt:P31"--> c3 v5 --"wdt:P569"--> v1 v5 --"wdt:P21"--> v4 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P91"--> v6 end subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v5 --"wdt:P91"--> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end