Skip to content

Fix tool merging logic for memberships with slightly different role values #34

Description

@rmfranken

Currently, the data extraction merges objects/nodes that refer to the same person and organization but may have slightly different values for the membership role property (e.g., 'Ph.D Student' vs 'PhD Student'). This results in multiple conflicting roles under the same membership triple due to node merging.

Task

  • Update the tool logic so that merging nodes does not conflate different role values for the same membership instance.
  • Ensure that, when merging, multiple roles are preserved in a single, consistent way. (Keep the one with most recent date)
  • Add tests covering input with duplicate memberships differing only in case or format and check result for a clear, unambiguous role assignment.

Context/example:
See parent issue: Membership has multiple roles due to merging of nodes

Example:

{
  "@id": "https://orcid.org/0000-0001-5850-0663_https://ror.org/04gyf1771",
  "@type": "org:Membership",
  "org:organization": {
    "@id": "https://ror.org/04gyf1771"
  },
  "org:role": "Ph.D Student",
  ...
},
{
  "@id": "https://orcid.org/0000-0001-5850-0663_https://ror.org/04gyf1771",
  "@type": "org:Membership",
  "org:organization": {
    "@id": "https://ror.org/04gyf1771"
  },
  "org:role": "PhD Student",
  ...
},

This should not result in ambiguous roles on a merged node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions