Skip to content

wisdom: ONE_TO_MANY relationships lose direction on round-trip #425

Description

@christianeu-db

Summary

A Wisdom ONE_TO_MANY relationship round-trips (Wisdom->Ossie->Wisdom) to MANY_TO_ONE. The forward path sets no ai_context marker for ONE_TO_MANY (unlike ONE_TO_ONE / MANY_TO_MANY), and the reverse path defaults unmarked relationships to MANY_TO_ONE.

Root cause

Forward wisdom_to_ossie.py: the ONE_TO_MANY branch swaps from/to but leaves ai_context=None. Reverse ossie_to_wisdom.py: only one-to-one / many-to-many markers are recognized; default is MANY_TO_ONE.

Repro (real converters, HEAD ab8fc1a — EXECUTED)

Using fixture tests/fixtures/sample_export.json through both converters:

original wisdom relationshipTypes: ['MANY_TO_ONE','ONE_TO_MANY','MANY_TO_MANY','MANY_TO_ONE','MANY_TO_ONE']
after Wisdom->Ossie->Wisdom:       ['MANY_TO_ONE','MANY_TO_ONE','MANY_TO_MANY','MANY_TO_ONE']

The ONE_TO_MANY at index 1 becomes MANY_TO_ONE. (Also note the relationship count dropped 5->4 in this fixture run — worth a look, but out of scope for this issue.) The wrong result is also enshrined in tests/test_ossie_to_wisdom.py::test_relationship_types_restored.

Potential fix

Emit ai_context = "one-to-many relationship" in the forward path; add an elif ...startswith("one-to-many") branch in reverse; update the test expectation.

Scope / caveats

ONE_TO_ONE / MANY_TO_MANY unaffected. From/to swap is correct; only the semantic label is lost. Fixing requires the test update.

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