Skip to content

xref extract: ValueError on capitalized "VerbNet" lex/rolelink resource (only lowercase handled) #13

Description

@aaronstevenwhite

Summary

glazing xref extract aborts with:

✗ Error: Unknown lexlink resource type: VerbNet

(and the symmetric Unknown rolelink resource type: VerbNet for role-level links).

Root cause

In src/glazing/references/extractor.py, _index_propbank_mappings normalizes FrameNet's capitalization variants but matches VerbNet only in lowercase:

# lexlinks (~line 302)
if lexlink.resource == "verbnet":                 # lowercase only
    target_dataset = "verbnet"
elif lexlink.resource in ["FrameNet", "Framenet"]:
    target_dataset = "framenet"
else:
    raise ValueError(f"Unknown lexlink resource type: {lexlink.resource}")

# rolelinks (~line 335) — same asymmetry
if rolelink.resource == "verbnet":
    ...
elif rolelink.resource in ["FrameNet", "Framenet", "framenet"]:
    ...
else:
    raise ValueError(f"Unknown rolelink resource type: {rolelink.resource}")

But the PropBank frame files overwhelmingly use the capitalized form. In propbank-frames/frames/*.xml:

39821 resource="VerbNet"
11322 resource="FrameNet"
11211 resource="AMR"
   56053 resource="PropBank"
    4 resource="Framenet"

And src/glazing/types.py explicitly lists "VerbNet" (capitalized) as a valid ResourceType ("Variant capitalization found in some files"). So a VerbNet lex/rolelink is well-typed data that the extractor nonetheless rejects, falling through to the else and raising.

Reproduction

glazing init
glazing xref extract
# ValueError: Unknown lexlink resource type: VerbNet

Impact

xref extract cannot complete on the standard SemLink-annotated PropBank frames, so no cross-reference index is produced. This blocks any downstream consumer of references/SemLink mappings.

Suggested fix

Normalize VerbNet the way FrameNet is normalized (both branches), e.g.:

if lexlink.resource in ("verbnet", "VerbNet", "Verbnet"):
    target_dataset = "verbnet"

A case-insensitive comparison (or reusing a single normalization helper over the ResourceType variants declared in types.py) would also cover the AMR resource (11,211 occurrences), which would otherwise raise here as well.

Found on glazing==0.3.0.

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