query-b5769ead22a70a6387aff237d6915648

rq turtle/ttl

Getting property labelI'm trying to figure out the current team ("member of sports team" without qualifier "end time") of the riders of this year's Tour de France:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
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 ?team.
  optional {?team pq:P580 ?st}
  optional {?team 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 v6("?since") v2("?st"):::projected v5("?team") c7(["bd:serviceParam"]):::iri c2(["wd:Q28859163"]):::iri c9(["#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 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; c7 --"wikibase:language"--> c9 end bind1[/"year-from-dateTime(?st)"/] v2 --o bind1 bind1 --as--o v6