Mirador 4 Plugin Development: Rotating Images at Arbitrary Angles

Overview I created a plugin for Mirador 4 that allows rotating images at arbitrary angles. https://github.com/nakamura196/mirador-rotation-plugin You can check the behavior at the following URL. https://nakamura196.github.io/mirador-rotation-plugin/ Background I had been developing this plugin for Mirador 3, but Mirador 4 was pre-released on 2024/3/15. https://github.com/ProjectMirador/mirador/releases/tag/v4.0.0.alpha-1 The latest version of Mirador 3, v3.3.0, was released in 2021, so the libraries it used had become outdated. With this update, development has become easier. ...

June 27, 2024 · 2 min · Nakamura

Publishing a Customized Mirador 4 as an npm Package

Overview I had the opportunity to publish a customized Mirador 4 as an npm package, so this is a memo of the process. Fork Fork the repository from the following official site. https://github.com/projectmirador/mirador The result looks like this: Create a Branch Clone and create a branch. git clone https://github.com/nakamura196/mirador cd mirador git checkout -b feature-add-immediately-property The following output appears: Switched to a new branch 'feature-add-immediately-property' Development Make modifications as introduced in the following article. ...

June 27, 2024 · 2 min · Nakamura

Examining Zoom, Scale, and Rotation Behavior in Mirador 4

Overview I needed to change the zoom, scale, and rotation behavior of Mirador 4, so this is a memo on how to make those changes. Setup Start Mirador 4 locally with the following commands. git clone https://github.com/projectmirador/mirador cd mirador pnpm i pnpm start It starts on port 4444. Customizing the zoomIn Processing As an example, let’s modify the processing when the zoomIn button is clicked as follows. ... handleZoomInClick() { const { windowId, updateViewport, viewer } = this.props; updateViewport(windowId, { // zoom: viewer.zoom * 2, zoom: viewer.zoom * 1.1, // added rotation: viewer.rotation + 5, // added x: viewer.x * 1.1, // added y: viewer.y * 1.1, // added }); } ... As a result, when pressing the zoomIn button, you can see that zoom and rotation occur while the center shifts slightly. ...

June 26, 2024 · 3 min · Nakamura

Running LEAF-Writer in a Local Environment

Overview I had the opportunity to run LEAF-Writer in a local environment, so here are my notes. Repository The following repository is used. https://gitlab.com/calincs/cwrc/leaf-writer/leaf-writer Method git clone https://gitlab.com/calincs/cwrc/leaf-writer/leaf-writer cd leaf-writer npm i npm run dev LEAF-Writer starts on port 3000. Summary There also seems to be a method using Docker, so I will share it once I figure it out.

June 26, 2024 · 1 min · Nakamura

Publishing Materials on Zenodo

Overview I registered materials on Zenodo as part of learning how to use it, so here are my notes. The DOI assigned to the registered material is: https://zenodo.org/doi/10.5281/zenodo.12508032 DOI Regarding DOIs, there is one that accesses the latest version and ones assigned to each version. The DOI above is the former. Version 1 is: https://zenodo.org/doi/10.5281/zenodo.12508033 For more information about versioning, please also refer to the following article: Versioning It seems unnecessary to change the version unless you add or update files. When I uploaded a PDF, a DOI was assigned, and even after subsequently editing the metadata, the version did not change. ...

June 25, 2024 · 5 min · Nakamura

Verifying the Behavior of Mirador 2 Plugins

Overview I created a repository for verifying the behavior of Mirador 2 plugins. https://github.com/nakamura196/mirador2-plugins-demo You can try it from the following URL. https://nakamura196.github.io/mirador2-plugins-demo/ A working example with sample data is as follows. https://nakamura196.github.io/mirador2-plugins-demo/?manifest=https://nakamura196.github.io/mirador2-sync-windows/data/examples/org.json;https://nakamura196.github.io/mirador2-sync-windows/data/examples/inf.json The purpose of creating this repository was to verify the behavior of plugins developed for Mirador 2 in order to port them to Mirador 3. Plugins mirador-sync-windows The mirador-sync-windows plugin introduced in the following article is enabled. ...

June 25, 2024 · 1 min · Nakamura

Handling nbdev Errors on macOS

Overview When using nbdev on macOS, the following error occurred. nbdev_prepare objc[48348]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. objc[48348]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. Traceback (most recent call last): ... concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending. This is a personal note on addressing this error. ...

June 24, 2024 · 2 min · Nakamura

Applied Examples of Data Description Using Linked Data

Overview I have written the following articles related to RDF. I tried visualizing these together, so here are my notes. Data The following data was used this time. I described information such as: a person named “Satoru Nakamura (0000-0001-8245-7925)” is interested in “Thirty-Six Views of Mount Fuji: Fine Wind, Clear Morning (cobas-166407)” held by the Tokyo National Museum, and its creator is “Katsushika Hokusai.” The TTL description is as follows. ...

