-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add a method to remove resources from graph #44
Conversation
@claudiu-cristea thank you, its a helpful addition. Would you mind adding a unit test that covers the new code? |
I will add but very busy ATM |
I didn't check it thoroughly, but do you cover the following cases?
If I understand #43 correctly, all existing instances of a given resource are to be removed. Correct? |
If you have these triples:
and I run `$graph->deleteEntireResource('http://example.com/subject/1'); the graph will contain only:
I'm not sure I understand your case |
Lets suppose you have:
After calling |
otherwise it would only removes triples which had given resource as subject, but not predicate or object.
@claudiu-cristea I refined your function based on my last comment. Does it act the way you described it? |
Initially I didn't think about the triples referring the deleted resources. I really don't know whether we need to delete also those triples. I'm thinking that they can be referred from other graphs (???). No strong opinion. However, if we follow those related resources, I think we need to make this optional (i.e., with an option). Let's not rush, I need to reflect more on this |
I guess what you want is to only delete all triples having a given subject. In such a case I would suggest to make it the The tricky part about it is the state of the $graph = new easyrdf\Graph();
$resource = $graph->resource('https://foo'); so it would not any new corner case to the library. The problem with the |
Yes, this is exactly what I need.
Sounds better. I will provide shortly some commits on this direction |
Closed for now to avoid stale PRs. Also, @zozlak made some good points. Please get back to me if you wanna continue here. |
Fixes #43