Skip to content

Blank NVS altLabel (R41 tombstone R4100053) makes empty PROGRAM_NAME a warning instead of an error #58

Description

@killett

Summary

ArgoNVSReferenceTableParser.resolveMembers indexes every collection member by
altLabel and prefLabel without checking for blank labels. NVS retires a
concept by keeping it in the collection and clearing its label, so a retired
concept becomes the map entry for "". An empty PROGRAM_NAME in a meta file
then matches a real concept and is reported as a warning instead of an error,
and the file is still FILE-ACCEPTED.

Cause

Commit 1520a0a ("Replace R41.jsonld", 2026-06-04) retired R4100053,
formerly Argo ROMANIA:

"skos:altLabel": "",
"skos:prefLabel": { "@language": "en", "@value": "Concept created in error" },
"owl:deprecated": "true"

In ArgoMetadataFileValidator.checkParameterValueAgainstRefTable,
refTable.get("") now returns that concept, so the isDeprecated() branch
fires instead of the "not in reference table" branch.

Reproduce

On a clean main checkout:

cd file_checker_exec && ./mvnw verify

validateProgramNameCheckInMetaFileIT.fileChecker_ShouldRaiseWarning_WhenBadProgramNameValue
fails. Actual output for 1902735_meta_empty_programName.nc:

<warning>PROGRAM_NAME: '' Status: Deprecated</warning>

Expected:

PROGRAM_NAME: '' Status: Invalid (not in reference table)

The test dates from 2025-12-16, before R41 handling was added in 4f01384
(2026-03-25). It appears to have been failing since the June table update.

Scope

ArgoNVSReferenceTable.RELEVANT_TABLES routes 26 collections through this same
line, so any future retirement in any table reopens the same hole. A scan of
file_checker_spec/NVS/*.jsonld currently finds exactly one blank label
(R41::R4100053), so today only PROGRAM_NAME is affected.

Proposed fix

Skip null and blank labels when building the two label indexes. Concepts remain
resolvable by id, so skos:related / narrower / broader lookups are
unaffected.

putIfLabelled(collection.getConceptMembersByAltLabelMap(), conceptMember.getAltLabel(), conceptMember);
putIfLabelled(collection.getConceptMembersByPrefLabelMap(), conceptMember.getPrefLabel(), conceptMember);
private void putIfLabelled(Map<String, SkosConcept> map, String label, SkosConcept concept) {
    if (label != null && !label.trim().isEmpty()) {
        map.put(label, concept);
    }
}

(trim().isEmpty() rather than isBlank(), since the build targets Java 8.)

With this change the full suite passes: Tests run: 67, Failures: 0, Errors: 0.

Branch: https://github.com/killett/ArgoFormatChecker/tree/fix/blank-nvs-label-tombstone

I would have opened a PR, but this repository restricts pull requests to
collaborators. Happy to have the commit cherry-picked, or to submit it another
way.

Aside

R41's dc:description states that PROGRAM_NAME is populated by R41
prefLabel, but the failure shows the value being matched against the
altLabel map. That may be intentional; flagging it separately since it does not
affect this fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions