query-ca20ed6e365727f192b811b7b03fcffe
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?date_prec_cal WHERE {
?item wdt:P27 wd:Q1005.
OPTIONAL { ?item p:P569/psv:P569 [
wikibase:timeValue ?date;
wikibase:timePrecision ?prec;
wikibase:timeCalendarModel ?cal
].
}
BIND(IF(BOUND(?date),CONCAT(STRBEFORE(STR(?date),'T'),',',STR(?prec),',',STRAFTER(STR(?cal),'entity/')),'empty') AS ?date_prec_cal)
}
ORDER BY ?date_prec_cal
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?cal")
v3("?date")
v6("?date_prec_cal"):::projected
v2("?item"):::projected
v4("?prec")
a2((" "))
a1((" "))
c2(["wd:Q1005"]):::iri
v2 --"p:direct/P27"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
a1 -."wikibase:timeValue".-> v3
a1 --"wikibase:timePrecision"--> v4
a1 --"wikibase:timeCalendarModel"--> v5
v2 --"p:P569"--> a2
a2 --"p:statement/value/P569"--> a1
end
bind0[/"if(bound(?date),concat(substring-before(str(?date),'T'),',',str(?prec),',',substring-after(str(?cal),'entity/')),'empty')"/]
v3 --o bind0
v4 --o bind0
v5 --o bind0
bind0 --as--o v6