#!/usr/bin/env python3 """Test enrichment with ONLY University of Sousse.""" import yaml from pathlib import Path from scripts.enrich_tunisia_wikidata_validated import search_wikidata_with_validation input_file = Path('data/instances/tunisia/tunisian_institutions_enhanced.yaml') with open(input_file, 'r', encoding='utf-8') as f: data = yaml.safe_load(f) institutions = data['institutions'] # Find University of Sousse for inst in institutions: if inst.get('name') == 'University of Sousse': print(f"Testing: {inst['name']}") print(f"Type: {inst.get('institution_type')}") print(f"City: {inst.get('locations', [{}])[0].get('city', '')}") result = search_wikidata_with_validation( inst['name'], inst.get('institution_type'), inst.get('locations', [{}])[0].get('city', '') ) if result: print(f"\n✅ SUCCESS: Found {result['qid']}") print(f" Name: {result.get('name')}") print(f" Score: {result.get('match_score')}") else: print(f"\n❌ FAILURE: No match found") break