Released v4.1.0 of Omeka-S-module-FixCjkSearch

Overview To address the issue where full-text search in Japanese does not work well with Omeka S’s standard functionality, I have created the following module. https://github.com/nakamura196/Omeka-S-module-FixCjkSearch This module had stopped working with the latest version of Omeka S at the time of writing (v4.1.0), so I released an updated version of the module. https://github.com/omeka-j/Omeka-S-module-FixCjkSearch/releases There may be some incomplete aspects, but I hope this serves as a helpful reference. ...

June 17, 2024 · 1 min · Nakamura

Accent Sensitivity in Omeka S Partial Match Search

Overview I investigated accent sensitivity in Omeka S partial match search, and here are my notes. Symptom For example, when items containing the string “tako” (in hiragana) are stored, searching for “tako” in hiragana, katakana, or with dakuten (voiced mark) variations all return the same results. Cause The issue appeared to be caused by the default collation “utf8mb4_unicode_ci” set during installation. Specifically, this collation is “case-insensitive” (does not distinguish between uppercase and lowercase) and “accent-insensitive” (does not distinguish between accented and unaccented characters), which is why hiragana, katakana, and dakuten variations return the same search results. ...

June 17, 2024 · 1 min · Nakamura

Examining the Contents of the DHC Format

Overview At the annual conferences of Digital Humanities and The Japanese Association for Digital Humanities (JADH), it is common to use a tool called dhconvalidator to convert DOCX or ODT files into DHC files for submission. https://github.com/ADHO/dhconvalidator This article is a note for understanding this format. Examining the Contents DHC files are described as follows. This is essentially a ZIP archive containing their original OCT/DOCX file, an HTML rendering and an XML-TEI rendering, plus a folder with the image files, properly renamed). ...

June 16, 2024 · 2 min · Nakamura

Notes on Using Zotero

Overview https://www.zotero.org/ Zotero is described as follows. Zotero is a free, easy-to-use tool to help you collect, organize, annotate, cite, and share research. These are notes on how to use Zotero. From Identifiers You can import from DOI as shown below. Websites Install the following Chrome extension “Zotero Connector.” https://chromewebstore.google.com/detail/ekhagklcjbdpajgpjgmbionohlpdbjgc Click the extension on the website you want to cite, and you can register it as shown below. ...

June 15, 2024 · 1 min · Nakamura

Trying Out a3m

Overview This article covers trying out a3m. https://github.com/artefactual-labs/a3m a3m is described as follows: a3m is a lightweight version of Archivematica focused on AIP creation. It has neither external dependencies, integration with access sytems, search capabilities nor a graphical interface. Differences from Archivematica The main differentiator is the lack of service dependencies. a3m does not depend on Gearman or external workers, MySQL, Elasticsearch or Nginx. a3m provides its own API server based on the gRPC stack and all processing is performed via system threads and spawned child processes. An embedded database based on SQLite is used to store temporary processing state. ...

June 13, 2024 · 4 min · Nakamura

How to Handle CSP Errors in Strapi

Overview I configured Strapi with the following plugin to store media in S3. https://www.npmjs.com/package/@liashchynskyi/strapi-provider-upload-s3-cloudfront At that time, the following error occurred and images were not displayed. Refused to load the image 'https://xxx/uploads/yyy.jpg' because it violates the following Content Security Policy directive: "img-src 'self' data: blob: dl.airtable.com". I was able to resolve this issue by modifying ./config/middleware.js, as described in the following article. https://zenn.dev/studiobros/articles/04400f413eb2aa Regarding ACL Similarly, I also encountered a situation where media could not be uploaded to S3. However, as described in the above article, by enabling S3 ACL and configuring the appropriate Block Public Access (bucket settings), I was able to upload successfully. ...

June 12, 2024 · 1 min · Nakamura

How to Handle When SSH Connection to Sakura VPS Becomes Unavailable

When SSH connection to Sakura VPS becomes unavailable, you can log in using the serial console. The serial console functions as an emergency workaround for accessing your VPS even when normal SSH connection over the network is not available. The method to access the serial console is as follows: Log in to the Sakura VPS control panel. Select the target VPS. Find and click the “Serial Console” option. Follow the instructions to connect to the serial console. Using the serial console, you can perform system configuration and repair work even if SSH keys are incorrectly configured or communication is blocked by a firewall. However, proper authentication credentials are required to use the console securely. ...

June 12, 2024 · 1 min · Nakamura

Rebuilding and Restarting Containers with docker-compose

When you want to rebuild and restart containers simultaneously using the docker-compose command, you can execute the following commands. Here are methods for running the build and restart separately, and for executing them in a single command. Running Build and Restart Separately Build: docker-compose -f ./docker-compose.prod.yml build Restart: docker-compose -f ./docker-compose.prod.yml restart Running Build and Restart in a Single Command To build and then restart services, you can use the up command with the --build option and the restart policy. However, since a restart option does not exist for the up command, you actually stop and restart the services. ...

