Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Union/merge operator and the unique names assumption #22

Open
hayesall opened this issue Apr 13, 2022 · 0 comments
Open

Union/merge operator and the unique names assumption #22

hayesall opened this issue Apr 13, 2022 · 0 comments

Comments

@hayesall
Copy link
Member

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant