You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of our digitisation project, the file_path includes a zero-padded running number (aka ordinal) for the image files within a piece or item. Using concat within starts and ends expressions, plus some regex allows fairly tight validation of the fact the file_path has been built up as expected eg
file_path: starts(concat("file:///",$department,"",$series,"/",$piece,"/",$item,"/",$piece,"",$item,"")) and regex("^.*[0-9]{1,4}.jp2$") and ends(concat($ordinal,".jp2"))
but there is still a small chance that there might be some digit other than zeroes before the ordinal at the end of filename (before the jp2 extension).
if we had a zero padding expression, something like zeroPad($ordinal,4) would return a string provider padded with leading zeroes sufficient to make the string 4 characters long, eg zeroPad(5,4) would produce 0005 while zeroPad(10,4) would give 0010 and zeroPad(104,4) would give 0104.
A full validation of the file_path might then look like:
In the case of our digitisation project, the file_path includes a zero-padded running number (aka ordinal) for the image files within a piece or item. Using concat within starts and ends expressions, plus some regex allows fairly tight validation of the fact the file_path has been built up as expected eg
file_path: starts(concat("file:///",$department,"",$series,"/",$piece,"/",$item,"/",$piece,"",$item,"")) and regex("^.*[0-9]{1,4}.jp2$") and ends(concat($ordinal,".jp2"))
but there is still a small chance that there might be some digit other than zeroes before the ordinal at the end of filename (before the jp2 extension).
if we had a zero padding expression, something like zeroPad($ordinal,4) would return a string provider padded with leading zeroes sufficient to make the string 4 characters long, eg zeroPad(5,4) would produce 0005 while zeroPad(10,4) would give 0010 and zeroPad(104,4) would give 0104.
A full validation of the file_path might then look like:
file_path: starts(concat("file:///",$department,"",$series,"/",$piece,"/",$item,"/",$piece,"",$item,"_",zeroPad($ordinal,4),".jp2"))
The text was updated successfully, but these errors were encountered: