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

Removing relationship to nonexisting object or removing an unknown relationship always returns success #35

Open
giulioturetta opened this issue Nov 23, 2019 · 0 comments
Labels

Comments

@giulioturetta
Copy link
Contributor

Use case: removing orphaned relationships pointing to deleted objects.

Calling curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/relationship/remove" -F "predicate=http://phaidra.org/XML/V1.0/relations#isBackSideOf" -F "object=info:fedora/o:999999999"
returns {"alerts":[],"status":200} even if the object in "object" parameter doesn't exist and the relationship do or do not exist in the subject object of the triple.
This seems to be by Fedora design. Fixing it would require to check if the relationship exists in the subject object and client applications would need to handle the possible error. We can keep it as it is by now, without taking any further action on API.

Moreover the API call returns the same also if predicate value is an unknown relationship like "predicate=foo".
Possible solution: checking if the predicate to be removed is known to API in the relationships set https://github.com/phaidra/phaidra-api/wiki/Relations

The same issue might also occur when adding relationships, making it possible to pollute objects with meaningless relationships.

@giulioturetta giulioturetta changed the title Removing relationship to nonexisting object or removing an unknown relationship always returns success Removing relationship from nonexisting object or removing an unknown relationship always returns success Dec 9, 2019
@giulioturetta giulioturetta changed the title Removing relationship from nonexisting object or removing an unknown relationship always returns success Removing relationship to nonexisting object or removing an unknown relationship always returns success Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant