Investigating Customization Methods for Snorql for Japan Search

Overview This is the result of investigating how to customize “Snorql for Japan Search,” which is used by Japan Search. I plan to update this article as needed. Please note that it may contain errors. Menu Changing the Page Title _ p o w e r e d B y L a b e l : " C u l t u r a l J a p a n " , " J a p a n S e a r c h " , Changing the Query Endpoint _ e n d p o i n t : " h t t p s : / / l d . c u l t u r a l . j p / s p a r q l / " , / " h t t p s : / / j p s e a r c h . g o . j p / r d f / s p a r q l / " , Changing the poweredByLink URL ...

November 29, 2022 · 21 min · Nakamura

Using the Japan Search SPARQL Endpoint with Yasgui

Overview Yasgui (Yet Another Sparql GUI) provides various advanced features for creating, sharing, and visualizing SPARQL queries and their results. https://github.com/TriplyDB/Yasgui This time, I attempt various visualizations using the Japan Search SPARQL endpoint with Yasgui. Results Table Display I visualize the number of items per dataset. First, here is a standard table display. Result Filtering and sorting of results is also possible. Chart Using the “Chart” tab, I attempt a chart display of the same results. ...

November 28, 2022 · 1 min · Nakamura

Omeka S Module Introduction: Data Type RDF

Overview Data Type RDF is a module that adds data types (html, xml, boolean) to Omeka S. Its usage is similar to Numeric Data Types: https://nakamura196.hatenablog.com/entry/2021/08/01/070701 Below is an introduction to how to use it. Usage Installation Install it the same way as other Omeka modules. Editing Resource Templates Create a resource template. Next, select the Data Type RDF values for the data type of a specific property. Here, we add all three types provided by this module. ...

November 14, 2022 · 1 min · Nakamura

Registering ICA RiC-O Vocabulary in Omeka S

Overview I registered the ICA RiC-O vocabulary in Omeka S, so this is a memo of the process. https://www.ica.org/standards/RiC/RiC-O_v0-2.html Method On the Omeka S vocabulary registration screen, enter the information as follows. As a result, 106 classes and 485 properties were registered. Below is an example of the property list screen, where you can also check the comments for each property. Summary I hope this serves as a useful reference for utilizing ICA RiC-O and Omeka S. ...

November 10, 2022 · 1 min · Nakamura

Retrieving Birth and Death Years of Historical Figures from Wikidata

I created a notebook for retrieving birth and death years of historical figures from Wikidata. I hope this serves as a helpful reference. https://colab.research.google.com/github/nakamura196/ndl_ocr/blob/main/Wikidataから人物の生没年を取得する.ipynb

October 27, 2022 · 1 min · Nakamura

[Memo] How to Use Virtuoso

This is a memo on how to use Virtuoso, an RDF store. Checking Registered Graph URIs Conductor > Linked Data > Graphs > Graphs Manually Uploading RDF Files Conductor > Linked Data > Quad Store Upload Enabling Federated Query The following article was helpful. The “Account Roles” configuration was required. https://community.openlinksw.com/t/enabling-sparql-1-1-federated-query-processing-in-virtuoso/2477 I hope this serves as a helpful reference.

August 19, 2022 · 1 min · Nakamura

[RDF] Configuring URI Access to Redirect to the Snorql Interface

This is a continuation of the following article. This is a memo on configuring redirects so that accessing URLs like https://xxx.abc/data/123 redirects to https://xxx.abc/?describe=https://xxx.abc/data/123, using Japan Search’s RDF store as a reference. Japan Search example: https://jpsearch.go.jp/entity/chname/葛飾北斎 -> https://jpsearch.go.jp/rdf/sparql/easy/?describe=https://jpsearch.go.jp/entity/chname/葛飾北斎 Create a conf file like the following and place it in the appropriate location (e.g., /etc/httpd/conf.d/). R R R e e e w w w r r r i i i t t t e e e E C R n o u g n l i d e n e % { o H n T ( T d P a _ t A a C | C e E n P t T i } t y ) * / t . e * x ) t / h h t t t m p l s : / / x x x . a b c / ? d e s c r i b e = h t t p s : / / x x x . a b c / $ 1 [ L , R = 3 0 3 ] Then restart Apache. ...

August 19, 2022 · 2 min · Nakamura