June 12, 2024 · 1 min · Nakamura

Trying Strapi's Data Transfer

Overview I had the opportunity to deploy local environment data to a production environment in Strapi, so I tried using the following Data transfer feature. https://docs.strapi.io/dev-docs/data-management/transfer Steps Production Environment Side Issue a Transfer Token on the production environment side. Local Environment Let’s say the production site is https://strapi.example.org and the token is xxx. With the following command, I was able to deploy the local environment data to the production environment. ...

June 12, 2024 · 1 min · Nakamura

Drupal: Setting Pre-filled Values Using the Prepopulate Module

Overview When accessing the Drupal content creation screen, I was able to set pre-filled values by specifying query parameters, so this is a memo of the process. The following module is used. https://www.drupal.org/project/prepopulate Usage For example, when adding new content to a content type called “poems,” add query parameters as follows. </node/add/poems?edit[field_spot][widget][0][target_id]=1&edit[title][widget][0][value]=テスト> As a result, the registration screen is displayed with the initial values pre-filled as shown below. Summary I hope this serves as a useful reference. ...

June 12, 2024 · 1 min · Nakamura

Creating RDF Data Using Microsoft Visio

Overview I had the opportunity to use Microsoft Visio for creating RDF data, so this is a memo of that experience. https://www.microsoft.com/ja-jp/microsoft-365/visio/flowchart-software Note that Microsoft Visio is not a tool specialized for creating RDF data, but it is a flowchart and diagramming software with high usability. Therefore, I attempted to convert data created with this tool into RDF. For converting data created in Microsoft Visio to RDF, the following Python library is used. ...

June 8, 2024 · 2 min · Nakamura

Using "ARC2 RDF Graph Visualization" from Python

Overview I had the opportunity to use “ARC2 RDF Graph Visualization” published by Masahide Kanzaki from Python, so here are my notes. The public page for “ARC2 RDF Graph Visualization” is below. https://www.kanzaki.com/works/2009/pub/graph-draw By providing RDF described in Turtle, RDF/XML, JSON-LD, TriG, or Microdata as input, you can obtain visualization results as png or svg files. Usage Example in Python import requests text = "@prefix ns1: <http://example.org/propery/> .\n\n<http://example.org/bbb> ns1:aaa \"ccc\" ." output_path = "./graph.png" # Data needed for POST request url = "https://www.kanzaki.com/works/2009/pub/graph-draw" data = { "RDF": text, "rtype": "turtle", "gtype": "png", "rankdir": "lr", "qname": "on", } # Send POST request response = requests.post(url, data=data) # Check if response is not a PNG image if response.headers['Content-Type'] != 'image/png': print("Response is not a PNG image. Displaying content:") # print(response.text[:500]) # Display first 500 characters # [:500] else: os.makedirs(os.path.dirname(output_path), exist_ok=True) # Save response as PNG file with open(output_path, 'wb') as f: f.write(response.content) Summary I hope this is helpful for visualizing RDF data. ...

June 7, 2024 · 1 min · Nakamura

Trying tropy-plugin-iiif

Overview I had the opportunity to try tropy-plugin-iiif, so this is a memo about it. https://github.com/tropy/tropy-plugin-iiif tropy-plugin-iiif is described as follows. Tropy plugin to import IIIF manifests Preparation Install Tropy. https://tropy.org/ Next, download the latest zip file from the following link. https://github.com/tropy/tropy-plugin-iiif/releases/latest Open Preferences > Plugins. Click the “Install Plugin” button, select the downloaded zip file, and click “Enable”. Installation is now complete. Importing a IIIF Manifest Select tropy-plugin-iiif from File > Import. ...

June 6, 2024 · 1 min · Nakamura

Trying Out @iiif/parser

Overview I learned about an npm module called @iiif/parser, so I tried out some of its features. https://github.com/IIIF-Commons/parser Usage Below is an example. It converts a v2 IIIF manifest to v3. "use client"; import { useState } from "react"; import { convertPresentation2 } from "@iiif/parser/presentation-2"; import { Button, Label, TextInput } from "flowbite-react"; import ComponentsPagesParserPre from "./pages/parser/pre"; type ManifestData = any; export default function ComponentsParser() { const [url, setUrl] = useState<string>( "https://iiif.dl.itc.u-tokyo.ac.jp/repo/iiif/fbd0479b-dbb4-4eaa-95b8-f27e1c423e4b/manifest" ); const [data, setData] = useState<ManifestData>(null); const fetchAndConvertManifest = async ( manifestUrl: string ): Promise<void> => { try { const response = await fetch(manifestUrl); const manifestJson = await response.json(); const convertedManifest = convertPresentation2(manifestJson); setData(convertedManifest); } catch (error) { console.error("Failed to fetch or convert manifest", error); setData("Error fetching or converting manifest."); } }; const handleSubmit = (event: React.FormEvent<HTMLFormElement>): void => { event.preventDefault(); fetchAndConvertManifest(url); }; return ( <> <form className="flex flex-col gap-4" onSubmit={handleSubmit}> <div> <Label htmlFor="url" value="IIIF Manifest URL (v2)" /> <TextInput id="url" type="text" value={url} placeholder="https://example.com/iiif/manifest.json" required onChange={(e) => setUrl(e.target.value)} /> </div> <Button type="submit">Submit</Button> </form> <div className="mt-8"> <ComponentsPagesParserPre data={data} /> </div> </> ); } First, import it as follows. ...

