# Debug: Understanding the Validation Flow ## Your Sample RDF ```xml Incomplete Title ``` ## Expected Validation Errors ### From Monograph_Work_Text.tsv - Missing `bf:language` (required) - Missing `bf:content` (required) - Missing `bf:adminMetadata` (required) - Invalid `bf:title` structure (should be nested with bf:Title/bf:mainTitle) ### From Monograph_AdminMetadata.tsv **Should NOT report errors** because there is NO AdminMetadata node to validate! ## The Confusion If you see: ``` === Module: MonographDCTAP/Monograph_AdminMetadata.tsv === Message: Less than 1 values on [...]->bf:assigner ``` This means AdminMetadata EXISTS somewhere. Possible causes: 1. **First correction attempt added AdminMetadata** (without assigner) 2. **Different RDF** was being validated 3. **Cached intermediate result** from a previous run ## Rapid Fix Logic ```python missing = ["language", "content", "adminMetadata"] # For each missing property: if "adminMetadata" in missing: # Check: does AdminMetadata already exist? if "" NOT in content: # NO → Add complete AdminMetadata block (includes assigner) fixes.append(INSTANT_FIXES["adminMetadata"]) else: # YES → Don't add duplicate pass if "assigner" in missing: # Check: does AdminMetadata exist? if "" in content: # YES → Inject assigner into existing AdminMetadata content = inject_assigner(content) else: # NO → Skip (will be added with full adminMetadata block) pass ``` ## What Should Happen with Your Sample **First validation:** ``` Missing: title (structure), language, content, adminMetadata ``` **Rapid fix adds:** - ❌ Title (needs AI - complex structure change) - ✅ language (instant template) - ✅ content (instant template) - ✅ adminMetadata (instant template - INCLUDES assigner already) **Re-validation should show:** - Title structure issue (still present) - NO adminMetadata errors - NO assigner errors (because adminMetadata includes it) ## Key Question **Where did you see the assigner error?** Was it: - A) First validation of your sample? ← Shouldn't happen - B) Re-validation after correction? ← Possible if rapid fix had bug - C) Different RDF file? ← Most likely Check the RDF that produced the assigner error - does it have `` tags?