Using Roma to Limit Tags for Your Project and Generate Documentation

Overview I previously explained how to use Roma in the following article. This time, I will explain the workflow for creating TEI ODD (One Document Does-it-all) and documentation (HTML and PDF) targeting TEI/XML files at hand. Note that at the end of this article, I have included GPT-4’s response regarding the differences between ODD (One Document Does it all) and RNG (RelaxNG). Please refer to that as well. Obtaining a List of Tags Used First, obtain a list of tags used in your project. ...

November 3, 2023 · 12 min · Nakamura

Created a Python Library to Convert Freehand Annotations to Rectangles

Created a Python Library to Convert Freehand Annotations to Rectangles Taking freehand annotations created as shown below as input, they are converted to rectangular annotations as follows. The “Tanaka Yoshio Hakubutsugaku Collection” (held by the University of Tokyo General Library) is used. For specific usage instructions, please refer to the following notebook. https://github.com/nakamura196/000_tools/blob/main/フリーハンドのアノテーションを矩形にconversionする.ipynb I hope this serves as a useful reference for utilizing IIIF annotations.

November 2, 2023 · 1 min · Nakamura

Making Field Values Selectable in Drupal

Purpose This article explains how to make field value input selectable, as shown below. Below, I’ll explain both the text case and the entity reference case. Text Case Create a field called age. Here, select “List (text)”. Enter the choices as follows. As a result, the field can be edited in a “Select list” format as shown below. Furthermore, from the content type list page, click “Manage form display”. ...

October 31, 2023 · 2 min · Nakamura

Enabling Search by ID and Title When Referencing Other Content in Drupal

Introduction For example, suppose you create a content type called “Organization” in Drupal and create content items for “The University of Tokyo” and “Kyoto University.” At this point, assume that IDs from the Research Organization Registry (ROR) are also registered as follows. Title ID The University of Tokyo 057zh3y96 Kyoto University 02kpeqv85 Now, let’s try referencing this content from another content type (for example, a “Researcher” content type) using an affiliation field. When you type something like “University,” the two registered content items are displayed as shown below. ...

October 31, 2023 · 3 min · Nakamura

Drupal: Handling Errors When Updating the `uid` Field via API

When attempting to update a node’s uid field using Drupal’s JSONAPI, the following error occurred: T h e c u r r e n t u s e r i s n o t a l l o w e d t o P A T C H t h e s e l e c t e d f i e l d ( u i d ) . T h e ' a d m i n i s t e r n o d e s ' p e r m i s s i o n i s r e q u i r e d . This was resolved by changing the permissions. ...

October 26, 2023 · 1 min · Nakamura

Handling "Some resources have been omitted because of insufficient autho..." in Drupal

When using Drupal’s JSON API, I tried to retrieve field_name from a field ID using a query like the following, but got zero results. https://xxx/jsonapi/field_config/field_config?fields[field_config–field_config]=label%2Cfield_name&filter[name-filter][condition][path]=field_name&filter[name-filter][condition][operator]=IN&filter[name-filter][condition][value][1]=field_xxx1&filter[name-filter][condition][value][2]=field_xxx2&filter[name-filter][condition][value][3]=field_xxx3&filter[bundle]=yyy The meta field in the returned result indicated a permissions issue. { } " } " " } j , d m , s a e o t t n " " } a a " } a v m " " o p e e : : m i r t i " s a " } [ { t " : i " l ] t d o : i , e e { n n d t " { k " } " a : s s : i " e l " : l { " 1 f " : . { " h 0 : r " " e S , { f o " m : e " r h e t s t o p u : r / c / e j s s o h n a a v p e i . b o e r e g n / f o o m r i m t a t t e / d 1 . b 0 e / c " a u s e o f i n s u f f i c i e n t a u t h o r i z a t i o n . " , By changing the permissions for Content: Administer fields under Field UI as shown in the figure below, the permissions issue was resolved. ...

October 26, 2023 · 2 min · Nakamura

Converting JSON-LD Data to RDF/XML and Turtle Using EASY RDF

