query-24522a4e5151024cce1958f6e15d7a89
Ricky81682timevalues
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/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?inception ?precision
WHERE
{
?item wdt:P170 wd:Q10330043.
?item p:P571 ?stm.
?stm psv:P571 ?value.
?value wikibase:timePrecision ?prec.
BIND (COALESCE(
IF (?prec = 7, "century", 1/0),
IF (?prec = 8, "decade", 1/0),
IF (?prec = 9, "year", 1/0),
IF (?prec = 10, "month", 1/0),
IF (?prec = 11, "day", 1/0),
"other") AS ?precision)
?value wikibase:timeValue ?inception.
# FILTER (YEAR(?inception) = 1870)
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;
v6("?inception"):::projected
v1("?item"):::projected
v4("?prec")
v5("?precision"):::projected
v2("?stm")
v3("?value")
c8(["bd:serviceParam"]):::iri
c2(["wd:Q10330043"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"p:direct/P170"--> c2
v1 --"p:P571"--> v2
v2 --"p:statement/value/P571"--> v3
v3 --"wikibase:timePrecision"--> v4
bind0[/"if(?prec = '7^^xsd:integer','century','1^^xsd:integer' / '0^^xsd:integer')if(?prec = '8^^xsd:integer','decade','1^^xsd:integer' / '0^^xsd:integer')if(?prec = '9^^xsd:integer','year','1^^xsd:integer' / '0^^xsd:integer')if(?prec = '10^^xsd:integer','month','1^^xsd:integer' / '0^^xsd:integer')if(?prec = '11^^xsd:integer','day','1^^xsd:integer' / '0^^xsd:integer')'other'"/]
v4 --o bind0
bind0 --as--o v5
v3 --"wikibase:timeValue"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end