template/python.j2: Allow to remove object from object set#55
template/python.j2: Allow to remove object from object set#55benjarobin wants to merge 1 commit intoJPEWdev:mainfrom
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.
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.
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.