Model query to command