Building a Virtuoso RDF Store Using AWS EC2

Introduction These are notes on building a Virtuoso RDF store using AWS EC2. This covers custom domain configuration, HTTPS connection, and Snorql installation. There are many other useful articles on building Virtuoso. Please refer to them as well: https://midoriit.com/2014/04/rdfストア環境構築virtuoso編1.html https://qiita.com/mirkohm/items/30991fec120541888acd https://zenn.dev/ningensei848/articles/virtuoso_on_gcp_faster_with_cos Prerequisites An ACM Certificate should already be created. Please refer to articles such as the following: https://dev.classmethod.jp/articles/specification-elb-setting/#toc-3 EC2 First, create an EC2 instance. Select Amazon Linux, and set the instance type to t2.micro. ...

August 16, 2022 · 8 min · Nakamura

How to Register and Delete RDF Files in Virtuoso RDF Store Using curl and Python

Overview Notes on how to register and delete RDF files in Virtuoso RDF store using curl and Python. The following was used as a reference. https://vos.openlinksw.com/owiki/wiki/VOS/VirtRDFInsert#HTTP PUT curl As described on the above page. First, create myfoaf.rdf as sample data for registration. < r / d r f d : < f R f / : D o f R F a o D f < a F x : f f > m P o : l e a P n r f e s s : r : o n s f n a o o m n a r e > f d > = f 中 " : 村 h a 覚 t b < t o / p u f : t o / = a / " f x h : m t n l t a n p m s : e . / > c w m w / w f . o e a x f a / m 0 p . l 1 e / . " c > o m / p e o p l e / 中 村 覚 " > Next, execute the following command. ...

August 16, 2022 · 6 min · Nakamura

Registering DC-NDL (National Diet Library Dublin Core Metadata Description) as a Vocabulary in Omeka S

Here is how to register DC-NDL (National Diet Library Dublin Core Metadata Description) as a vocabulary in Omeka S. First, select “Vocabularies” as shown below. Next, click the button in the upper right. (The translation data for this button label is incorrect; I hope to fix it in the future.) Then, enter the required information as shown on the following screen. The specific information is as follows. Category Field Value Notes Basic Information Label DC-NDL This value is arbitrary. Basic Information Namespace URI http://ndl.go.jp/dcndl/terms/ Basic Information Namespace Prefix dcndl File Vocabulary URL https://www.ndl.go.jp/jp/dlib/standards/meta/2020/12/ndl-terms.rdf As a result, DC-NDL becomes available as a vocabulary as shown below. ...

May 25, 2022 · 1 min · Nakamura

Example of Running SPARQL Queries Against the Japan Search RDF Store Using Google Colab

I created a notebook demonstrating examples of running SPARQL queries against the Japan Search RDF store using Google Colab. I hope it serves as a useful reference when using RDF stores with Python. https://colab.research.google.com/github/nakamura196/ndl_ocr/blob/main/ジャパンサーチのRDFストアを対象したSPARQLチュートリアル.ipynb Other reference sites and tutorials include the following. https://www.kanzaki.com/works/ld/jpsearch/ https://lab.ndl.go.jp/data_set/tutorial/

April 29, 2022 · 1 min · Nakamura

[Omeka S Module Introduction] Numeric Data Types: Enabling Range Search for Date Data, and More

