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

accumulateSubjects should deduplicate URIs #29

Open
josephguillaume opened this issue Sep 13, 2023 · 0 comments
Open

accumulateSubjects should deduplicate URIs #29

josephguillaume opened this issue Sep 13, 2023 · 0 comments

Comments

@josephguillaume
Copy link
Contributor

josephguillaume commented Sep 13, 2023

I have a situation where a statement is repeated in two different documents and the URI is therefore repeated as a subject. Currently when reverseRelations is called, the URI is included twice.
A minimal test case could use a store with statements with two graphs. Other situations may also appear where a URI is duplicated.

This is because accumulateSubjects does not perform any kind of deduplication.
https://github.com/pod-os/PodOS/blob/main/core/src/thing/accumulateSubjects.ts

Presumably the fix is for either accumulateSubjects or reverseRelations to use a Set.
The same issue likely exists in the other similar functions.

A workaround is for the user to perform deduplication themselves

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