query: SELECT ?item ?ord ?companion ?season ?ordseason (COUNT(DISTINCT ?ep) as ?epcount) (COUNT(DISTINCT ?serial) as ?serialcount)
  WHERE
  {
    ?item (wdt:P31/wdt:P31*) wd:Q47543030.
    OPTIONAL { ?item (wdt:P31/wdt:P31*) wd:Q47543030. }
    OPTIONAL { ?item wdt:P1545 ?ord }
    OPTIONAL { ?item ^wdt:P2546 ?companion }
    OPTIONAL { ?ep wdt:P674 ?item ; wdt:P31 wd:Q21191270 }
    OPTIONAL { ?serial wdt:P674 ?item ; wdt:P31 wd:Q28225717 }  
    OPTIONAL { ?season wdt:P674 ?item ; wdt:P31 wd:Q3464665 ; p:P179 [ ps:P179 wd:Q34316 ; pq:P1545 ?ordseason ] }
  
  }
  GROUP BY ?item ?ord ?companion ?season ?ordseason
  ORDER BY xsd:integer(?ord) xsd:integer(?ordseason)