query: SELECT 
     (wd:Q847 as ?item) 
     (SAMPLE(?a) as ?sample) 
     (COUNT(DISTINCT ?a) as ?ct)
     (wd:Q21170330 as ?type)
  ("4" as ?level)
  ("qualifications" as ?descr)
  WHERE
  {
   { ?a wdt:P31 wd:Q21170330  }
  }