-
Notifications
You must be signed in to change notification settings - Fork 8
template/python.j2: Allow to remove object from object set #55
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
base: main
Are you sure you want to change the base?
Conversation
For simplicity, rebuild the index from scratch instead of trying to remove the object from the index.
| """ | ||
| Remove object from object set | ||
| Remove a SHACLObject from the object set and rebuild index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is fine. Just keep in mind the object might still be in the graph if it's referenced indirectly by another object
Rebuilding the whole index is probably the safest for now; I don't expect this to be a very common operation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JPEWdev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, please add some tests :)
|
Sorry for the response delay. But I don't really like the current implementation. This is not great, indeed, if we remove an object still referenced by another element in the graph, this will break everything. I submitted it way too early... |
I don't think the current implementation is completely useless; even if you wanted to do a more thorough removal, you'd still need to do this step to make sure the object wasn't in the root of the object set; this just doesn't do all of what you want. I don't really want SPDX specific APIs in here, but if you can come of with a generic way of implementing it (which I suspect isn't really that different from what you'd be doing anyway), I'd be fine with adding an API in here for that; maybe like a |
|
For information I do not plan to work on it in the short term: I am quite busy... |
|
NP. We can leave this open is case you want to come back around to it. |
For simplicity, rebuild the index from scratch instead of trying to remove the object from the index.
But maybe we should try to be clever, and only update the index without rebuilding it.