query-dfb774dc40a94a78433fa513b8d7e934
Participants Prix de Lausanne avec leur nationalité et leur employeur
SELECT ?item ?itemLabel ?citizenshipLabel ?employerLabel # affiche les résultats de ces labels (en langage id Q ou en langage humain si on ajoute Label au label), on peut aussi préciser ici les item
WHERE { # on trouve dans l'ordre Item Property Value Stop ?item wdt:P31 wd:Q5 . # ajouter instance of human { ?item wdt:P1344 wd:Q673014 . } # participant à Prix de Lausanne UNION { ?item wdt:P2522 wd:Q673014 . } # victoire à Prix de Lausanne
OPTIONAL { ?item wdt:P27 ?citizenship } .   # quelle que soit la nationalité, si pas d'Optional, ne s'affiche que si la nationalité est remplie
OPTIONAL { ?item wdt:P108 ?employer } .   # afficher l'employeur si connu
SERVICE wikibase:label { bd:serviceParam wikibase:language "es, fr, en, [AUTO_Language]" . } # affiche résultats d'abord en espagnol, puis en français, si non en anglais
}
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#>
#Participants Prix de Lausanne avec leur nationalité et leur employeur
SELECT ?item ?itemLabel ?citizenshipLabel ?employerLabel  # affiche les résultats de ces labels (en langage id Q ou en langage humain si on ajoute Label au label), on peut aussi préciser ici les item
WHERE
{
    # on trouve dans l'ordre Item Property Value Stop
    ?item wdt:P31 wd:Q5 .  # ajouter instance of human
      { ?item wdt:P1344 wd:Q673014 . } # participant à Prix de Lausanne
    UNION
      { ?item wdt:P2522 wd:Q673014 . } # victoire à Prix de Lausanne
    OPTIONAL { ?item wdt:P27 ?citizenship } .   # quelle que soit la nationalité, si pas d'Optional, ne s'affiche que si la nationalité est remplie
    OPTIONAL { ?item wdt:P108 ?employer } .   # afficher l'employeur si connu
    SERVICE wikibase:label { bd:serviceParam wikibase:language "es, fr, en, [AUTO_Language]" . } # affiche résultats d'abord en espagnol, puis en français, si non en anglais
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?citizenship")
  v3("?employer")
  v1("?item"):::projected 
  c9(["bd:serviceParam"]):::iri 
  c11(["es, fr, en, #91;AUTO_Language#93;"]):::literal 
  c2(["wd:Q5"]):::iri 
  c4(["wd:Q673014"]):::iri 
  v1 --"wdt:P31"-->  c2
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    v1 --"wdt:P2522"-->  c4
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v1 --"wdt:P1344"-->  c4
  end
  union0r <== or ==> union0l
  end
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v1 -."wdt:P27".->  v2
  end
  subgraph optional1["(optional)"]
  style optional1 fill:#bbf,stroke-dasharray: 5 5;
    v1 -."wdt:P108".->  v3
  end
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c9 --"wikibase:language"-->  c11
  end