June 23, 2024 · 3 min · Nakamura

Developing a Zoom Disable Plugin for Mirador 3 (4)

Overview I created a plugin for Mirador 3 (actually Mirador 4) that disables zoom operations. https://github.com/nakamura196/mirador-disable-zoom/ Here is a demo video. https://youtu.be/RN2V4b7IYoI You can try it at the following URL. https://nakamura196.github.io/mirador-disable-zoom/ This plugin is based on the following plugin created by UCLA Library for Mirador 2. https://github.com/UCLALibrary/mirador-disable-zoom This time, I will note some findings from developing this plugin. Specifying the Target The target property allows you to specify where to place the plugin button. In this case, by specifying WindowTopBarPluginArea, I was able to display the icon directly on the per-window bar. ...

June 23, 2024 · 2 min · Nakamura

Using prefix.cc

Overview This is a memo about trying prefix.cc for resolving prefixes in RDF data. https://prefix.cc/ Namespace Lookup API This is a service that allows you to retrieve URIs by providing a prefix. https://prefix.cc/about/api For example, providing the following: https://prefix.cc/foaf.file.json Returns the following result. { "foaf": "http://xmlns.com/foaf/0.1/" } Reverse Lookup API For example, providing the following: https://prefix.cc/reverse?uri=http://xmlns.com/foaf/0.1/&format=json Returns the same JSON result as above. Adding New Entries The following jps prefix used by Japan Search was not available. ...

June 23, 2024 · 1 min · Nakamura

Notes on Adding and Visualizing RDF Data

Overview This article explains the process of converting data created with Microsoft Visio to RDF format, and the method for adding RDF data when a specific URI (in this case, a Japan Search URI containing information about Katsushika Hokusai) is specified. We introduce techniques for handling Visio data in RDF format through the conversion process, and present the results of incorporating information about Katsushika Hokusai as a concrete example. Background In the following article, I introduced an example of converting data created with Microsoft Visio to RDF: ...

June 23, 2024 · 2 min · Nakamura

Retrieving RDF from URIs Using Content Negotiation in Python

Overview I had an opportunity to retrieve RDF data from Wikidata entity URIs, so here are my notes. Without Content Negotiation First, make a request with empty headers as follows. import requests # URL for the Wikidata entity in RDF format url = "http://www.wikidata.org/entity/Q12418" headers = { } # Sending a GET request to the URL response = requests.get(url, headers=headers) # Checking if the request was successful if response.status_code == 200: text = response.text print(text[:5000]) else: print("Failed to retrieve RDF data. Status code:", response.status_code) In this case, you can retrieve text data in JSON format as follows. ...

June 23, 2024 · 2 min · Nakamura

Created an M3 Version of mirador-sync-windows

Overview In the following article, I introduced mirador-sync-windows, a plugin for Mirador 2. This time, I updated the above functionality for Mirador 3 (actually Mirador 4). The behavior is still somewhat unstable, but you can try it at the following link. https://mirador-sync-windows.vercel.app/ Deploying to Vercel Development was based on the Mirador 4-compatible branch of the mirador-image-tools plugin. https://github.com/ProjectMirador/mirador-image-tools/tree/mirador4-compat-clean The above project provides the following commands: { ... "scripts": { "build": "npm run build:umd", "build:demo": "NODE_ENV=development webpack --mode=development", "build:umd": "NODE_ENV=production webpack --mode=production", "build:es": "mkdir -p es && cp -r src/* es && NODE_ENV=production MODULE_FORMAT=es npx babel es -d es", "build:cjs": "mkdir -p lib && cp -r src/* lib && NODE_ENV=production MODULE_FORMAT=cjs npx babel lib -d lib", "clean": "rm -rf ./umd && rm -rf ./es && rm -rf ./lib && rm -rf ./demo/dist", "lint": "eslint ./src ./__tests__", "prepublishOnly": "npm run clean && npm run build:es && npm run build:cjs && npm run build", "start": "NODE_ENV=development webpack serve --open", "test": "npm run lint && jest", "test:coverage": "jest --coverage", "test:watch": "jest --watch" }, ... } Based on the above commands, I modified the Vercel deployment settings as follows: ...

June 21, 2024 · 2 min · Nakamura

Trying iiif-prezi3

Overview As IIIF Presentation API 3 becomes more widespread, I found it increasingly difficult to understand the specification and create JSON files directly. So I tried using the following Python library, and this is a note for reference. https://github.com/iiif-prezi/iiif-prezi3 I used this library for converting the data published on the Toji Hyakugo Monjo WEB to IIIF, as introduced in the following article. The source code may be hard to read, but it is also published in the following repository, and I hope it is helpful. ...

June 19, 2024 · 2 min · Nakamura

Running Archivematica with Docker

