User:Benoit Rochon/Mémoire

From Wikidata
Jump to: navigation, search

Requêtes cools[edit]

Artists entering in public domain by countries[edit]

#added before 2017-02

SELECT ?item ?itemLabel ?genderLabel (GROUP_CONCAT(DISTINCT ?occupationLabel; SEPARATOR=", ") AS ?occupations) (GROUP_CONCAT(DISTINCT ?countryLabel; SEPARATOR=", ") AS ?countries) ?death {
   VALUES ?target_country { wd:Q16 wd:Q31 wd:Q39 wd:Q142 } . #countries: Canada, France, Switzerland, Belgium. Remove this line to get worldwide.
  VALUES ?occupation { wd:Q483501 wd:Q36834 wd:Q639669 wd:Q753110 wd:Q488205 wd:Q49757 wd:Q4964182 wd:Q1281618 wd:Q36180 wd:Q482980 wd:Q1028181 wd:Q6625963 wd:Q28389 wd:Q1930187 wd:Q33999 wd:Q3282637 wd:Q81096 wd:Q201788 wd:Q18939491 wd:Q486748 wd:Q3658608 wd:Q214917 wd:Q11774202 wd:Q205375 } . #occupation: composer, poet, sculptor, writer, artist, painter, etc.
   ?item wdt:P31 wd:Q5;
               wdt:P21 ?gender;
               wdt:P570 ?death;
               wdt:P27 ?target_country;
               wdt:P27 ?country;
               wdt:P106 ?occupation .
   FILTER( YEAR( ?death ) = 1966 ) .
   SERVICE wikibase:label {
       bd:serviceParam wikibase:language "fr,en,ru,el,es,fa" .
       ?item rdfs:label ?itemLabel .
       ?gender rdfs:label ?genderLabel .
       ?occupation rdfs:label ?occupationLabel .
       ?country rdfs:label ?countryLabel .
   } .
} GROUP BY ?item ?itemLabel ?genderLabel ?death ORDER BY ?itemLabel

Try it!

Article du Québec sans article en français[edit]

