Auto detect metadata type