File size: 2,549 Bytes
a40763c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# Debug: Understanding the Validation Flow
## Your Sample RDF
```xml
<bf:Work rdf:about="http://example.org/work/invalid-1">
<rdf:type rdf:resource="http://id.loc.gov/ontologies/bibframe/Text"/>
<bf:title>Incomplete Title</bf:title>
</bf:Work>
```
## 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 "<bf:adminMetadata>" 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 "<bf:AdminMetadata>" 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 `<bf:adminMetadata>` tags?
|