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

fix: don't try to update OAPs of deleted values (DEV-2832) #56

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

jnussbaum
Copy link
Collaborator

No description provided.

@linear
Copy link

linear bot commented Oct 16, 2023

DEV-2832 don't try to update OAPs of deleted value

When updating the OAPs of a resource, all its values must also be updated. For some values, I get the following error in the function _update_permissions_for_value():

2023-10-16 11:13:44,984 oap_get_set.py            ERROR    {'message': 'Error while updating permissions of resource '
            'http://rdfh.ch/0102/Wfa8DFmvTKyOvo86YAdT4w, value '
            'http://rdfh.ch/0102/Wfa8DFmvTKyOvo86YAdT4w/values/1J5losuoTQensgvs6wuVFw',
 'payload': {'context': {'knora-api': 'http://api.knora.org/ontology/knora-api/v2#',
                          'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
                          'rdfs': 'http://www.w3.org/2000/01/rdf-schema#',
                          'scenario-tanner': 'http://api.stage.dasch.swiss/ontology/0102/scenario-tanner/v2#',
                          'xsd': 'http://www.w3.org/2001/XMLSchema#'},
             'id': 'http://rdfh.ch/0102/Wfa8DFmvTKyOvo86YAdT4w',
             'type': 'scenario-tanner:Correspondence',
             'knora-api:DeletedValue': {'id': 'http://rdfh.ch/0102/Wfa8DFmvTKyOvo86YAdT4w/values/1J5losuoTQensgvs6wuVFw',
                                        'type': 'knora-api:DeletedValue',
                                        'knora-api:hasPermissions': 'CR '
                                                                    'http://www.knora.org/ontology/knora-admin#ProjectAdmin|D '
                                                                    'http://www.knora.org/ontology/knora-admin#Creator|V '
                                                                    'http://www.knora.org/ontology/knora-admin#ProjectMember|RV '
                                                                    'http://www.knora.org/ontology/knora-admin#KnownUser,http://www.knora.org/ontology/knora-admin#UnknownUser'}},
 'response_text': '{"knora-api:error":"dsp.errors.NotFoundException: Some '
                  'requested entities were not found: '
                  'http://www.knora.org/ontology/knora-base#DeletedValue","context":{"knora-api":"http://api.knora.org/ontology/knora-api/v2#"}}',
 'status_code': 404}

Apparently, deleted values are retrieved, but an attempt to modify them results in this error.

Solution: skip the deleted values.

@jnussbaum jnussbaum self-assigned this Oct 16, 2023
@jnussbaum jnussbaum changed the title fix: don't try to update OAPs of deleted values fix: don't try to update OAPs of deleted values (DEV-2832) Oct 16, 2023
@jnussbaum jnussbaum merged commit 508c6ad into main Oct 16, 2023
1 check passed
@jnussbaum jnussbaum deleted the wip/dev-2832-deleted-values branch October 16, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant