query-e3e53fe0a958580e8403623b1065ccc9
This query gets no timeout. When I start asking data.nobelprize.org Anyone with a theory?No theory, but I have an ugly kludge of a named subquery which works...
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?NobelId ?item ?LaureateNobelUri ?NobelBirth ?NobelGender ?NobelDeath ?WDBirth ?WDGender ?WDDeath
where
{
{SELECT ?NobelId ?item ?LaureateNobelUri ?NobelBirth ?NobelGender ?NobelDeath ?WDBirth ?WDGender ?WDDeath{
SERVICE <http://data.nobelprize.org/sparql> {
SELECT distinct ?NobelId ?LaureateNobelUri ?NobelBirth ?NobelDeath ?NobelGender WHERE {
?LaureateNobelUri <http://data.nobelprize.org/terms/laureateAward> ?NobelAwardid.
BIND(REPLACE(str(?LaureateNobelUri),"http://data.nobelprize.org/resource/laureate/","") AS ?NobelId)
OPTIONAL{ ?LaureateNobelUri foaf:birthday ?NobelBirth}
OPTIONAL{ ?LaureateNobelUri foaf:gender ?NobelGender}
OPTIONAL{ ?LaureateNobelUri foaf:birthday ?NobelDeath}
}
}
}
} ?item wdt:P2888 ?LaureateNobelUri .
OPTIONAL{ ?item wdt:P569 ?WDBirth.}
OPTIONAL{ ?item wdt:P21 ?WDGender.}
OPTIONAL{ ?item wdt:P570 ?WDDeath.}
}
order by desc(xsd:integer(?NobelId))
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?LaureateNobelUri"):::projected
v3("?NobelAwardid")
v4("?NobelBirth"):::projected
v6("?NobelDeath"):::projected
v5("?NobelGender"):::projected
v4("?NobelId"):::projected
v8("?WDBirth"):::projected
v10("?WDDeath"):::projected
v9("?WDGender"):::projected
v7("?item"):::projected
subgraph s1["http://data.nobelprize.org/sparql"]
style s1 stroke-width:4px;
v2 --http://data.nobelprize.org/terms/laureateAward--> v3
bind0[/"replace(str(?LaureateNobelUri),'http://data.nobelprize.org/resource/laureate/','')"/]
v2 --o bind0
bind0 --as--o v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -.http://xmlns.com/foaf/0.1/birthday.-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -.http://xmlns.com/foaf/0.1/gender.-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -.http://xmlns.com/foaf/0.1/birthday.-> v6
end
end
v7 --"wdt:P2888"--> v2
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v7 -."wdt:P569".-> v8
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v7 -."wdt:P21".-> v9
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v7 -."wdt:P570".-> v10
end