query-88cc21280894497c95c725f533d1487a
?item1 is human, have FAST ID and English label
?item2 is human and sitelink to ruwiki
?item1 and ?item2 are born and died the same date
SELECT ?item1 ?FAST_ID ?label_en ?birth ?death ?item2 ?ruwiki_sitelink WITH { SELECT ?item1 ?FAST_ID ?label_en WHERE { ?item1 wdt:P31 wd:Q5. #Human ?item1 wdt:P2163 ?FAST_ID. ?item1 rdfs:label ?label_en. FILTER (LANG(?label_en) = "en") } LIMIT 1000 } AS %get_humans_with_FAST_ID WHERE { INCLUDE %get_humans_with_FAST_ID ?item1 wdt:P569 ?birth. ?item2 wdt:P569 ?birth. ?item1 wdt:P570 ?death. ?item2 wdt:P570 ?death. FILTER (?item1 != ?item2) ?item2 wdt:P31 wd:Q5. #Human ?ruwiki_sitelink schema:about ?item2 . ?ruwiki_sitelink schema:isPartOf https://ru.wikipedia.org/. }
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# ?item1 is human, have FAST ID and English label
# ?item2 is human and sitelink to ruwiki
# ?item1 and ?item2 are born and died the same date
SELECT ?item1 ?FAST_ID ?label_en ?birth ?death ?item2 ?ruwiki_sitelink
WHERE
{
{
SELECT ?item1 ?FAST_ID ?label_en
WHERE
{
?item1 wdt:P31 wd:Q5. #Human
?item1 wdt:P2163 ?FAST_ID.
?item1 rdfs:label ?label_en.
FILTER (LANG(?label_en) = "en")
}
LIMIT 1000
} ?item1 wdt:P569 ?birth.
?item2 wdt:P569 ?birth.
?item1 wdt:P570 ?death.
?item2 wdt:P570 ?death.
FILTER (?item1 != ?item2)
?item2 wdt:P31 wd:Q5. #Human
?ruwiki_sitelink schema:about ?item2 .
?ruwiki_sitelink schema:isPartOf <https://ru.wikipedia.org/>.
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?FAST_ID"):::projected
v5("?birth"):::projected
v6("?death"):::projected
v1("?item1"):::projected
v2("?item2"):::projected
v3("?label_en"):::projected
v7("?ruwiki_sitelink"):::projected
c10([https://ru.wikipedia.org/]):::iri
c3(["wd:Q5"]):::iri
f0[["?item1 != ?item2"]]
f0 --> v1
f0 --> v2
f1[["?label_en = 'en'"]]
f1 --> v3
v1 --"wdt:P31"--> c3
v1 --"wdt:P2163"--> v4
v1 --"rdfs:label"--> v3
v1 --"wdt:P569"--> v5
v2 --"wdt:P569"--> v5
v1 --"wdt:P570"--> v6
v2 --"wdt:P570"--> v6
v2 --"wdt:P31"--> c3
v7 --"schema:about"--> v2
v7 --"schema:isPartOf"--> c10