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

PendingStream and internal store get out of sync due to set-semantics #6

Closed
maartyman opened this issue Sep 22, 2023 · 1 comment · Fixed by #7 · May be fixed by #9
Closed

PendingStream and internal store get out of sync due to set-semantics #6

maartyman opened this issue Sep 22, 2023 · 1 comment · Fixed by #7 · May be fixed by #9
Labels
bug Something isn't working

Comments

@maartyman
Copy link
Collaborator

maartyman commented Sep 22, 2023

An RDF store assumes set-semantics meaning it will ignore duplicate triples. Currently, the PendingStream does not comply to set-semantics and will push duplicate triples.

In essence, a match call to the store before and after a duplicate triple will not be the same.

@rubensworks rubensworks added the bug Something isn't working label Sep 22, 2023
@maartyman
Copy link
Collaborator Author

A test for this issue:

it('handles duplicates in import (set-semantics)', async() => {
  const match = store.match();
  await promisifyEventEmitter(store.import(streamifyArray([
    quad('s1', 'p1', 'o1'),
    quad('s1', 'p1', 'o1'),
  ])));
  store.end();

  expect(await arrayifyStream(match)).toEqualRdfQuadArray(await arrayifyStream(store.getStore().match()));
});

@maartyman maartyman linked a pull request Oct 25, 2023 that will close this issue
rubensworks pushed a commit that referenced this issue Jan 11, 2024
@rubensworks rubensworks reopened this Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants