public static function filterQueries($queries, $user)
 {
     $result = array();
     foreach ($queries as $qid => $title) {
         $qdao = new QueryDAO();
         $segments = $qdao->getSegmentsByQueryId($qid);
         $tristate = User::createPropertyMap(0);
         foreach (array_values($segments) as $segment) {
             $prop = $segment[0];
             $value = $segment[1];
             if ($tristate[$prop] != 1) {
                 $tristate[$prop] = User::indexOfUserValue($prop, $user) == $value ? 1 : -1;
             }
         }
         $applies = true;
         foreach (array_values($tristate) as $value) {
             if ($value == -1) {
                 $applies = false;
                 break;
             }
         }
         if ($applies) {
             $result[$qid] = $title;
         }
     }
     return $result;
 }