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

Add queries to remove organizations #601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Riadabd
Copy link
Contributor

@Riadabd Riadabd commented Oct 4, 2024

Ticket ID

OP-3124 + OP-3125

PR Description

⚠️ DO NOT MERGE INTO DEV OR MASTER!

Once approved, it has to go into a hotfix release as long as the LMB cutover has not been performed yet.

This PR removes unneeded organizations; it is similar to lblod/app-organization-portal#451.

How to Test

If possible, try to run a production backup, run the migrations and inspect the important URIs to see if they have successfully deleted (e.g., bestuurseenheid URI, person + account URIs, conversations + messages + file URIs).

@Riadabd Riadabd requested a review from claire-lovisa October 11, 2024 08:43
Copy link
Contributor

@claire-lovisa claire-lovisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how far you want to go but there are also the files such as

  ?fileDataObject a <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject> ;
    <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#dataSource> ?file .

that don't seem to be deleted here !

@Riadabd
Copy link
Contributor Author

Riadabd commented Oct 11, 2024

I remember discussing this with Felix, and I think the idea was to leave these entities intact and only delete ?file ?p ?o. Given that these file data objects contain useful data such as the filename, file size and such, we can use them if we end up implementing something that deletes files completely (both virtual and physical files).

The way we would do it in that case would be to query file data objects that have an empty data source:

  ?fileDataObject a <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject> ;
    <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#dataSource> ?file .
  
  FILTER NOT EXISTS { ?file ?p ?o }

The results we get are then files that we know were deleted at a previous point in time and can now be safely fully removed from the system.

@claire-lovisa claire-lovisa self-requested a review October 14, 2024 07:24
@Riadabd Riadabd self-assigned this Nov 7, 2024
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.

2 participants