June 5, 2024 · 2 min · Nakamura

Handling Shared Memory Shortage When Running ndlocr_cli and Other Issues

Overview This is a memo about issues I encountered when running ndlocr_cli (the NDLOCR (ver.2.1) application repository) and the steps taken to resolve them. Note that many of these issues were caused by my own configuration oversights or atypical usage, and are unlikely to occur during normal use. Please refer to this article if you encounter similar issues. Shared Memory Shortage When running ndlocr_cli, the following error occurred. Predicting: 0it [00:00, ?it/s]ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm). DataLoader worker (pid(s) 3999) exited unexpectedly The response from ChatGPT was as follows. ...

June 5, 2024 · 2 min · Nakamura

Publishing Videos with Omeka S

Overview I investigated how to publish videos with Omeka S, so this is a memorandum. Standard Features Omeka S supports video out of the box. Below is an example using the standard features. I used the following mp4 file: https://file-examples.com/storage/fe4e1227086659fa1a24064/2017/04/file_example_MP4_480_1_5MG.mp4 Specifically, the <video> tag was used as follows: <div class="media-render file"> <video src="https://omeka-d.aws.ldas.jp/files/original/5060f3ba2537676746a7aa69c9884c64daac300b.mp4" controls=""> <a href="https://omeka-d.aws.ldas.jp/files/original/5060f3ba2537676746a7aa69c9884c64daac300b.mp4">5060f3ba2537676746a7aa69c9884c64daac300b.mp4</a> </video> </div> Similarly, when uploading a .mov file, it played successfully, though this may be browser-dependent. ...

June 4, 2024 · 3 min · Nakamura

Disk Space After Installing ndlocr_cli with Docker

Notes on disk space after installing ndlocr_cli with Docker. I set up ndlocr_cli by following the steps described in the following article. As shown below, approximately 50GB of space is used, so you need to process input/output image files etc. with the remaining capacity. (The example below shows a case with 200GB of disk space allocated.) mdxuser@ubuntu-2204:~/ndlocr_cli$ df -h Filesystem Size Used Avail Use% Mounted on tmpfs 5.7G 1.4M 5.7G 1% /run /dev/sda2 196G 45G 143G 24% / tmpfs 29G 0 29G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock /dev/sda1 1.1G 6.1M 1.1G 1% /boot/efi tmpfs 5.7G 4.0K 5.7G 1% /run/user/1000 I hope this is helpful when specifying the virtual disk size (GB) when launching virtual machines on AWS (Amazon Web Services) or mdx (Data-Driven Society Creation Platform). ...

June 3, 2024 · 1 min · Nakamura

Logging into Drupal Programmatically

This is a personal note on how to log into Drupal programmatically. The following article was helpful: https://drupal.stackexchange.com/questions/185494/how-do-i-programmatically-log-in-a-user-with-a-post-request curl --location 'http://drupal.d8/user/login?_format=json' \ --header 'Content-Type: application/json' \ --data '{ "name": "admin", "pass": "admin" }' By sending a request like the above, I was able to obtain a response like the following: {"current_user":{"uid":"1","roles":["authenticated","administrator"],"name":"admin"},"csrf_token":"wBr9ldleaUhmP4CgVh7PiyyxgNn_ig8GgAan9-Ul3Lg","logout_token":"tEulBvihW1SUkrnbCERWmK2jr1JEN_mRAQIdNNhhIDc"} I hope this serves as a useful reference.

May 31, 2024 · 1 min · Nakamura

Bulk Exporting Registered Content in CSV Format from Drupal

Overview I had the opportunity to export registered content from Drupal in CSV format, so here are my notes. I used the following module. https://www.drupal.org/project/content_export_csv Installation It could be installed using the standard method. composer require 'drupal/content_export_csv:^4.7' ./vendor/bin/drush en content_export_csv Usage After installation, navigating to Administration > Content > Content displays the “Export Content” button. On the next screen, by selecting the content type you want to export, I was able to export a list of content of the specified content type. ...

May 30, 2024 · 1 min · Nakamura

Searching Including Private Posts with WordPress REST API

Background This is a note on how to search including private posts with the WordPress REST API. The following was helpful. https://wordpress.org/support/topic/wordpress-rest-api-posts-not-showing-other-than-published/ Specifically, by using the status argument and specifying multiple statuses as shown below, I was able to retrieve a list of articles including those statuses. GET /wp-json/wp/v2/posts?status=publish,draft,trash I hope this serves as a useful reference.

May 29, 2024 · 1 min · Nakamura