query-7151db5b71476ba24e9e230574104657
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 ?person ?personLabel ?teamLabel (year(?st) as ?since) WHERE {
?person wdt:P1344 wd:Q28859163.
?person p:P54 ?teamStatement .
?teamStatement ps:P54 ?team .
optional {?teamStatement pq:P580 ?st}
optional {?teamStatement pq:P582 ?et}
filter(bound(?st) && !bound(?et))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by desc(?since)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?et")
v4("?person"):::projected
v7("?since")
v2("?st"):::projected
v6("?team")
v5("?teamStatement")
c8(["bd:serviceParam"]):::iri
c2(["wd:Q28859163"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["bound(?st)not bound(?et)"]]
f0 --> v2
f0 --> v3
v4 --"p:direct/P1344"--> c2
v4 --"p:P54"--> v5
v5 --"p:statement/P54"--> v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P580".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P582".-> v3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind1[/"year-from-dateTime(?st)"/]
v2 --o bind1
bind1 --as--o v7