-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix set semantics bug #9
base: master
Are you sure you want to change the base?
Conversation
…added test for passing of the error in the import
I opened this PR for conversation on what to do. I'm starting to doubt that this is actually possible with the rdfjs Store interface. In some way, we need to await the import of each quad into the store to continue to match a new quad to the store. I made a new test that amplifies this problem. |
One solution could be to have a temporary "import store" where we can syncrounously add quads to. When checking if this quad already exists (with the match function) we check both the temporary "import store" and the actual store. If it doesn't exist yet we can add it to both stores. At the end of the stream we can delete the temporary "import store". |
nvm, this would break if there are multiple import streams. If, for example, two simultaneous imports are done with identical quads you would get duplicate results. |
You could work around this, by halting concurrent imports until the other import is done. |
Actually, what you suggest would make the logic quite clean:
|
This does mean that a non ending stream could block imports into the store. |
True, that would be problematic indeed... |
I was implementing this, but I realize now that there is no way of knowing when we should free the synchronous store.
When do we delete the 'synchronous store'? We don't know when the import to the 'actual store' has finished. The only way I know is continuously match the quads to the 'actual store' until the match function returns an element, but this is really inefficient. |
This may be getting too complicated for what it's worth. Maybe we should concede and just assume a synchronous quad-containment checker in the rdf store. As long as it's works with n3 and rdf-stores, it's fine by me :-) |
So I switch from a rdfjs interface to a n3 Store interface? |
Or I switch to a rdfjs dataset interface? |
@maartyman This approach won't work with rdf-stores unfortunately, as that lib doesn't implement DatasetCore directly on the store, but through a separate What we could do instead, is make use of the sync |
Fixes #6