query-2659beb96513c30d963f74e58aae8d5d
Complete filter with value of a qualifier. the people of an specific year in the teamIn this query to select sportpersons from an specific sport and specific team, I need to select just It is, with the qualifier P580, of the P54 filtered, equal to an specific year. Also, but not to filter, I need to show the qualifier P1350 of the filtered team:
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#>
SELECT ?item ?itemLabel ?equipLabel ?posicio_equip ?posicio_equipLabel ?alcaria ?massa ?numero_esportiu WHERE {
?item wdt:P641 ?esport.
?item wdt:P54 ?equip.
OPTIONAL { ?item wdt:P413 ?posicio_equip. }
OPTIONAL { ?item wdt:P2048 ?alcaria. }
OPTIONAL { ?item wdt:P2067 ?massa. }
OPTIONAL { ?item wdt:P1618 ?numero_esportiu. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
FILTER(?esport = wd:Q2736) # select sport #
FILTER(?equip = wd:Q7156) # select team #
}
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?alcaria"):::projected
v1("?equip")
v2("?esport")
v3("?item"):::projected
v6("?massa"):::projected
v7("?numero_esportiu"):::projected
v4("?posicio_equip"):::projected
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?equip = 'wd:Q7156'"]]
f0 --> v1
f1[["?esport = 'wd:Q2736'"]]
f1 --> v2
v3 --"wdt:P641"--> v2
v3 --"wdt:P54"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P413".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P2048".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P2067".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P1618".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end