Overview#
These are notes on creating a DTS (Distributed Text Services) API for TEI/XML files published by the Koui Genji Monogatari Text DB.
Background#
The Koui Genji Monogatari Text DB is available at:
https://kouigenjimonogatari.github.io/
It publishes TEI/XML files.
Developed DTS#
The developed DTS is available at:
https://dts-typescript.vercel.app/api/dts
It uses Express.js deployed on Vercel.
For more information about DTS, please refer to:
MyCapytain Library#
In the following article, I introduced a library for using DTS from Python:
Let’s use this library to access the developed DTS.
Create the resolver#
With the following line we create the resolver :
The following code is gonna find each text that is readable by Alpheios
Printing the full tree#
Printing details about a specific one#
Let’s get some references !#
0
Let’s get some random passage !#
1
2
Discussion#
As shown above, I was able to build a DTS that supports the basic operations of the MyCapytain library.
While the above example uses Python, it can also be accessed from a browser. For example, the following retrieves the first line of Kiritsubo:
https://dts-typescript.vercel.app/api/dts/document?id=urn:kouigenjimonogatari.1&ref=https://w3id.org/kouigenjimonogatari/api/items/0005-01.json
Notes#
This was developed referencing the following API:
https://texts.alpheios.net/api/dts
However, it has not been confirmed whether the above API conforms to the latest guidelines:
https://distributed-text-services.github.io/specifications/
Therefore, please note that the DTS API developed here may have parts that do not conform to the above guidelines.
Summary#
I hope this serves as a useful reference for understanding DTS.