Overview In the following article, I introduced how to add an export feature. One of the export formats available is JSON-LD. In this article, we will try converting this JSON-LD to RDF/XML and Turtle formats. Tool Used This time, we will use EASY RDF. https://www.easyrdf.org/converter Copy the contents of the following JSON-LD obtained through the Omeka S export. { } " " " " " " } " " " " " } " } " } " ] " " ] " ] " ] @ @ @ o o o , o o o o t , o , o , o , o o , d , d c i t : : : : : : : h : : : : : c c o d y i i o r r t t u c m m i s t t n " p d s w " " e e h i m " " " r " " o " " e { } t i { } e { } e { } t : e " _ n @ o s s u t b l m s e @ @ d @ @ d e t r r e " : p e i : o o m l n a e q a v t i v t i m e m m x " : u r d i u u b e a r d u t a y f a y a _ " s s t h 1 b " " d r r n " i g i a e l p i l p " " " s : " " : " " " " " : " " " " " " t " 2 l : : " c c a : l e u r d u e e u e : @ o e @ o t t p p i @ c t p p i @ : t o , i : e e i _ " m e " e " d e " i : t [ i : i y r r s v r y r r s v p : c { " _ _ l " d : " " : " : " " : [ d i " d i t p o o _ a e p o o _ a " s I " h 1 c t " a i : : : : : " d : " d l e p p p l a e p p p l h : t : t l e : a s " { " " : " : " e " e e u u t " e e u u t / e t a m a p h " " " h { " h : [ : " : r r b e o : r r b e t / m t p s p n " l t h h 2 t 2 t " ] " : t t l " r t t l " p o " r s s l u , a t t t 0 t 0 t h 1 , h 1 " y y i : " " y y i : s m , u : " a l y p t t 2 p 2 p t 3 t [ l _ _ c : l _ _ c : e e / : t l _ s p p 3 : 3 : t t i i l " " i i l " " / k , / e , u : s s - / - / p p t d a : a [ t d a : b / a o n " r / : : 0 / 1 / s s e " b a e " b b o s m u : l / 7 w 0 w : : r : e t a r : e t b m . e l s - w - w / / a l r " a l r " e a k l n " m o 2 w 1 w / / l 1 " u l 2 " u k w a , u : e m m 6 . 7 . o o " , : e " , : e a s s l k e e T w T w m m , , , , s . . l { a k k 2 3 0 3 e e " " . l a , s a a 2 . 6 . k k T C a d w . s s : o : o a a i r w a s a . . 5 r 5 r s s t e s s . w a a 2 g 6 g . . l a . . l s w w : / : / a a e t l j d . s s 3 2 1 2 w w " o d p a l . . 1 0 6 0 s s , r a / s d l l + 0 + 0 . . " s x . a d d 0 1 0 1 l l , . x j s a a 0 / 0 / d d j x p . s s : X : X a a p / j . . 0 M 0 M s s o x p j j 0 L 0 L . . x m x / p p " S " S j j x e x x / / , c , c p p x k / x x x h h / / / a o x x x e e x x o s m / x x m m x x m / e o / a a x x e a k m o # # / / k p a e m m d d o o a i s k e e a a m m s / a k k t t e e i a s a a e e k k a t p / s s T T a a p e i f / / i i s s i m / i f f m m / / - s u l i i e e a a c s e l l " " p p 1 e s e e i i n 2 r / s s / / t " s l / / m s e , / a m s e i x 1 r e q d t t " g d u i e " , e i a a s , / u r / / 4 m e 1 1 f / / 3 " 5 4 4 " , 7 f f , 9 5 5 6 7 7 0 9 9 c 6 6 4 0 0 4 c c 7 4 4 1 4 4 c 7 7 9 1 1 5 c c 4 9 9 c 5 5 6 4 4 d c c 3 6 6 a d d a 3 3 c a a 0 a a a c c 2 0 0 3 a a b 2 2 d 3 3 4 b b 4 d d 1 4 4 a 4 4 6 1 1 f a a 4 6 6 e f f b 4 4 8 e e b b b . 8 8 j b b p . . g j j " p p , g g " " , Then, paste it into the Input Data form in EASY RDF. ...