概要 特定のプロパティを数値データとして設定できるようにするモジュール「Numeric Data Types」について説明します。プロパティは、日付と時刻(ISO)、または数値として指定できます。 特に、日付データに対する範囲検索を実現できる点などがポイントです。 github.com 公式のマニュアルは以下です。 omeka.org 上記のマニュアルを参考に、本モジュールの使い方を説明します。 リソーステンプレートの作成または編集 本モジュールを利用するには、リソーステンプレートを作成または編集して、特定のプロパティを数値データ型として設定する必要があります。リソーステンプレートの使い方は、以下に記載がありますが、いずれ紹介記事を作成したいと思います。 omeka.org 今回は、動画に関するリソーステンプレートとして「動画」を作成してみます。以下に示すように、「動画」というリソーステンプレートを作成し、その編集画面を開きます。 本モジュールでは、以下のData typesが追加されます。 Timestamp(xsd:date) 整数(o-module-numeric-xsd:integer) 期間(xsd:duration) 間隔 そのため、リソーステンプレートにおいて、これらの型を持つプロパティを作成します。具体的には、以下のように設定しました。 公開日(ex:date):Timestamp バージョン(ex:version):整数 再生時間(ex:duraion):期間 準備時間(ex:prepare):間隔 なお、独自の語彙「ex」の作成については、以下の記事を参考にしてください。 nakamura196.hatenablog.com プロパティのData types(型)の設定方法について説明します。リソーステンプレートの編集画面を開き、型を設定したいプロパティの「鉛筆」アイコンをクリックします。画面右部に表示されるパネルの「その他のオプション」 > 「Data types」において、「数字」 > 「Timestamp」を選択します。 結果として、今回は以下のリソーステンプレートを使用します。 ここで設定した各プロパティについて、入力フォーム、保存されるデータを以下で説明します。 データ登録 今回は、下図のようなデータを作成します。2021年3月11日に公開された動画について、再生時間、バージョン、準備期間、などを入力します。 アイテムの登録または編集画面において、リソーステンプレートの選択フォームで、先に作成した「動画」を選択します。 それにより、先に設定した各プロパティについて、Data types(型)に応じた入力フォームが表示されます。 例えば、Timestampを設定したプロパティ「公開日」は、下図のように日付(および時刻)の入力に特化したフォームが表示されます。 検索 上記の設定により、管理者画面および公開サイトに検索フォームが追加されます。 例えば、下図のように、プロパティ「公開日」について、「2021-03」以降の値を検索する、といった使い方が可能となります。 その他 API REST APIを通じて、登録したデータ(JSON-LD)を以下で確認できます。下図のように、型がRDFによっても記述されていること(xsd:date, xsd:duration, など)を確認できます。 https://diyhistory.org/nakamura196/api/items/13 モジュール「Bulk Import」を用いた一括登録 別のモジュール「Bulk Import」を用いることで、ここで説明した型を持つデータの一括登録を行うことができます。「Bulk Import」の使い方については、以下の記事を参考にしてください。 nakamura196.hatenablog.com 具体的には、以下に示すようなCSVファイルを用意します。ポイントとして、ヘッダー行に「^^numeric:timestamp」を与えることで、Data types(型)を指定した上での一括登録が可能です。 https://github.com/omeka-j/Omeka-S-module-BulkImport-Sample-Data/blob/main/item_with_datatype.csv まとめ 今回は、特定のプロパティを数値データとして設定できるようにするモジュール「Numeric Data Types」について説明しました。 ...

August 1, 2021 · 1 min · Nakamura

[Omeka S Tips] How to Add Existing Standard Vocabularies

