Skip to content

Mirador Search and Annotations (Prototype)

Kyle Huynh edited this page Dec 19, 2022 · 32 revisions

Mirador Search and Annotations

Please note, the following instructions are to setup a prototype. Not intended for production setup.

Setup

  1. Install and run Simple Annotation Server.
  2. Change the Islandora IIIF (iiif_vew_manifest) branch to search.
  3. Change the Islandora Mirador (islandora_mirador) branch to annotations.
    1. This branch includes a built version of Mirador Viewer in js/dist. If you want to make changes to Mirador such as changing the plugins, you will have to rebuild using Mirador integration for Omeka (sas branch), then replace the files.

Config

  1. Set the Search API URL in Islandora IIIF config (found at admin/config/islandora/iiif). http://localhost:8888/search-api/[manifest_id]/search will work with default setup for Simple Annotation Server.
  2. Set the Annotation API URL in Islandora Mirador config. You must set the URL in both the admin config (found at admin/config/media/mirador) and the config for the block (found at admin/structure/block/manage/miradorblock?destination=/admin/structure/block).http://localhost:8888/annotation will work with default setup for Simple Annotation Server.
  3. Create and/or add field_manifest_id field to repository objects.

Indexing With SAS

  1. Navigate to node/[nid]/book-manifest, where nid is the node id of the node you wish to annotate. (ie. http://localhost:8000/node/12/book-manifest).
  2. Navigate to http://localhost:8888/uploadManifest.xhtml (Index Manifest URL) in Simple Annotation Server and enter the book manifest URL(s)
  3. If step 2 is successfully, copy the manifest ID (found in the URL of the page after manifest=) and enter it in the field_manifest_id of the corresponding node. Previously indexed manifests can be viewed under View Annotations in the Simple Annotation Server.
  4. In a book manifest (ie. http://localhost:8000/node/12/book-manifest), find the canvas URL(s). They should look something like https:\/\/islandora.traefik.me\/node\/[nid]\/canvas\/[mid].
  5. Get input.json for step 6 below at https://cloud.google.com/vision/docs/drag-and-drop, by downloading an page image, and drop it in the UI, copy the response json as input.json, proceed to step 6
  6. Get annotation list of Google Cloud Vision OCR using gcv2annotationList. Make sure that the canvas URL (You will have to remove the backslashes used to escape the slash characters.) is correct because this is what Simple Annotation Server uses to associate the annotations with the canvas.
  7. Navigate to Load Annotation List (http://localhost:8888/populate.xhtml) in Simple Annotation Server and enter the URL of the annotation list. You can use a file URI (e.g. file:///path/to/file).

Troubleshooting

Simple Annotation Server is hanging on Index Manifest

  • Check the console for CORS blocking requests. This is not currently resolved with the server so you will have to install an extension to turn those off.

Annotation / Search are not showing up in Mirador Viewer

  • Check for CORS blocking requests. See above.
  • Check that you have the correct branch of Islandora Mirador checked out.
  • Annotation and Search tabs will not show up in the Mirador Viewer if the URLs are not configured in the module or block settings.

Setup Simple Annotation Server with Solr

  1. Download Simple Annotation Server repository: git clone https://github.com/digitalutsc/SimpleAnnotationServer.git /opt

Create a new Solr core for annotations

  1. Tried the following commands on the playbook:
cd /opt/solr
mkdir -p server/solr/annotations/data
cp -r ../SimpleAnnotationServer/src/main/resources/solr/* server/solr/annotations/
  1. Change the domain name in the sas.properties from localhost to DNS of Solr
sudo nano /opt/SimpleAnnotationServer/src/main/webapp/WEB-INF/sas.properties
  1. Copy the configs which provided by SimpleAnnotationServer for annotation core:
sudo mkdir -p /var/solr/data/annotations/conf
sudo cp -r /opt/solr/server/solr/annotations /var/solr/data/annotations
  1. Create an annotations core
cd /opt/solr
sudo chown -R solr:solr /var/solr
sudo -u solr bin/solr create -c annotations -p 8983

5a. For development, run the build of SimpleAnnotationServer, the server should be up running.

cd /opt/SimpleAnnotationServer
sudo mvn jetty:run

5b. For deployment (for UTSC-DSU only), download the following war file (TBD) then run:

sudo java -jar /opt/sas/dependency/jetty-runner.jar --port 8888 /opt/sas/simpleAnnotationStore_dsu_utsc.war &

Build

Tryout the demo

  1. Clone and run islandora playbook (https://github.com/digitalutsc/islandora-playbook/tree/mirador_annotation), branch mirador_annotation
git clone -b mirador_annotation https://github.com/digitalutsc/islandora-playbook.git
cd islandora-playbook
vagrant up
  1. After the playbook installation is completed. Run the ingest sample objects by following the steps with https://github.com/digitalutsc/islandora_lite_docs/wiki/8.-Ingesting-Content
  • Note:: In the section "Execute task", run these two commands below instead:
islandora_workbench$ ./workbench --config islandora_workbench_lite/create_islandora_object-for-playbook.yml
islandora_workbench/islandora_workbench_lite$ ./workbench_islandora_lite --config create_islandora_media-for-playbook.yml
  1. Access to the playbook with ssh by:
vagrant ssh
  1. Apply the reversed proxy by following these steps at https://github.com/digitalutsc/islandora-playbook/blob/mirador_annotation/reverse_proxy.md

    Important Note: If images are not loading in Mirador viewer or Openseadragon viewer, reboot the playbook by vagrant halt or sudo reboot (inside the playbook)

  2. Download Mirador sample configs

cd /opt 
sudo git clone https://github.com/digitalutsc/mirador_annotation_configs.git 
cd /opt/mirador_annotation_configs/scripts && sudo chmod +x *.sh && sudo ./deploy_annotation.sh

Code: https://github.com/digitalutsc/mirador_annotation_configs/blob/main/scripts/deploy_annotation.sh

  1. Start Simple Annotation Server
sudo java -jar /opt/sas/dependency/jetty-runner.jar --port 8888 /opt/sas/simpleAnnotationStore.war &
  1. Index outcome from Google Vision API for the sample book to Simple annotation Server
sudo ./gen_annotation_list.sh {{ path }}/gcv2annotationList {{ path }}/{{ Spreadsheet has OCR json }}.csv {{ path of output json files }} {{ Drupal account's username }} {{ Drupal account's password }}

Code: https://github.com/digitalutsc/mirador_annotation_configs/blob/main/scripts/gen_annotation_list.sh

  1. Visit the book http://localhost:8000/node/12 OR http://localhost:8000/node/38, Full screen the mirador viewer and switch to annotation tab one the left side to see the annotation.

    Important note: Currently, there are some issues which prevent tile images loaded in Mirador viewer, while logging in. If so, please logout and then revisit the two books http://localhost:8000/node/12 OR http://localhost:8000/node/38

Screen Shot 2022-07-22 at 7 25 47 AM