query-36265e944e61f69a5c8250a33752756c
TODO
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item1 ?item1Label ?birthdate1 ?item2 ?item2Label ?birthdate2 ?birthplaceLabel {
?item1 wdt:P19 ?birthplace ; wdt:P734 ?fn .
?birthplace wdt:P17 wd:Q38 .
?item2 wdt:P19 ?birthplace ; wdt:P734 ?fn .
FILTER( str(?item1) < STR(?item2) )
?item1 wdt:P569 ?birthdate1 .
?item2 wdt:P569 ?birthdate2 .
FILTER( ABS( YEAR(?birthdate1) - YEAR(?birthdate2) ) < 10 )
?item1 wdt:P26 ?item2 .
FILTER NOT EXISTS { ?item1 wdt:P3373 [] }
FILTER NOT EXISTS { ?item2 wdt:P3373 [] }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?item1Label ?birthdate1
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?birthdate1"):::projected
v5("?birthdate2"):::projected
v6("?birthplace")
v7("?fn")
v4("?item1"):::projected
v1("?item1Label"):::projected
v3("?item2"):::projected
a2((" "))
a1((" "))
c6(["wd:Q38"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P3373"--> e0a1
e0v1("?item2"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v3
f0 --> c1
f0 --> a1
v3 --"wdt:P3373"--> a1
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"wdt:P3373"--> e1a1
e1v1("?item1"):::projected
e1a1((" ")):::projected
end
f1--EXISTS--> f1e1
f1 --> v4
f1 --> c1
f1 --> a2
v4 --"wdt:P3373"--> a2
f2[["numeric-abs(year-from-dateTime(?birthdate1) - year-from-dateTime(?birthdate2)) < '10^^xsd:integer'"]]
f2 --> v2
f2 --> v5
f3[["str(?item1) < str(?item2)"]]
f3 --> v4
f3 --> v3
v4 --"wdt:P19"--> v6
v4 --"wdt:P734"--> v7
v6 --"wdt:P17"--> c6
v3 --"wdt:P19"--> v6
v3 --"wdt:P734"--> v7
v4 --"wdt:P569"--> v2
v3 --"wdt:P569"--> v5
v4 --"wdt:P26"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end