code: function(query) {
      query = query || '';
      
      // TODO optimize with RegExp
  
      var nameChain = query.split('.');
      for(var i=0; i<nameChain.length; i++) {
        if(!nameChain[i].match(/(\*(\*)?|[a-zA-Z0-9_]+)/)) {
          return false;
        }
      }
  
      return true;
    }
docs: Validate state query
  
  @param  {String} query A query for the state; using dot-notation
  @return {Boolean}      True if name is valid, false if not