October 24, 2023 · 7 min · Nakamura

Installing drush on Drupal Built with Lando

I set up a Drupal development environment using Lando, referring to the following site. https://www.acquia.com/jp/blog/how-to-use-lando-for-building-drupal-local-environment For installing drush on it, the following was helpful. https://docs.lando.dev/drupal/getting-started.html#quick-start By running the following command, drush became available. # l a I n n d s o t a c l o l m p a o s s e i r t e r e l q o u c i a r l e d d r r u u s s h h / d r u s h I hope this serves as a useful reference for others. ...

September 28, 2023 · 1 min · Nakamura

How to Disable Twig Cache in Drupal 10.1.0 and Later

The instructions were found at the following page. https://www.drupal.org/docs/develop/development-tools/disable-caching#s-disabling-twig-caching-the-easy-way Access the following path: /admin/config/development/settings Checking the boxes on the following screen disables the cache. I hope this is helpful for others.

September 28, 2023 · 1 min · Nakamura

Trying the IIIF Content State API

Overview I had the opportunity to try the IIIF Content State API, so this is a memo of the process. https://iiif.io/api/content-state/1.0/ The IIIF Content State API is described in Current Awareness-R as follows: “The IIIF Content State API” can generate links that specify in detail how an object should be displayed, including rotation angle and display position on the page image. https://current.ndl.go.jp/car/45832 Trying It Out The “Shueitai / Letterpress Printing Digital Library” provides the IIIF Content State API. ...

September 21, 2023 · 3 min · Nakamura

Enabling the Cantaloupe Admin Panel

Overview Here is how to enable the admin panel for Cantaloupe. I was able to view server information as shown below. Configuration Edit the following section in cantaloupe.properties. # Enables the Control Panel, at /admin. endpoint.admin.enabled = true # false endpoint.admin.username = admin endpoint.admin.secret = <パスワード> As a result, if you access a URL like the following and the Basic authentication screen appears, the setup is complete. https://cantaloupe.aws.ldas.jp/admin Summary I hope this serves as a useful reference when using Cantaloupe. ...

September 20, 2023 · 1 min · Nakamura

Created Notebooks Using NDLOCR and NDL Classical Japanese OCR ver.2

Notice 2026-02-24 ! The notebooks provided on this page will no longer be updated. For NDLOCR, “NDLOCR-Lite” has been released as a desktop application and command-line tool for easy use. Please use this going forward. https://github.com/ndl-lab/ndlocr-lite 2025-04-02 There is currently a bug. Please refrain from using it until the fix is complete. The bug has been fixed. 2025-03-21 For NDL Classical Japanese OCR, “NDL Classical Japanese OCR-Lite” has been released as a desktop application for easy use. Please use this going forward. ...

September 20, 2023 · 3 min · Nakamura

Displaying Images Referenced by URL in Drupal Views

Background Consider the case where you enter an image URL in a field called thumbnail with the Field type set to Link, as shown below. This time, I’ll use the following image from Irasutoya. https://3.bp.blogspot.com/-HLe8mKu9lCs/Ugsu_AAFifI/AAAAAAAAXNI/-yW12EVgQ5s/s800/book_yoko.png Here are my notes on displaying such data in Views like the following. Views I configured the following in the Views Rewrite results settings. < i m g s r c = " { { f i e l d _ t h u m b n a i l _ _ u r i } } " a l t = " I m a g e " When the Field type is set to Link, the following Replacement patterns were needed. ...

September 5, 2023 · 1 min · Nakamura

Mirador 3 Plugin Development: Adding Vertical Text Support to the Text Overlay Plugin

Overview Text Overlay plugin for Mirador 3 is a Mirador 3 plugin that displays selectable text overlays based on OCR or transcription. https://github.com/dbmdz/mirador-textoverlay A demo page is available at the following link. https://mirador-textoverlay.netlify.app/ However, when trying to display vertical text such as Japanese, it didn’t display correctly, as shown below. So I forked the above repository and made it possible to display vertical text as well. The source code is published in the following repository. (I hope to consider a pull request in the future.) ...

August 22, 2023 · 9 min · Nakamura

Visualizing Item Counts by Latest Update Year for the Japan Search Utilization Schema

This is a memo about visualizing item counts by latest update year for the Japan Search utilization schema. https://api.triplydb.com/s/bfcE2qF65 It is based on the following query. https://zenn.dev/nakamura196/books/a4534e306de7e7/viewer/e38587 We hope this is helpful.

August 16, 2023 · 1 min · Nakamura

Mirador 3 Plugin Development: Creating a Layer Slideshow

Overview I developed a Mirador 3 plugin that performs layer slideshows. https://youtu.be/r1ShHGqCs24 As described in the following article, I previously achieved this through customization of Mirador 2. The article below attempts a IIIF implementation of “Okiezu” (illustrated maps). https://nakamura196.hatenablog.com/entry/2020/08/14/073700 This time, I attempted to develop it as a Mirador 3 plugin. Repository https://github.com/nakamura196/mirador-layer-slideshow-plugin Demo Site https://nakamura196.github.io/mirador-layer-slideshow-plugin/ Summary There is much room for improvement, but I hope this serves as a useful reference. ...

August 3, 2023 · 1 min · Nakamura

About ALTO (Analyzed Layout and Text Object) XML

Overview I am sharing the results of querying GPT-4 about ALTO (Analyzed Layout and Text Object) XML. https://www.loc.gov/standards/alto/ Required Elements ALTO (Analyzed Layout and Text Object) XML is an XML schema for representing OCR-generated text and its layout. Its structure is very flexible, with many elements and attributes, but the required elements are limited. The simplest form of ALTO XML has the following hierarchical structure: <alto>: The root element. It must have @xmlns and @xmlns:xsi attributes indicating the version of the ALTO XML schema. It must also have two child elements: <Description> and <Layout>. ...

July 31, 2023 · 5 min · Nakamura

I Created a Sample Repository Using CETEIcean and Nuxt 3

Overview I created a sample repository using CETEIcean and Nuxt 3. https://github.com/TEIC/CETEIcean I referenced the following issue. https://github.com/TEIC/CETEIcean/issues/27 The script introduced there did not work with CETEIcean v1.8.0, so I created a minimal repository that works with CETEIcean v1.8.0 and Nuxt 3. Demo Page https://nakamura196.github.io/ceteicean-nuxt3 Source Code https://github.com/nakamura196/ceteicean-nuxt3 Main File https://github.com/nakamura196/ceteicean-nuxt3/blob/main/app.vue Summary I hope this serves as a useful reference. I would also like to express my gratitude to those who developed CETEIcean. ...

July 27, 2023 · 1 min · Nakamura

[Omeka S Module Introduction] Scripto: Performing Transcription and Translation

Overview This article introduces “Scripto,” an Omeka S module that enables transcription and translation of media (images, etc.) registered in Omeka S. https://omeka.org/s/modules/Scripto/ Installation The installation of this module itself is the same as for other standard modules. However, in addition to installing this module, you need to set up MediaWiki. If your environment already runs Omeka S, it should have the necessary components for setting up MediaWiki. Download and set up MediaWiki using commands like the following: ...

July 20, 2023 · 3 min · Nakamura

[Omeka S Module Introduction] IiifPresentation: Adding IIIF Presentation API

Overview I tried the IiifPresentation module that adds IIIF Presentation API support, so here are my notes. https://omeka.org/s/modules/IiifPresentation/ As far as I could tell from a brief trial, there did not seem to be a significant difference from the features provided by the IIIF Server module below. https://omeka.org/s/modules/IiifServer/ One difference is that this module was developed by the Omeka Team, and it has the advantage of being usable without detailed configuration. ...

July 20, 2023 · 2 min · Nakamura