User:Husky/Zomergasten

Een aantal queries gerelateerd aan Zomergasten (Q2330424). Als je liever grafiekjes ziet dan SPARQL-queries dan is deze serie tweets misschien wat leuker om naar te kijken. Husky (talk) 19:57, 9 August 2020 (UTC)

SeizoenenEdit

select ?item ?itemLabel ?season ?year where {
  ?item wdt:P31 wd:Q3464665;
        wdt:P179 wd:Q2330424;
        wdt:P577 ?pubdate;
        p:P179 ?series.
  ?series pq:P1545 ?season.
  bind (year(?pubdate) as ?year).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

AfleveringenEdit

select ?item ?itemLabel ?episode ?year where {
  ?item wdt:P31 wd:Q21191270;
        wdt:P179 wd:Q2330424;
        wdt:P577 ?pubdate;
        p:P179 ?series.
  ?series pq:P1545 ?episodeString.
  bind (year(?pubdate) as ?year).
  bind (xsd:integer(?episodeString) as ?episode).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

BeroepenEdit

select distinct ?oc ?ocLabel (count(?oc) as ?ocCount) where {
  ?item wdt:P179 wd:Q2330424;
        wdt:P5030 ?guest.
  ?guest wdt:P106 ?oc. 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
} group by ?oc ?ocLabel ?ocCount order by desc(?ocCount)
Try it!

GeslachtEdit

select distinct ?gender ?genderLabel (count(?gender) as ?genderCount) where {
  ?item wdt:P179 wd:Q2330424;
        wdt:P5030 ?guest.
  ?guest wdt:P21 ?gender. 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
} group by ?gender ?genderLabel ?genderCount order by desc(?genderCount)
Try it!

Aantal vrouwen per seizoenEdit

select ?year (count(?guest) as ?count) where {
  ?season wdt:P31 wd:Q3464665;
          wdt:P179 wd:Q2330424;
          wdt:P577 ?pubdate.
  
  bind (year(?pubdate) as ?year). 

  ?episode wdt:P4908 ?season;
           wdt:P5030 ?guest. 
  
  ?guest wdt:P21 wd:Q6581072.
} group by ?year ?count order by ?year
Try it!

Bekendste personen naar WP artikelenEdit

select ?guest ?guestLabel (count(?sitelink) as ?count) where {
  ?episode wdt:P31 wd:Q21191270;
           wdt:P179 wd:Q2330424;
           wdt:P5030 ?guest. 
  ?sitelink schema:about ?guest;
            schema:isPartOf [ wikibase:wikiGroup "wikipedia" ].
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
} group by ?guest ?guestLabel ?count order by desc(?count)
Try it!

Leeftijd bij uitzendingEdit

select ?guestLabel ?age where {
  ?item wdt:P179 wd:Q2330424;
        wdt:P5030 ?guest;
        wdt:P577 ?pubDate. 
  ?guest wdt:P569 ?dob. 
  bind (year(?dob) as ?dobyear). 
  bind (year(?pubDate) as ?pubyear).
  bind (?pubyear - ?dobyear as ?age).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
} order by asc(?age)
Try it!

Gemiddelde leeftijdEdit

select (avg(?age) as ?avgAge) where {
  ?item wdt:P179 wd:Q2330424;
        wdt:P5030 ?guest;
        wdt:P577 ?pubDate. 
  ?guest wdt:P569 ?dob. 
  bind (year(?dob) as ?dobyear). 
  bind (year(?pubDate) as ?pubyear).
  bind (?pubyear - ?dobyear as ?age).
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
}
Try it!

Gemiddelde leeftijd per seizoenEdit

select ?pubyear (round(avg(?age)) as ?ageAvg) where {
  ?season wdt:P31 wd:Q3464665;
          wdt:P179 wd:Q2330424;
          wdt:P577 ?pubdate.
  
  bind (year(?pubdate) as ?pubyear). 

  ?episode wdt:P4908 ?season;
           wdt:P5030 ?guest. 
  
  ?guest wdt:P569 ?dob. 

  bind (year(?dob) as ?dobyear). 
  bind (?pubyear - ?dobyear as ?age).
} group by ?pubyear ?ageAvg order by ?pubyear
Try it!

GeboorteplaatsEdit

select distinct ?place ?placeLabel (count(?place) as ?placeCount) where {
  ?item wdt:P179 wd:Q2330424;
        wdt:P5030 ?guest.
  ?guest wdt:P19 ?place. 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
} group by ?place ?placeLabel ?placeCount order by desc(?placeCount)
Try it!

RelatiesEdit

select ?guest ?guestLabel ?relation ?relationLabel ?epLabel where {
  ?item wdt:P179 wd:Q2330424;
        wdt:P5030 ?guest.
  ?guest ?x ?child.
  ?ep wdt:P5030 ?child;
      wdt:P179 wd:Q2330424.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
}
Try it!

Meest gemiddelde zomergastEdit

select ?guest ?guestLabel where {
  ?item wdt:P179 wd:Q2330424;
        wdt:P5030 ?guest;
        wdt:P577 ?pubDate. 
  ?guest wdt:P569 ?dob;
         wdt:P106 wd:Q36180;
         wdt:P21 wd:Q6581097.
  bind (year(?dob) as ?dobyear). 
  bind (year(?pubDate) as ?pubyear).
  bind (?pubyear - ?dobyear as ?age).
  filter (?age = 51)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
}
Try it!