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

Script to re prepare submissions for export #599

Conversation

claire-lovisa
Copy link
Contributor

@claire-lovisa claire-lovisa commented Sep 18, 2024

⚠️ TODO: bump prepare-submissions-for-export service once the fix is approved, merged and tagged

Issue

Some submissions have not been flagged for export even though they should have, see here for the details. We need to feed them again to the prepare-submissions-for-export-service for them to be flagged properly, once the fix is merged.

Proposed solution

This is a half-automated solution. Here are the steps.

  1. Get the form data URIs to re-submit
select distinct ?formData where {
  ?submission a <http://rdf.myexperiment.org/ontologies/base/Submission> ;
    <http://www.w3.org/ns/prov#generated> ?formData ;
    <http://purl.org/dc/terms/created> ?created .

  ?formData <http://mu.semte.ch/vocabularies/ext/formSubmissionStatus> <http://lblod.data.gift/concepts/9bd8d86d-bb10-4456-a84e-91e9507c374c> ;
    <http://mu.semte.ch/vocabularies/ext/decisionType> ?firstDecisionType ;
    <http://mu.semte.ch/vocabularies/ext/decisionType> ?secondDecisionType .

  ?firstDecisionType skos:prefLabel ?firstDecisionTypeLabel .
  ?secondDecisionType skos:prefLabel ?secondDecisionTypeLabel .

  FILTER (?firstDecisionType > ?secondDecisionType)

  FILTER NOT EXISTS {
    ?submission <http://schema.org/publication> ?flag.
  }
}
  1. Copy them in the form-data-uris.txt file. I already put in there the URIs found on the current state of the database, but new URIs might land in this wrong state too before we deploy it.

  2. Run the script: ./run.sh <ip-of-prepare-submissions-for-export-container

Expected result

You can use the following query to monitor the submissions with multiple decision types that have not been flagged:

select distinct ?submission ?created ?firstDecisionTypeLabel ?secondDecisionTypeLabel where {
  ?submission a <http://rdf.myexperiment.org/ontologies/base/Submission> ;
    <http://www.w3.org/ns/prov#generated> ?formData ;
    <http://purl.org/dc/terms/created> ?created .

  ?formData <http://mu.semte.ch/vocabularies/ext/formSubmissionStatus> <http://lblod.data.gift/concepts/9bd8d86d-bb10-4456-a84e-91e9507c374c> ;
    <http://mu.semte.ch/vocabularies/ext/decisionType> ?firstDecisionType ;
    <http://mu.semte.ch/vocabularies/ext/decisionType> ?secondDecisionType .

  ?firstDecisionType skos:prefLabel ?firstDecisionTypeLabel .
  ?secondDecisionType skos:prefLabel ?secondDecisionTypeLabel .

  FILTER (?firstDecisionType > ?secondDecisionType)

  FILTER NOT EXISTS {
    ?submission <http://schema.org/publication> ?flag.
  }
}
order by ?submission

During my tests locally, on a copy of prod data, I went from 264 un-flagged submissions to 30 after running the script.

Relates to

  • The story [DL-6182]
  • The fix in prepare-submissions-for-export-service here

@claire-lovisa
Copy link
Contributor Author

Closed because merged manually as a hotfix and then propagated to master and dev branches

@claire-lovisa claire-lovisa deleted the fix/script-to-re-prepare-submissions-for-export branch September 20, 2024 07:44
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