query-b2fbf5a751b9f28a6c8b361b44928d58
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 ps: <http://www.wikidata.org/prop/statement/>
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 (YEAR(?time) as ?date) ?viaf ?ol WHERE {
?item p:P166 ?node .
?node ps:P166 wd:Q2793926
OPTIONAL{
?node pq:P585 ?time
}
OPTIONAL{
?item wdt:P214 ?viaf1
}
OPTIONAL{
?item wdt:P648 ?ol1
}
BIND(IF(BOUND(?ol1), ?ol1, 'no OL identifier') AS ?ol)
BIND(IF(BOUND(?viaf1), ?viaf1, 'no VIAF identifier') AS ?viaf)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} ORDER BY ?time
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?date")
v2("?item"):::projected
v3("?node")
v6("?ol"):::projected
v5("?ol1")
v1("?time"):::projected
v7("?viaf"):::projected
v4("?viaf1")
c3(["wd:Q2793926"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["en"]):::literal
v2 --"p:P166"--> v3
v3 --"p:statement/P166"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P585".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P214".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P648".-> v5
end
bind0[/"if(bound(?ol1),?ol1,'no OL identifier')"/]
v5 --o bind0
bind0 --as--o v6
bind1[/"if(bound(?viaf1),?viaf1,'no VIAF identifier')"/]
v4 --o bind1
bind1 --as--o v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind2[/"year-from-dateTime(?time)"/]
v1 --o bind2
bind2 --as--o v8