StateLibraryofOhio / slo_dpla_postprocessing

An application to manage and manipulate XML for upload to DPLA
1 stars 2 forks source link

Need to confirm only 1 occurs of per record for some fields #2

Open fruviad opened 2 years ago

fruviad commented 2 years ago

Some fields are required to have no more than 1 value (e.g. edm:rights).

XSLT should be revised to ensure that data from contributors conforms to this requirement.

An example of a failure when there are multiple values being fed to an XSL stylesheet using current code:

~/XSL/QA/Cleve/p16014coll6$      iiif-blanket-insert.sh  clevepl_p16014coll6-REPOX-transformed-qdc-noDeletes.xml

parameters received; processing data...
Type error at char 23 in expression in xsl:when/@test on line 118 column 32 of iiif-blanket-insert.xsl:
  XPTY0004  A sequence of more than one item is not allowed as the first argument of
  fn:starts-with() ("http://rightsstatements.org/vocab/C...",
  "http://rightsstatements.org/vocab/N...")
  In template rule with match="oai_qdc:qualifieddc" on line 41 of iiif-blanket-insert.xsl
A sequence of more than one item is not allowed as the first argument of fn:starts-with() ("http://rightsstatements.org/vocab/C...", "http://rightsstatements.org/vocab/N...")
clevepl_p16014coll6-REPOX-transformed-qdc-noDeletes_iiif-blanket-added.xml:17229: parser error : Specification mandates value for attribute xmln
                                 xmln
                                     ^
clevepl_p16014coll6-REPOX-transformed-qdc-noDeletes_iiif-blanket-added.xml:17229: parser error : attributes construct error
                                 xmln
                                     ^
clevepl_p16014coll6-REPOX-transformed-qdc-noDeletes_iiif-blanket-added.xml:17229: namespace error : Namespace prefix oai_qdc on qualifieddc is not defined
                                 xmln
                                     ^
clevepl_p16014coll6-REPOX-transformed-qdc-noDeletes_iiif-blanket-added.xml:17229: parser error : Couldn't find end of Start Tag qualifieddc line 17228
                                 xmln
                                     ^
clevepl_p16014coll6-REPOX-transformed-qdc-noDeletes_iiif-blanket-added.xml:17229: parser error : EndTag: '</' not found
                                 xmln
                                     ^
There are 0 records in this set.
0 are viable IIIF records"

The output can be found at:  clevepl_p16014coll6-REPOX-transformed-qdc-noDeletes_iiif-blanket-added.xml

To perform a final review of the output, run:

     review-qdc-conversion.sh  clevepl_p16014coll6-REPOX-transformed-qdc-noDeletes_iiif-blanket-added.xml

~/XSL/QA/Cleve/p16014coll6$
fruviad commented 2 years ago

The following fields in the ODN MAP are cited as "Repeatable: No" and "Required: Yes":

edm:preview, however, is in the category of "required, but only under certain conditions." See also: https://github.com/StateLibraryofOhio/slo_dpla_postprocessing/issues/6

slodplaadmin commented 1 year ago

Basic XSLT logic is in $SLODPLA_LIB/show-rights-problems.xsl and $SLODPLA_LIB/show-title-problems.xsl, which currently spit out pipe-delimited values for the number of occurrences and the corresponding isShownAt URI for those records that do not have 1-and-only-1 of the elements.