Matching hierarchical classifications with attributes