public function searchType(QueryBuilderInterface $query , $class_uri , $recursive = false) {

        $Class    = new \core_kernel_classes_Class($class_uri);
        $rdftypes = [];

        if ($recursive === true) {
            foreach($Class->getSubClasses(true) as $subClass) {
                $rdftypes[] = $subClass->getUri();
            }
        }

        $rdftypes[] = $class_uri;
        
        $criteria = $query->newQuery()
                ->add('http://www.w3.org/1999/02/22-rdf-syntax-ns#type')
                ->in($rdftypes);
        
        return $criteria;
    }