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

Problem: In pointer file, ID refs are AIP names instead of UUIDs with non-numeric prefixes #660

Closed
evelynPM opened this issue Apr 18, 2019 · 5 comments
Assignees
Milestone

Comments

@evelynPM
Copy link

Expected behaviour
ID refs should have a non-numeric prefix to conform to NCName requirements. For example, in the AIP METS file an ID ref in the fileSec is "file-UUID", like this:

'<mets:file GROUPID="Group-869d9b1c-0a7b-4061-8832-75430086015b" ID="file-869d9b1c-0a7b-4061-8832-75430086015b" ADMID="amdSec_1">'

Current behaviour
In the AIP pointer file the ID refs are just the AIP names with UUIDs appended, like this:

'<mets:file ID="MyAIP-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5" GROUPID="Group-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5" ADMID="amdSec_733264">'

In this case the pointer file will still validate because the AIP name happens to start with letters instead of numbers. However, if the AIP name starts with a number, the pointer file will fail validation. Here is some sample validation output for an AIP named "1920-2":
-line 166, column 142: cvc-datatype-valid.1.2.1: '1920-2-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5' is not a valid value for 'NCName'.
-line 166, column 142: cvc-attribute.3: The value '1920-2-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5' of attribute 'ID' on element 'mets:file' is not valid with respect to its type, 'ID'.
-line 174, column 72: cvc-datatype-valid.1.2.1: '1920-2-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5' is not a valid value for 'NCName'.
-line 174, column 72: cvc-attribute.3: The value '1920-2-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5' of attribute 'FILEID' on element 'mets:fptr' is not valid with respect to its type, 'IDREF'.

Steps to reproduce
Create an AIP with a number for the AIP name and validate the pointer file.

Your environment (version of Archivematica, OS version, etc)
AM 1.9.1 sandbox


For Artefactual use:
Please make sure these steps are taken before moving this issue from Review to Verified in Waffle:

  • All PRs related to this issue are properly linked 👍
  • All PRs related to this issue have been merged 👍
  • Test plan for this issue has been implemented and passed 👍
  • Documentation regarding this issue has been written and it has been added to the release notes, if needed 👍
@ross-spencer
Copy link
Contributor

Related, possible duplicate of: #380

@evelynPM
Copy link
Author

As a solution I would suggest replacing the AIP name in ID refs with file-, just like we do for AIP METS files. So instead of '<mets:file ID="MyAIP-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5" GROUPID="Group-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5" ADMID="amdSec_733264">'we should have '<mets:file ID=file-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5" GROUPID="Group-23e81b05-db90-4f0d-bfc3-96eb65dc4ba5" ADMID="amdSec_733264">'. This is a reasonable solution because the AIP is being described as a single file in the pointer file (i.e. a zipped package).

@ross-spencer
Copy link
Contributor

ross-spencer commented May 29, 2019

@joel-simpson @sromkey this seemed to escape the addition of the 1.10 milestone Monday but believe the result was to be added.

@ross-spencer
Copy link
Contributor

Having analysed this in a little more detail, the change needs to be made to both the Storage Service and mets-reader-writer.

In the storage service, the filegrp is generated with this instantiation of mets-reader-writer.

Which refers to this init method. And then the derivation for the file id happens here.

The mets-reader-writer constructor is getting a little busy though, so this (as a design pattern) might need to be discussed further/revisited again in future.

@ross-spencer ross-spencer added the Status: blocked Work on the issue is not possible until the blocking condition is removed. label Jun 7, 2019
@ross-spencer
Copy link
Contributor

ross-spencer commented Jun 7, 2019

@ross-spencer ross-spencer removed the Status: blocked Work on the issue is not possible until the blocking condition is removed. label Jun 21, 2019
@ross-spencer ross-spencer added Status: review The issue's code has been merged and is ready for testing/review. and removed Status: in progress Issue that is currently being worked on. labels Jun 25, 2019
@sallain sallain assigned evelynPM and unassigned ross-spencer Jul 8, 2019
@evelynPM evelynPM removed the Status: review The issue's code has been merged and is ready for testing/review. label Jul 9, 2019
@evelynPM evelynPM closed this as completed Jul 9, 2019
@sallain sallain added Type: documentation The issue requires documentation. and removed size: 2 labels Jul 15, 2019
@sallain sallain removed the Type: documentation The issue requires documentation. label Aug 20, 2019
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

No branches or pull requests

5 participants