CenterForDigitalHumanities / TPEN-NL

0 stars 0 forks source link

Image URLs and Canvas IDs (As AnnotationList Targets via `on`) #186

Open thehabes opened 2 years ago

thehabes commented 2 years ago

French Images were not loading. The URIs that are failing are like https://iiif.library.utoronto.ca/v2/paleography:1853/full/2000,/0/default.jpg They have changed to https://iiif.library.utoronto.ca/image/v2/paleography:1853/full/2000,/0/default.jpg. the folios table was updated so the French projects would load.

mysql> update folios set uri=replace(uri, "https://iiif.library.utoronto.ca/v2/", "https://iiif.library.utoronto.ca/image/v2/");
update folios set imageName=replace(imageName, "https://iiif.library.utoronto.ca/v2/", "https://iiif.library.utoronto.ca/image/v2/");
Query OK, 463 rows affected (0.02 sec)
Rows matched: 2232  Changed: 463  Warnings: 0

As you may have deduced, much of this revolves around a new PALEO_CANVAS_ID_PREFIX=https://iiif.library.utoronto.ca/presentation/v2/.

The French projects load, but none of them can find their corresponding AnnotationList.

This is how the TPEN-NL app has been generating Canvas IDs in the background String canvasID = man.getProperties().getProperty("PALEO_CANVAS_ID_PREFIX") + f.getImageURL().replaceAll("^.*(paleography[^/]+).*$", "$1");

getByProperties gets the AnnotationList for a given Canvas in a given Project like

 String canvasID = man.getProperties().getProperty("PALEO_CANVAS_ID_PREFIX") + imageURL.replaceAll("^.*(paleography[^/]+).*$", "$1");
 parameter.element("@type", "sc:AnnotationList");
 parameter.element("on", canvasID);
 parameter.element("isPartOf", Integer.toString(projectID));

For "The Art of Cooking", an Italian project... Their AnnotationList.on is https://paleography.library.utoronto.ca/islandora/object/paleography:IP_314_001 Our AnnotationList.on is https://iiif.library.utoronto.ca/presentation/v2/paleography:IP_314_001

For "Acknowledgement of patronage", a French project projectID=1216... Their AnnotationList.on property is https://paleography.library.utoronto.ca/islandora/object/paleography:2084 Our AnnotationList.on property is https://iiif.library.utoronto.ca/presentation/v2/paleography:2084

To make this change, we have to comb the RERUM data for AnnotationLists with an on property that matches the pattern that has changed, and replace that old prefix with the new prefix.

That means this is a two part fix.

  1. Run the MySQL commands to fix the folios table so it has the correct URLs.
  2. Update v1 alpha data so the AnnotationLists (and whatever else!) point to the canvas IDs that the TPEN_NL app will be generating dynamically.
thehabes commented 1 year ago

Alternatively, have TPEN-NL know how to request for AnnotationList.on as https://paleography.library.utoronto.ca/islandora/object/paleography:IP_314_001 OR https://iiif.library.utoronto.ca/presentation/v2/paleography:IP_314_001