SELECT ?item ?itemLabel ?cnt WHERE {
{
  SELECT ?item (COUNT(?sitelink) AS ?cnt) WHERE {
  ?item wdt:P131 wd:Q176 .
  ?sitelink schema:about ?item .
  FILTER NOT EXISTS {
    ?article schema:about ?item .
    ?article schema:isPartOf <https://fr.wikipedia.org/> .
  }
  } GROUP BY ?item ORDER BY DESC (?cnt) LIMIT 1000
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" }
} ORDER BY DESC (?cnt)

Try it!

Article du Canada sans article en français[edit]

SELECT ?item ?itemLabel ?cnt WHERE {
{
  SELECT ?item (COUNT(?sitelink) AS ?cnt) WHERE {
  ?item wdt:P27|wdt:P205|wdt:P17 wd:Q16 .
  ?sitelink schema:about ?item .
  FILTER NOT EXISTS {
    ?article schema:about ?item .
    ?article schema:isPartOf <https://fr.wikipedia.org/> .
  }
  } GROUP BY ?item ORDER BY DESC (?cnt) LIMIT 1000
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,de," }  
} ORDER BY DESC (?cnt)

Try it!

Femmes scientifiques canadiennes et françaises sans article en français[edit]

SELECT ?item ?itemLabel (GROUP_CONCAT(DISTINCT ?occupationLabel; SEPARATOR=", ") AS ?occupations) (GROUP_CONCAT(DISTINCT ?countryLabel; SEPARATOR=", ") AS ?countries) {
  VALUES ?target_country { wd:Q16 wd:Q142 } . #countries: Canada, France. Remove this line to get worldwide.
  VALUES ?occupation { wd:Q3621491 wd:Q11063 wd:Q37547 wd:Q4773904 wd:Q3378595 wd:Q15634281 wd:Q350979 wd:Q2306091 
                       wd:Q2310145 wd:Q19350898 wd:Q3644587 wd:Q82594 wd:Q4459623 wd:Q864503 wd:Q169470 wd:Q81096 
                       wd:Q170790 wd:Q170790 wd:Q3621491 wd:Q593644 wd:Q2374149 wd:Q520549 wd:Q1662561 wd:Q2732142 
                       wd:Q212980 wd:Q205375 wd:Q3055126 wd:Q2487799 wd:Q39631 } . #occupation: archéologue, astronome, astrophysique, anthopologue, biologiste, mathématicien, etc.
  VALUES ?gender { wd:Q6581072 } . 
   ?item wdt:P31 wd:Q5;
               wdt:P21 ?gender;
               wdt:P27 ?country;
               wdt:P27 ?target_country;
               wdt:P106 ?occupation .
    FILTER NOT EXISTS {
    ?article schema:about ?item .
    ?article schema:isPartOf <https://fr.wikipedia.org/> .
  }
   SERVICE wikibase:label {
       bd:serviceParam wikibase:language "fr,en" .
       ?item rdfs:label ?itemLabel .
       ?occupation rdfs:label ?occupationLabel .
       ?country rdfs:label ?countryLabel .
   } .
} GROUP BY ?item ?itemLabel ORDER BY ?countries

Try it!

Liste des lauréats des Prix Acfas[edit]

Requête avec les articles wp[edit]

SELECT ?item ?itemLabel ?genderLabel ?itemDescription ?awardLabel (YEAR(?date) AS ?year) (GROUP_CONCAT(DISTINCT ?language; separator=", ") AS ?languages) {
  VALUES ?award { wd:Q3404296 wd:Q2365303 wd:Q28869834 wd:Q3404842 wd:Q3404891 wd:Q3404993 
                  wd:Q3405049 wd:Q24928963 wd:Q3405011 wd:Q21658579 wd:Q3405354 } . #award: 10 Acfas awards
  ?item wdt:P31 wd:Q5;
        wdt:P21 ?gender;
        p:P166 ?awardStatement.
  ?awardStatement ps:P166 ?award.
  OPTIONAL { ?awardStatement pq:P585 ?date. }
  OPTIONAL {
    ?article a schema:Article;
               schema:about ?item;
               schema:inLanguage ?language.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}
GROUP BY ?item ?itemLabel ?genderLabel ?itemDescription ?award ?awardLabel ?date
ORDER BY ?genderLabel ?awardLabel

Try it!

Requête sans les articles wp[edit]

SELECT ?item ?itemLabel ?genderLabel ?itemDescription ?awardLabel (YEAR(?date) AS ?year) {
  VALUES ?award { wd:Q3404296 wd:Q2365303 wd:Q28869834 wd:Q3404842 wd:Q3404891 wd:Q3404993 
                  wd:Q3405049 wd:Q24928963 wd:Q3405011 wd:Q21658579 wd:Q3405354 } . #award: 10 Acfas awards
  ?item wdt:P31 wd:Q5;
        wdt:P21 ?gender;
        p:P166 ?awardStatement.
  ?awardStatement ps:P166 ?award.
  OPTIONAL { ?awardStatement pq:P585 ?date. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}
GROUP BY ?item ?itemLabel ?genderLabel ?itemDescription ?award ?awardLabel ?date
ORDER BY ?genderLabel ?awardLabel

Try it!

Prix de l'Institut d'histoire de l'Amérique française[edit]

SELECT ?item ?itemLabel ?genderLabel ?itemDescription ?awardLabel (YEAR(?date) AS ?year) (GROUP_CONCAT(DISTINCT ?language; separator=", ") AS ?languages) {
  VALUES ?award { wd:Q43890563 } . #award: prix de l'Institut d'histoire de l'Amérique française
  ?item wdt:P31 wd:Q5;
        wdt:P21 ?gender;
        p:P166 ?awardStatement.
  ?awardStatement ps:P166 ?award.
  OPTIONAL { ?awardStatement pq:P585 ?date. }
  OPTIONAL {
    ?article a schema:Article;
               schema:about ?item;
               schema:inLanguage ?language.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}
GROUP BY ?item ?itemLabel ?genderLabel ?itemDescription ?award ?awardLabel ?date
ORDER BY ?genderLabel ?awardLabel

Try it!

Items canadiens sans photo dans Wikidata pointés sur une carte[edit]

#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?coord {
  ?item wdt:P131+ wd:Q16 .
  MINUS { ?item wdt:P18 [] } .
  ?item wdt:P625 ?coord .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr" } .
}

Try it!