query-279612b8e09b55a713d6abb9e00595fa
Getting the datetime value to output in +1948-04-12T00:00:00Z format 00:31, 27 June 2018 (UTC)) talk (TagishsimonHow do I get the datetime value in this query in the format +1948-04-12T00:00:00Z rather than 12 April 1948? (You'll see the remains of me poking around inside the model, to no good effect, in the query). thanks --
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pqv: <http://www.wikidata.org/prop/qualifier/value/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?datez ?date ?approvalLabel
WHERE
{
?item p:P1435 ?thing.
?thing ps:P1435 wd:Q17504995.
optional {?thing pqv:P580 ?datez. ?datez wikibase:timeValue ?date}
optional {?thing pq:P790 ?approval}
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;
v5("?approval")
v4("?date"):::projected
v3("?datez"):::projected
v1("?item"):::projected
v2("?thing")
c3(["wd:Q17504995"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"p:P1435"--> v2
v2 --"p:statement/P1435"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/value/P580".-> v3
v3 --"wikibase:timeValue"--> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P790".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end