You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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
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.
The text was updated successfully, but these errors were encountered: