query-82bbdcac1eb4c7892bca36ffce5ea80c
.on Mastodon and on TwitterOriginally posted
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?sibling1 ?sibling1Label ?birth1 ?sibling2 ?sibling2Label ?birth2 WHERE {
?sibling1 wdt:P31 wd:Q5;
wdt:P569 ?birth1;
p:P3373 ?siblingStatement.
?siblingStatement ps:P3373 ?sibling2.
MINUS { ?siblingStatement pq:P1039/wdt:P279* wd:Q14756018. }
?sibling2 wdt:P31 wd:Q5;
wdt:P569 ?birth2.
FILTER(ABS(?birth2 - ?birth1) = 1)
FILTER(STR(?sibling1) < STR(?sibling2))
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;
v4("?birth1"):::projected
v3("?birth2"):::projected
v1("?sibling1"):::projected
v2("?sibling2"):::projected
v5("?siblingStatement")
a1((" "))
c11(["bd:serviceParam"]):::iri
c9(["wd:Q14756018"]):::iri
c3(["wd:Q5"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["str(?sibling1) < str(?sibling2)"]]
f0 --> v1
f0 --> v2
f1[["numeric-abs(?birth2 - ?birth1) = '1^^xsd:integer'"]]
f1 --> v3
f1 --> v4
v1 --"p:direct/P31"--> c3
v1 --"p:direct/P569"--> v4
v1 --"p:P3373"--> v5
v5 --"p:statement/P3373"--> v2
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v5 --"p:qualifier/P1039"--> a1
a1 --"p:direct/P279"--> c9
end
v2 --"p:direct/P31"--> c3
v2 --"p:direct/P569"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end