User:Benoit Rochon/Mémoire

From Wikidata
Jump to navigation Jump to search

Requêtes cools[edit]

Villes du Québec sans article dans atj.wp[edit]

SELECT ?item ?itemLabel 
WHERE 
{
  ?item wdt:P31 wd:Q27676416 .
  filter not exists { ?article schema:about ?item ;
          schema:isPartOf <https://atj.wikipedia.org/> . }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

People entering in public domain "life+50"[edit]

#added before 2019-02

#Shows people raised in the public domain "life + 50 years".
SELECT ?item ?itemLabel ?genderLabel (GROUP_CONCAT(DISTINCT ?occupationLabel; SEPARATOR=", ") AS ?occupations) (GROUP_CONCAT(DISTINCT ?countryLabel; SEPARATOR=", ") AS ?countries) ?death ?articles {
  VALUES ?target_country { wd:Q16 wd:Q142 wd:Q39 wd:Q31 wd:Q30 } . #countries: Canada, France, Switzerland, Belgium, USA. Removing this line to get worldwide may cause a query timeout.
  VALUES ?occ { wd:Q2500638 wd:Q20826540 wd:Q215627 } . #occupation: creator, erudite, person. These 3 occupations will also look for subclasses. Example: Alan Turing is a cryptographer, a subclass of cryptologist, a subclass of mathematician, a subclass of scientist, a subclass of erudite.
   ?item wdt:P31 wd:Q5;
               wdt:P21 ?gender;
               wdt:P27 ?target_country;
               wdt:P27 ?country;
               wdt:P106/wdt:P279* ?occ ;
               wdt:P106 ?occupation;
               wikibase:sitelinks ?articles . #Service to count the number of articles in Wikipedia language versions. The higher the number, the greater the chances that the person is very notorious.
   ?item wdt:P570 ?death . hint:Prior hint:rangeSafe true .
   FILTER( ?death >= "1969-01-01T00:00:00"^^xsd:dateTime && ?death < "1970-01-01T00:00:00"^^xsd:dateTime ) #death: public domain "life+50 years". Change both years to get a list in different legislation. Example for USA: life+70 years
   SERVICE wikibase:label {
       bd:serviceParam wikibase:language "fr,en" . #Service to retrieve the labels of items, in order of language. Example: if the label does not exist in French, the service will take the English label
       ?item rdfs:label ?itemLabel .
       ?gender rdfs:label ?genderLabel .
       ?occupation rdfs:label ?occupationLabel .
       ?country rdfs:label ?countryLabel .
   } .
} GROUP BY ?item ?itemLabel ?genderLabel ?death ?articles ORDER BY DESC (?articles) #Order by the number of articles in Wikipedia language versions. The most notorious people will be at the top of the list.

Try it!

Canadian subjects with no English article in Wikipedia, sorted by amount of articles in other languages[edit]

#added before 2019-02

SELECT ?item ?itemLabel ?cnt WHERE {
{
  SELECT ?item (COUNT(?sitelink) AS ?cnt) WHERE { 
  ?item wdt:P27|wdt:P205|wdt:P17 wd:Q16 . #Canadian subjects, minus subjects that are inappropriate.
  minus {?item wdt:P106 wd:Q488111 .} #Minus occupations that would be inappropriate in most situations.
  minus {?item wdt:P106 wd:Q3286043 .}
  minus {?item wdt:P106 wd:Q4610556 .}  
  ?sitelink schema:about ?item .
  FILTER NOT EXISTS {
    ?article schema:about ?item .
    ?article schema:isPartOf <https://en.wikipedia.org/> . #Targeting Wikipedia language where subjects has no article.
  }
  } GROUP BY ?item ORDER BY DESC (?cnt) LIMIT 1000 #Result limited to 1000 lines to not have a timeout error.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,es,de" }  #Service to resolve labels in (fallback) languages: automatic user language, English, French, Spanish, German.
} ORDER BY DESC (?cnt)

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!

Militants pour les droits LGBT sans article en français[edit]

SELECT ?item ?itemLabel (GROUP_CONCAT(DISTINCT ?occupationLabel; SEPARATOR=", ") AS ?occupations) (GROUP_CONCAT(DISTINCT ?countryLabel; SEPARATOR=", ") AS ?countries) {
  VALUES ?occupation {wd:Q19509201} . 
   ?item wdt:P31 wd:Q5;
               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!

LGBT sans article en français[edit]

SELECT ?item ?itemLabel ?itemDescription WHERE {
  {?item wdt:P91 wd:Q6636.} UNION {?item wdt:P91 wd:Q592.} UNION {?item wdt:P91 wd:Q6649.}
  FILTER NOT EXISTS {
    ?article schema:about ?item .
    ?article schema:isPartOf <https://fr.wikipedia.org/> .
  }
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}

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!

Article de atj.wikipedia sans images dans Wikidata[edit]

select * {
    ?article schema:about ?item . 
    ?article schema:isPartOf <https://atj.wikipedia.org/>
    filter not exists {
        ?item ?image_property [] . 
        ?real_property wikibase:directClaim ?image_property .
        ?real_property wdt:P31 wd:Q26940804 .
    }
}

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!