public function getResourcesByQuery(Query $query, string $resVar = '?res',
                                        bool $checkIfExist = true): array {
        $resVar    = preg_replace('|^[?]|', '', $resVar);
        $results   = $this->runQuery($query);
        $resources = array();
        foreach ($results as $i) {
            try {
                $resources[] = $this->getResourceByUri($i->$resVar);
            } catch (Deleted $e) {
                
            }
        }
        if ($checkIfExist) {
            $resources = $this->verifyResources($resources);
        }
        return $resources;
    }