Overview For starting Archivematica, using Docker was the easiest method. Installation instructions are documented at the following link. https://github.com/artefactual/archivematica/tree/qa/1.x/hack Following the steps worked well for installation, but I am documenting the points where I encountered failures as a memo. Elasticsearch container When starting the Elasticsearch container, instructions were given to set vm.max_map_count. https://github.com/artefactual/archivematica/tree/qa/1.x/hack#elasticsearch-container If this setting is forgotten, the Elasticsearch container would not start, as shown below. docker compose up [+] Running 10/0 ✔ Container am-mysql-1 Running 0.0s ✔ Container am-archivematica-storage-service-1 Running 0.0s ✔ Container am-nginx-1 Running 0.0s ✔ Container am-clamavd-1 Running 0.0s ✔ Container am-elasticsearch-1 Created 0.0s ✔ Container am-fits-1 Running 0.0s ✔ Container am-gearmand-1 Running 0.0s ✔ Container am-archivematica-mcp-client-1 Running 0.0s ✔ Container am-archivematica-dashboard-1 Created 0.0s ✔ Container am-archivematica-mcp-server-1 Running 0.0s Attaching to archivematica-dashboard-1, archivematica-mcp-client-1, archivematica-mcp-server-1, archivematica-storage-service-1, clamavd-1, elasticsearch-1, fits-1, gearmand-1, mysql-1, nginx-1 elasticsearch-1 | [2024-06-18T02:16:40,373][INFO ][o.e.e.NodeEnvironment ] [am-node] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/root)]], net usable_space [11.4gb], net total_space [48.2gb], types [ext4] ... elasticsearch-1 | ERROR: [1] bootstrap checks failed elasticsearch-1 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] ... dependency failed to start: container am-elasticsearch-1 exited (78) Summary Regarding Docker startup, it is noted that it is designed for developers, and care should be taken when using it in production environments. We hope this serves as a useful reference for using Archivematica. ...

June 19, 2024 · 2 min · Nakamura

Fixing Japanese Filename Conversion in Archivematica

Overview When inputting files with Japanese filenames into Archivematica with default settings, a filename like “ユースケース公募提案書.docx” (Use Case Call for Proposals.docx) is converted as follows: yu-suke-suGong_Mu_Ti_An_Shu_.docx This article explains how to customize this filename conversion. Details The filename conversion is performed in the following file: https://github.com/artefactual/archivematica/blob/qa/1.x/src/MCPClient/lib/clientScripts/change_names.py Specifically, the conversion is done here: decoded_name = unidecode(basename) A Google Colab execution example is available here: https://colab.research.google.com/github/nakamura196/000_tools/blob/main/unidecodeを試す.ipynb Customization This time, we will use pykakasi. ...

June 19, 2024 · 2 min · Nakamura

Trying Out mirador-sync-windows

Overview mirador-sync-windows is described as follows. https://github.com/UCLALibrary/mirador-sync-windows When comparing multiple nearly identical images, such as different spectral images of the same object, it is helpful to apply actions simultaneously across multiple windows. Here is a usage demo: https://youtu.be/Ls2zvJpSRlc Note that this is a plugin for Mirador 2, and the repository has been archived. This time, I created a repository for trying out mirador-sync-windows, so I will introduce it. ...

June 19, 2024 · 1 min · Nakamura

Converting Toji Hyakugo Monjo WEB Data to IIIF

Overview I had the opportunity to use images published on the Toji Hyakugo Monjo WEB, which publishes the National Treasure Toji Hyakugo Monjo held by the Kyoto Prefectural Library and Archives, and created a repository that converts the published data to IIIF format. https://github.com/nakamura196/toji_iiif The following dataset was used. https://hyakugo.pref.kyoto.lg.jp/?page_id=1481 In particular, you can view a list of images from the following URL. https://nakamura196.github.io/toji_iiif/ Key Points IIIF Collection You can access the IIIF collection from the following URL. This enables machine-readable access. ...

June 19, 2024 · 1 min · Nakamura

Trying Parts of https://wikidata.reconci.link/

Overview During my research, I learned about the existence of the following API. https://wikidata.reconci.link/ This is a memo on how to use it. Suggest Suggest values could be obtained using URLs like the following. https://wikidata.reconci.link/en/suggest/entity?prefix=中村覚 Preview Preview results could be obtained using URLs like the following. https://wikidata.reconci.link/en/preview?id=Q107095935 Summary It appears to be commonly used together with OpenRefine, and I would like to investigate further when the opportunity arises. https://qiita.com/yayamamo/items/eade3e5788e6f359bce7

June 17, 2024 · 1 min · Nakamura

Adding Classes and Properties Using the Omeka S CustomOntology Module

Overview Custom Ontology is a module that allows you to add custom vocabularies when standard ontologies such as LOV, schema.org, and W3C are not available. For basic usage of this module, please refer to the following. https://nakamura196.hatenablog.com/entry/2021/07/24/235050 For how to update vocabularies that have already been created using this module, please refer to the following. This article explains how to add classes and properties to an already created vocabulary. ...

June 17, 2024 · 1 min · Nakamura