概要 Omeka SではRDF(Resource Description Framework)を用いてリソース(アイテム、アイテムセット、メディア、etc…)の情報を記述します。そのため、RDFのクラスやプロパティのコレクションである語彙をインポートする必要があります。この記事では、この既存の語彙のインポート方法について説明します。なお、公式マニュアルでは以下に記載があります。 omeka.org 具体的には、国立国会図書館が提供する国立国会図書館ダブリンコアメタデータ記述(DC-NDL)とSchema.org、ジャパンサーチの利活用スキーマの登録を例とします。 なお、代表的な語彙としてDublicon Core Terms(dcterms:)が挙げられます。Omeka Sのインストール直後のデフォルト設定では、Dublin Coreに加えて、Dublin Core タイプ(dctype:)、書誌オントロジー / Bibliographic Ontology(bibo:)、FOAF / Friend of a Friend(foaf:)が登録されています。 既存の語彙を可能限り使用することで、データの共有が容易となります。一方、独自の語彙を使用したい場合には、Custom Ontologyモジュールが使用できます。この使用方法については、以下の記事で紹介しています。 nakamura196.hatenablog.com RDFスキーマファイルの取得 語彙の登録にあたり、各語彙のRDFスキーマファイルを取得する必要があります。 DC-NDL 以下から取得することができます。 https://www.ndl.go.jp/jp/dlib/standards/meta/2020/12/ndl-terms.rdf 以下のページに掲載されています。 www.ndl.go.jp なお、接頭語は「dcndl」、名前空間のURIは「 http://ndl.go.jp/dcndl/terms/」です。 Schema.org 以下から取得できます。 https://schema.org/version/latest/schemaorg-current-https.rdf 以下のページに掲載されており、フォーマット(JSON-LD、RDF/XML、Turtleなど)を指定できます。 schema.org なお、接頭語は「schema」、名前空間のURIは「 https://schema.org/」です。 ジャパンサーチの利活用スキーマ ジャパンサーチの利活用スキーマ関連の語彙の例として、以下が挙げられます。 jps: https://jpsearch.go.jp/term/property# type: https://jpsearch.go.jp/term/type/ chname: https://jpsearch.go.jp/entity/chname/ ここでは、上記の接頭語「jps」の語彙を対象とします。本語彙は以下から取得できます。 https://jpsearch.go.jp/term/property Omeka Sへのインポート 画面左部のメニュー「語彙の一覧」にアクセスし、画面右上のボタンをクリックしてください。なお、2021年7月時点で、本ボタンの日本語訳に間違いがありますので、いずれ修正したいと思います。 その後、以下のような入力フォームが表示されますので、基本情報や登録するファイルの情報を入力します。ファイルについては、ファイルのアップロードまたはURL指定による読み込みが可能です。以下は「ジャパンサーチ利活用スキーマ」を登録した例です。 この方法で、「DC-NDL」「Schema.org」も合わせて登録した結果が、以下の「語彙の一覧」画面で確認できます。 Schema.org は膨大な数のクラスとプロパティが定義されていることがわかります。 なお、各語彙で定義されているクラスおよびプロパティ一覧の列の数字をクリックすると、当該語彙のクラスまたはプロパティの一覧画面に遷移します。また、ラベルの横にある省略アイコンをクリックすると、以下の図のように、そのクラスまたはプロパティの詳細な説明が表示され、さらに当該クラスまたはプロパティが使用されているアイテムの一覧を確認することができます。以下の例では、「dcterms:title」が2つのアイテムで使用されていることを確認できます。 更新 語彙の更新は、「語彙の一覧」ページに表示される鉛筆アイコンをクリックして編集画面に入ります。そして、新しい語彙のファイルまたはURLを指定して画面右上の「保存」をクリックします。 その後、以下のような更新前後の変更を確認する画面が表示されます。ここでは、「Schema.org」の「schema:highPrice」というプロパティのラベルを、試験的に変更した例です。問題ない場合には、画面右上の「変更を承認」をクリックして、更新作業を完了させます。 なお、2021年7月時点においては、クラスおよびプロパティの追加と変更のみが可能で、特定のクラスまたはプロパティの削除は非対応のようです。 削除 語彙の削除は、「語彙の一覧」ページに表示されるゴミ箱アイコンをクリックします。画面右部に確認パネルが表示されるので、「削除を確定」を押して作業を完了させます。 まとめ 以上、既存の語彙を追加、更新、削除する方法を説明しました。 ...

July 24, 2021 · 1 min · Nakamura

Introduction to the IIIF Collection of IIIF Manifests Aggregated by Cultural Japan

Cultural Japanで集約したIIIFマニフェストについて、それらをまとめたIIIFコレクションを以下からご確認いただけます。 https://www.kanzaki.com/works/2016/pub/image-annotator?u=https://app.cultural.jp/iiif-collection/collection.json なお、各々のIIIFマニフェストの利用にあたっては、各収録DBの利用条件を確認してください。 本コレクションには、Cultural Japan側で動的に生成したIIIFマニフェストを含みます。上記のコレクション一覧において、【動的生成】という表記で識別することができます。この動的生成にあたっては、AWS Lambdaを利用しており、リクエスト毎にJapan SearchのRDFストア、およびCultural JapanのRDFストアに問い合わせを行い、JSONデータを生成しています。なお、本動的生成IIIFマニフェストを作成する条件は、高精細画像(jps:accessInfo/schema:associatedMedia)を持つアイテムとしています。 動的生成マニフェストの場合、必ずしも提供元アイテムのすべての画像を含めることができていない(jps:accessInfo/schema:associatedMedia で指定された画像のみを使っている)点で不完全ではありますが、IIIFマニフェストを読み込むSelf Museumやその他のIIIF対応ビューアに取り組むことが可能となるといった利点もあります。 self-museum.cultural.jp 世界中で発信される日本文化に関するIIIFリソースを概観するとともに、IIIFを用いたアプリケーション開発の素材としてお役に立てば幸いです。

July 23, 2021 · 1 min · Nakamura