query-d09861eae54e8abf2b945e19fb28472f
Henrique Pousão SELECT ?item ?itemLabel (year(?date) as ?year) WHERE { ?item wdt:P170 wd:Q3847723. optional {?item wdt:P571 ?date .} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } order by ?date
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 bd: <http://www.bigdata.com/rdf#>
#Henrique Pousão
SELECT ?item ?itemLabel (year(?date) as ?year) WHERE {
?item wdt:P170 wd:Q3847723.
optional {?item wdt:P571 ?date .}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?date
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?date"):::projected
v2("?item"):::projected
v3("?year")
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q3847723"]):::iri
v2 --"wdt:P170"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P571".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind0[/"year-from-dateTime(?date)"/]
v1 --o bind0
bind0 --as--o v3