query-e31214697f148ed6a7507fe29d1506b0
SPARQL query
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?itemLabel ?start ?end
WHERE
{
?item p:P39 ?ps.
?ps ps:P39 wd:Q14211 .
OPTIONAL { ?ps pq:P580 ?start }
OPTIONAL { ?ps pq:P582 ?end }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
- https://www.wikidata.org/wiki/User:Louisecrow/sandbox/data_pipeline_developer_1
- https://www.wikidata.org/wiki/User:Louisecrow/sandbox/data_pipeline_developer_example
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?end"):::projected
v1("?item")
v2("?ps")
v3("?start"):::projected
c3(["wd:Q14211"]):::iri
c7(["bd:serviceParam"]):::iri
c9(["en"]):::literal
v1 --"p:P39"--> v2
v2 --"p:statement/P39"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P580".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P582".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end