Skip to content

schema_to_frame emits one subframe per reverse term, so two terms on one reverse IRI make an invalid frame #176

Closed

Description

@simontaurus

Two terms mapped to the same @reverse IRI each get their own subframe, the frame becomes a list, and pyld rejects it.

Material.schema.json declares both chemical_composition and material_composition with
@reverse obo:RO_0000080 in x-oold-context, so the collision appears once a mapping set is
promoted into the @context, not in the default configuration:

0.19.0  frame {"@embed":"@once","chemical_composition":{},"material_composition":{}}
        jsonld.frame raised  invalid frame   Details: {'frame': [{}, {}]}

2.3.0   frame {"@embed":"@once","chemical_composition":{"@embed":"@never"},
                                "material_composition":{"@embed":"@never"}}
        jsonld.frame raised  invalid frame   Details: {'frame': [{'@embed': ['@never']}, {'@embed': ['@never']}]}

Present on 0.18.1, 0.19.0 and 2.3.0, with pyld 2.0.4 and 3.3.0. #164 changed what goes inside the colliding subframes, not that they collide. #165 hands a plain @reverse context term to JSON-LD, so it does not cover this.

Fix: group reverse terms by their reverse IRI and emit one subframe per IRI.

One constraint for whoever writes that subframe: its sub-properties have to be named by expanded IRI. pyld resolves frame keys against the frame's top-level context, not the term's scoped one, so @explicit plus the term name drops the property while the expanded IRI round-trips losslessly.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions