Skip to content

Union/merge operator and the unique names assumption #22

@hayesall

Description

@hayesall

Imagine merging to sets of objects with conflicting names.

For example, two people named "alex":

obj1 = RelationalDataset(pos=['a(alex).'], neg=[], facts=['b(alex).', 'c(alex).'])
obj2 = RelationalDataset(pos=['a(alex).'], neg=[], facts=['b(alex).'])

The interpretation is ambiguous, so should probably result in an error/warning:

>>> obj1 | obj2
UniqueNamesAssumptionError: Found 'alex' in `obj1` and `obj2`

If you:

  • know these refer to separate entities
  • know these refer to the same entities

Then there possible ways to handle this:

>>> with DifferentObjects:
...     obj1 | obj2
RelationalDataset(pos=['a(alex1).', 'a(alex2).'], neg=[], facts=['b(alex1).', 'c(alex1).', 'b(alex2).'])
>>> with SameObjects:
...     obj1 | obj2
RelationalDataset(pos=['a(alex).'], neg=[], facts=['b(alex).', 'c(alex).'])

See also:

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