Overview
This is a memo about trying out the “Tale of Genji in Textbooks LOD” (Kyokasho no Naka no Genji Monogatari LOD).
https://linkdata.org/work/rdf1s10294i
It is described as follows.
The “Tale of Genji in Textbooks LOD” is an LOD conversion of data on The Tale of Genji published in post-war authorized textbooks for the classical literature section of high schools.
I would like to thank all those involved in creating and publishing the “Tale of Genji in Textbooks LOD”.
Creating a SPARQL Endpoint
This time we use DyDra. We registered the data using Python, referencing the following article.
DYDRA_ENDPOINT=https://dydra.com/ut-digital-archives/genji_u/sparql
DYDRA_API_KEY=xxxxx
from dydra_py.api import DydraClient
endpoint, api_key = DydraClient.load_env("../.env")
client = DydraClient(endpoint, api_key)
# Register genjimaki_list
client.import_by_file("./data/genjimaki_list_ttl.txt", "turtle")
# Register genjitext_list
client.import_by_file("./data/genjitext_list_ttl.txt", "turtle")
As a note, the URIs in the RDF had a mixture of http://linkdata.org/resource/rdf1s10294i# and https://linkdata.org/resource/rdf1s10294i#. This time, I performed a replacement to unify them to http://linkdata.org/resource/rdf1s10294i# before registering them in the SPARQL endpoint.
Verification with Snorql
I created a Snorql instance to query the constructed SPARQL endpoint.
https://nakamura196.github.io/snorql_examples/genji/
For example, in the following, textbooks using the Kiritsubo chapter are linked via schema:workExample.

In the following, chapters published in the textbook “Koto Kobun 3” are linked via dct:hasPart.

Visualization with Yasgui
I also tried visualization using Yasgui. For more information about Yasgui, please refer to the following.
Counting Chapters per Textbook
PREFIX dct: <http://purl.org/dc/terms/>
SELECT ?textTitle ?publisher (count(?volume) as ?count) ?text
WHERE {
?text dct:hasPart ?volume;
dct:title ?textTitle;
dct:publisher ?publisher
}
GROUP BY ?text ?textTitle ?publisher
ORDER BY desc(?count)

Counting Textbooks per Chapter
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
SELECT ?chapterTitle (count(?text) as ?count)
WHERE {
?chapter schema:workExample ?text;
dct:title ?chapterTitle
}
GROUP BY ?chapterTitle
ORDER BY desc(?count)

We can see that “Kiritsubo” is included in the most textbooks.
Number of Textbooks per Authorization Year
PREFIX jp-textbook: <https://w3id.org/jp-textbook/>
SELECT (str(?year) as ?year) (count(?year) as ?count)
WHERE {
?text jp-textbook:authorizedYear ?year .
}
GROUP BY ?year
ORDER BY asc(?year)

Please note that there are gaps (missing years) on the X axis.
Relationship Between Publishers and Textbooks
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
construct {
?book dct:publisher ?publisherURI .
?book dct:title ?title .
}
WHERE {
?work schema:workExample ?book;
<https://dcmi.github.io/bibo/#:number> 1 .
?book dct:publisher ?publisher;
dct:title ?title .
BIND(IRI(CONCAT("http://example.org/", STR(?publisher))) AS ?publisherURI)
}
This is limited to textbooks that include the Kiritsubo chapter.


While there may be more effective visualization methods, you can view a list of textbooks by publisher.
Summary
There may be some points where my understanding of the RDF data content is incorrect, but I hope this serves as a useful reference for using the “Tale of Genji in Textbooks LOD” and various LOD-related tools.