Drafts

@cm3 の草稿置場 / 少々Wikiっぽく使っているので中身は適宜追記修正されます。

Makar Sankranti の日付について

Akash「昨日あいちゃんと飲んでてん」(インド人であるが彼は関西弁である、翻訳ではなく日本語の会話である。)

Aki「まじか、珍しいな」

Akash「だから本当は昨日は Makar Sankranti だったんやけどお祝いしてない」(彼はインドのたくさんあるお祭りのたびにその祭り特有のお菓子を作って振る舞ってくれる。祭りの名前+Sweets でググればそういうのが出てくる happy Makar Sankranti sweets - Google検索

Aki「Makar Sankranti って?」

Akash「太陽が北に動き始める日を祝うお祭り、これ→Makar Sankranti - Wikipedia

Aki「え、太陽が北に動き始めるのって冬至と一致するでしょ?一日が最も短い日も一致する。日の出が最も遅くなるのは正月ごろだけど1/14はさすがに遅すぎだしなんだろう?旧暦?」

Akash「わからんー。日本の冬至は何かお祝いするの?」

Aki「(「ゆず湯」に入り「カボチャ」を食べる風習を説明する。以下略)」

で一応調べたけど、Makar Sankranti の日付はやはり太陰暦由来でした。Hindu calendar - Wikipedia において、 Makara (やぎ座)は Lunar Months で December–January 、Solar month の方では January–February なので、太陰暦の方で正しい事実を、暦的に相当する太陽暦で考えてできるズレでした。これ考えてて気づいたことで、気づけば当然のことなんだけど、公道十二宮の切れ目と二十四節気 の中気は一致するんだな。サイン (占星術) - Wikipedia の表にも二十四節気が書かれてた。

f:id:cm3ak:20220115135226p:plain
jawp サイン (占星術) の表の一部

VLCでスピードを個々に変化させて曲を再生する方法

以下のようなバッチファイルを作って実行

:start
"C:\Program Files\VideoLAN\VLC\vlc.exe" --play-and-exit --no-video --rate=1.15 1.m3u
"C:\Program Files\VideoLAN\VLC\vlc.exe" --play-and-exit --no-video --rate=1 2.m3u
"C:\Program Files\VideoLAN\VLC\vlc.exe" --play-and-exit --no-video --rate=1.3 3.xspf
goto start

m3uとかxspfはプレイリストを書いたファイル。VLCでプレイリスト作ってエクスポートできる。xspf だとファイル名に.とか含まれていても大丈夫だったけど、m3u はなんかうまく開けないことがあった。

Windows Terminal を使ってみている

6年くらいcmderを使っていたのだけれど、Win11にメイン機をアップデートしたのをきっかけに Windows Terminal を使ってみることにした。参考: Windows 11の既定ターミナルは「Windows Terminal」に ~2022年中にも - 窓の杜

もう一つ理由があって、cmder で sqlite の select をしたときに文字化けするが、utf8 化したコマンドプロンプトでは生じないという状況が発生し、それがパッと対処できなかったのもある(詳細後述、sqlite3.exe の問題だったので cmder は悪くない)。

Windows Terminal はターミナルアプリなので、シェルとしては cmd とか powershell とか bash を使うことができる。


Q: たまに@が入力されるんだけど

A: バグで、日本語キーボード特有のキーで@が出力される。僕の場合は無変換キーでそれが生じていた。Microsoft IME の最新版を使っているとこのバグは再現しなかったのだがメカニズムが不明。Some keys on Japanese layout keyboards are incorrectly interpreted as @ · Issue #2206 · PowerShell/PSReadLine 直し方は分かってるので一応書いておいた。Set-PSReadLineKeyHandler (PSReadLine) - PowerShell | Microsoft Docs を使って回避する方法も考えたのだが、そもそも「無変換」キーを指定できないんだよね。"DownArrow" とかキーワードで指定できるようになってるから、.NET のConsoleKey を直接使ってるのかと思いきや、この実装よ…www→ https://github.com/PowerShell/PSReadLine/blob/dc38b451bee4bdf07f7200026be02516807faa09/PSReadLine/ConsoleKeyChordConverter.cs#L180


主に powershell を使う場合の情報を以下に記すが、結局いまは bash を使っている。powershell にも2種類あって云々って経緯は ASCII.jp:あらためて「PowerShell」の現状と登場後の経緯を整理するに詳しく書かれているが、デフォルトで設定されている方、僕の手元ではアップデートして7になっているが C:\Program Files\PowerShell\7\pwsh.exe のことを以下powershellと呼ぶ。Windows への PowerShell のインストール - PowerShell | Microsoft Docs から最新版をインストールできる。


Q:cmdのスクリプトがパスだけでは実行されないのだが

A:startコマンドを使う。


Q:dir /s /b みたいな cmd のコマンドが実行できないんだけど。

A:cmd /C dir /s /b みたいに cmd に実行させればできる。powershelldir 相当なのは Get-ChildItem


Q:起動時にエイリアスなどを読み込みたい

A:$PROFILE にいろいろ設定すればいい。僕はwindows - List all folders and subfolders in a given structure with filesize - Stack Overflowにあるスクリプトを設定している。


Q: 設定画面がGUIじゃなくてjsonが表示されるのだけど

A: バージョンが古いとそうなる。Microsoft Store のライブラリから更新するとよい。


Q: nano とか使えたりする?

A: する Windowsでnanoエディタを使う - Qiita


Q: ssh クライアントとして使い物になるか?

A: 微妙。screenの挙動がすこしおかしくなったりする。hardstatusが二重になったり。putty -load [セッション名] ですなおに putty を呼ぶコマンドのショートカットを alias として .bashrc に書いておくのがいいんじゃないかな(後述で関連の記述アリ)。

結局 wsl の bash をメインで使うことにした

wsl --install すると bash もインストールされ、自動的に Windows Terminal にそれが登録される。git 使いなら Windows Terminal で Git Bash を表示する - Qiita という手もあるけど、日本語の表示がダメだったり色々使いにくいので bash を使うと決めたならちゃんと wsl --install したほうがいい。その場合C://は/mnt/c/になるのでパスがややこしくなるが、それでも慣れたbashを使えるメリットは大きい気がする。

~/.bashrc を編集して、pythonのaliasをつけたり get-pip.py をつかって pip 入れたり、python はなるべく bash 側から使うように変更してみた。

Windows 機でのプログラム開発は Windows terminal + Windows Subsystem for LinuxUbuntu で統一したら Windows 特有の問題でプログラミングでもなやまされなくなって良い気がする。

sqlite3.exe は shift-jis 環境で使うことが想定されている。

SQLiteのチケットでも書かれている通り sqlite.exe は shift-jis 環境で使うことが想定されている。だから、Windows Terminal でも完全なUTF8化として

# PowerShell Core7でもConsoleのデフォルトエンコーディングはsjisなので必要
[System.Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("utf-8")
[System.Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("utf-8")

from Windows TerminalとPowerShellでクールなターミナル環境をつくってみた

を実行すると sqlite の select 文の結果は文字化けする。そして cmder でも、 chcp 932 すれば文字化けは解消する。これは、接続してから PRAGMA encoding; で確認できるsqlite のデータベース内の文字コード(デフォルトで utf8)とは別問題。

逆に上記の完全なutf8設定はどこで必要になるかというと、plink.exe をつかって linux サーバに接続した際など、この設定をしていないと文字化けする。そして、plink.exe で接続しても表示が変になったりする部分もあり、使い勝手があまりよくない。ssh だと問題が無いので、$PROFILE によくつなぐ ssh へのエイリアスを書いたり、putty -load [セッション名]putty を呼び出すなどで対応するのが良いと思う。(ちなみに plink にはいろいろバージョンがあって、PLINK 1.9Download PuTTY: latest release (0.76)plinkとは随分仕様が違う…、これで手間取ってしまった)

Flutter で Android studio に同梱されている java を使うように指定する

Windows で Flutter 開発環境を整え中。

flutter doctor するとライセンスがどうのこうのと言われて指示された通り flutter doctor --android-licenses すると

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 5 more

と言われることがある。javaのバージョンの問題で、Flutter 使うときに同時に入れることになる Android studiojava なら問題が起こらないはず。 環境変数 JAVA_HOME を変更すれば使ってくれるので、

set JAVA_HOME="C:\Program Files\Android\Android Studio\jre"

のようにしてから、flutter doctor --android-licenses するとライセンスの許諾の画面が表示されて flutter doctor に成功する。インストールの設定によってはパスは適宜変更ください。

モバイルなど小さな画面用にCSSのみでtableを整形する

f:id:cm3ak:20210307214258p:plain
大きな画面での一般的な表

f:id:cm3ak:20210307214329p:plain
モバイルなど小さな画面用にCSSのみでtableを整形する

基本 td を display:block にすれば、表が折り返される。気をつけないといけないのは <!DOCTYPE html> 書いておかないと Webkit が display: block; を display: table-cell; に上書きしちゃうので、 <!DOCTYPE html>が必須。以下が実際に書いた css。border も削って、before 使って th 相当の部分を入れ込んでいる。

@media (max-width: 1200px) {
 th,td {
    display: block;
    border: 0px none !important;
 }
 tr{
    border: 1px solid #cbcbcb !important;
 }
 thead{
    display:none;
 }
 td:nth-child(2), td:nth-child(3) {
    padding-left: 3em;
 }
 td:nth-child(2)::before{
    content: "Country: ";
 }
 td:nth-child(3)::before{
    content: "Members: ";
 }
}

参考:

歴博の☆1~2レビューを読んでみた

現職の歴博、情報系研究員ということで周縁に居る感覚は否めないのだけど、結構好きです。まあ、これまでも僕は自分の居た場所は基本的に好きだったので、というか、組織としての好き嫌いを就活の時にある程度重視しているので、別に特段改めて言う必要も無いのですけど。で、Google Map上のレビューをなんとなく眺めてたら、1713件のレビューで総合4.3はすばらしく、これを築かれてきたスタッフの方々には頭が下がる。誰からも好かれるのは難しいし目指すべきでも無いだろうけれど、☆1~2のレビューを読んで分類して改善策を考えるという暇人なコトを休日の研究会前にしてしまったので、公開しておく。

(1) ☆の数間違えたんじゃないか?系(4件)

"Very nice day pass" や"とてもおもしろかったー"だけ書いて☆が1とか2とかそういうのあります。

(2) 子供の声を注意されて不快だった(1件)

程度にもよるので難しいのだけど、子供のある程度の声は許容したい。一方で、うるさいと注意してほしいというお客さんもいる。これは博物館一般の課題だと思う。すぐに改善策は思いつかないなぁ。

(3) ネトウヨさん(6件)

"歴史を捏造するなキムチ悪い" みたいなレビュー。否定する根拠まで書いているレビューはもちろん無いのだけど、だからといって無視しても良くないんだよね。これだけネトウヨ問題が前景化している中で、そういう人に、歴史研究のプロセスや展示の元となった資料、世間で流布している情報の整理などを提示して見せるというのは必要なのかもしれない。

(4) レプリカが多い(3件)

本物の資料が見たいという意見ですね。…実は僕はその「本物の資料が見たい」欲求が良く分からないので基本ノーコメントです。レプリカの質が低くてディテールが分からないというのなら分かるのだが、たぶんそういうわけではないよね…(精巧なレプリカはけっこうなお金をかけて作られていて、古い原資料は劣化しやすく展示できない)。「本物の資料が見たい」欲求が分かれば改善のしようもあるかも。

(5) (あまり期待されても困る役割を期待されている)(2件)

"日本史が好きな人には、いいかも"、"地元文化にもっと注視して"みたいなやつです。日本史に興味が無い人に興味を持ってもらうのも重要なコトだけど、それはうちが担う話じゃない気がする。各地域の資料館や初等教育の役割だと思う。特別展などで、他の分野との接合点から誘導するというのはやってるけど、興味の無い人を惹きつけられるポイントはあまりに多様で疎なので、国に1つの役割を担う大規模博物館という空間や時間が限定された体験では効率悪く、対象にしづらい。地元文化に関しては、各地の郷土資料館などと連携することで間接的に貢献しているので、住んでる場所や旅行先の各地の資料館を訪れてほしい。

(6) (値段が高い=)コスパが悪かった、コンテンツが期待外れだった(4件)

特別展のコンテンツ量が問題だったのか「特別展は国立のわりには、ちょっと…」と書かれていた、上野のトーハクの企画展と比べられたのかなぁ。トーハクさん企画展の展示品数多いしな。部屋的にもボリュームは出しにくいので、後述、ツアーやデジタルで補っていくしかないかも。でも、現行の特別展はボリュームについて文句は聞いたことないな。「展示がわかりにくい」というのもあった。どう分からなかったのかが分からないので具体的には対策しにくいけど、初心者向けツアーとか活動的な側面でフォローできればいいかな。「展示方法が昭和です」例えば、デジタルな展示は企画展ではやったけど常設展では少ないですね、もっと導入できるようにはしたい。


というわけで、{分かりやすく/コンテンツ量を増す/新しい体験}のためのデジタル展示の導入、歴史研究のプロセスや展示の元となった資料、世間で流布している情報の整理などを提示して見せることによる<正しい>歴史認識の醸成の支援、あたりは僕も関われることだと思った。子供の声の件は、すごく大事な点なのだけど皆目対策が思いつかん、とりあえず情報収集は心掛けてみます。「歴博」というキーワードではてなブログの関連ブログが拾えたり、Twitterでもレビュー的なのは拾えるので、そういうのから意見を拾い上げてきて一覧する支援もできればいいのかも。今回は人手でやったけど。

CIDOC に関するドキュメントの一部翻訳 その2:タイプ

頻出する type。核となる概念といっても差し支えない。rdf:type とは一緒なのか、どう使うのか。Definition of the CIDOC Conceptual Reference Model から。

About Types

Virtually all structured descriptions of museum objects begin with a unique object identifier and information about the "type" of the object, often in a set of fields with names like "Classification", "Category", "Object Type", "Object Name", etc. All these fields are used for terms that declare that the object belongs to a particular category of items. In the CIDOC CRM the class E55 Type comprises such terms from thesauri and controlled vocabularies used to characterize and classify instances of CIDOC CRM classes. Instances of E55 Type represent concepts (universals) in contrast to instances of E41 Appellation, which are used to name instances of CIDOC CRM classes.

For this purpose the CIDOC CRM provides two basic properties that describe classification with terminology, corresponding to what is the current practice in the majority of information systems. The class E1 CRM Entity is the domain of the property P2 has type (is type of), which has the range E55 Type. Consequently, every class in the CIDOC CRM, with the exception of E59 Primitive Value, inherits the property P2 has type (is type of). This provides a general alternative mechanism to specialize the classification of CIDOC CRM instances to any level of detail, by linking to external vocabulary sources, thesauri, classification schemas or ontologies.

Analogous to the function of the P2 has type (is type of) property, some properties in the CIDOC CRM are associated with an additional property. These are numbered in the CIDOC CRM documentation with a ‘.1’ extension. The range of these properties of properties always falls under E55 Type. The purpose of a property of a property is to provide an alternative mechanism to specialize its domain property through the use of property subtypes declared as instances of E55 Type. They do not appear in the property hierarchy list but are included as part of the property declarations and referred to in the class declarations. For example, P62.1 mode of depiction: E55 Type is associated with E24 Physical Man-made Thing. P62 depicts (is depicted by): E1 CRM Entity. The class E55 Type also serves as the range of properties that relate to categorical knowledge commonly found in cultural documentation. For example, the property P125 used object of type (was type of object used in) enables the CIDOC CRM to express statements such as “this casting was produced using a mould”, meaning that there has been an unknown or unmentioned object, a mould, that was actually used. This enables the specific instance of the casting to be associated with the entire type of manufacturing devices known as moulds. Further, the objects of type “mould” would be related via P2 has type (is type of) to this term. This indirect relationship may actually help in detecting the unknown object in an integrated environment. On the other side, some casting may refer directly to a known mould via P16 used specific object (was used for). So a statistical question to how many objects in a certain collection are made with moulds could be answered correctly (following both paths through P16 used specific object (was used for) - P2 has type (is type of) and P125 used object of type (was type of object used in). This consistent treatment of categorical knowledge enhances the CIDOC CRM’s ability to integrate cultural knowledge.

Types, that is, instances of E55 Type and its subclasses, can be used to characterize the instances of a CIDOC CRM class and hence refine the meaning of the class. A type ‘artist’ can be used to characterize persons through P2 has type (is type of). On the other hand, in an art history application of the CIDOC CRM it can be adequate to extend the CIDOC CRM class E21 Person with a subclass E21.xx Artist. What is the difference of the type ‘artist’ and the class Artist? From an everyday conceptual point of view there is no difference. Both denote the concept ‘artist’ and identify the same set of persons. Thus in this setting a type could be seen as a class and the class of types may be seen as a metaclass. Since current systems do not provide an adequate control of user defined metaclasses, the CIDOC CRM prefers to model instances of E55 Type as if they were particulars, with the relationships described in the previous paragraphs.

Users may decide to implement a concept either as a subclass extending the CIDOC CRM class system or as an instance of E55 Type. A new subclass should only be created in case the concept is sufficiently stable and associated with additional explicitly modelled properties specific to it. Otherwise, an instance of E55 Type provides more flexibility of use. Users that may want to describe a discourse not only using a concept extending the CIDOC CRM but also describing the history of this concept itself, may choose to model the same concept both as subclass and as an instance of E55 Type with the same name. Similarly it should be regarded as good practice to foresee for each term hierarchy refining a CIDOC CRM class a term equivalent of this class as top term. For instance, a term hierarchy for instances of E21 Person may begin with “Person”. One role of E55 Type is to be the CIDOC CRM’s interface to domain specific ontologies and thesauri or less formal terminological systems. Such sets of concepts can be represented in the CIDOC CRM as subclasses of E55 Type, forming hierarchies of terms, i.e. instances of E55 Type linked via P127 has broader term (has narrower term). Such hierarchies may be extended with additional properties. Other standard models, in particular richer ones, used to describe terminological systems can also be interfaced with the CIDOC CRM by declaring their respective concept class as being equivalent to E55 Type, and their respective broader/narrower relation as being identical with P127 has broader term (has narrower term), as long as they are semantically compatible.

In addition to being an interface to external thesauri and classification systems, E55 Type is an ordinary class in the CIDOC CRM and a subclass of E28 Conceptual Object. E55 Type and its subclasses inherit all properties from this superclass. Thus together with the CIDOC CRM class E83 Type Creation the rigorous scholarly or scientific process that ensures a type is exhaustively described and appropriately named can be modelled inside the CIDOC CRM. In some cases, particularly in archaeology and the life sciences, E83 Type Creation requires the identification of an exemplary specimen and the publication of the type definition in an appropriate scholarly forum. This is very central to research in the life sciences, where a type would be referred to as a “taxon,” the type description as a “protologue,” and the exemplary specimens as “original element” or “holotype”. Finally, instances of E55 Type or suitable subclasses can describe universals from type systems not organized in thesauri or ontologies, such as industrial product names and types, defined and published by the producers themselves for each new product or product variant.

タイプについて

事実上、博物館の収蔵品のすべての構造化された記述は、一意の収蔵品識別子と収蔵品の種類(type)に関する情報から始まる。多くの場合、この「種類」に相当する内容は "Classification", "Category", "Object Type", "Object Name" といった項目に記述されている。これらの項目の記述はすべて、収蔵品が特定のカテゴリに属することを宣言するために使用されます。CIDOC CRM では、クラス E55 Type は CIDOC CRM クラスのインスタンスを特徴付け、分類するために使用されるシソーラス統制語彙からの用語で構成されています。E55 Typeインスタンスは概念(普遍)を表すものであり、CIDOC CRMのクラスのインスタンスの名前に使用されるE41 Appellationインスタンスとは対照的である。

この目的のために、CIDOC CRMは、情報システムの多くで現在行われていることに対応して、用語で分類を記述する2つの基本的なプロパティを提供しています。クラス E1 CRM Entity は、プロパティ P2 has type (is type of)ドメインであり、範囲は E55 Type です。したがって、CIDOC CRMのすべてのクラスは、E59 Primitive Value を除いて、プロパティ P2 has type (is type of) を継承します。これは、外部の語彙、シソーラス、分類体系、またはオントロジーにリンクすることによって、CIDOC CRMインスタンスの分類を任意のレベルまで詳細化するための一般的な代替メカニズムを提供します。

P2 has type(is type of) プロパティの機能と同様に、CIDOC CRM のいくつかのプロパティは、追加のプロパティに関連付けられています。これらの追加のプロパティは、CIDOC CRMのドキュメントでは ".1" という拡張子を付けて番号が付けられています。これらのプロパティのプロパティの範囲は常に E55 Type に該当します。プロパティのプロパティの目的は、E55 Typeインスタンスとして宣言されたプロパティサブタイプの使用を通じて、そのドメインプロパティを詳細化するための代替メカニズムを提供することです。それらは,プロパティ階層リストには現れないが,プロパティ宣言の一部として含まれ,クラス宣言の中で参照されます。例えばP62.1 mode of depiction : E55 Type は、 E24 Physical Man-made ThingP62 depicts (is depicted by): E1 CRM Entity していることに紐づけられてます。クラス E55 Type はまた、文化資源のドキュメンテーションにおいて一般的に見られるカテゴリ知識に関連するプロパティのレンジとしても機能します。例えば、プロパティP125 used object of type (was type of object used in) は、CIDOC CRMが「この鋳物は型を使って作られた」というような記述を表現することを可能にし、これは、実際に使用された型である未知のまたは言及されていないオブジェクトが存在したことを意味します。これにより、鋳型として知られている製造装置の種類全体に、鋳型の特定のインスタンスを関連付けることが可能となります。さらに、「鋳型」というタイプのオブジェクトは、P2 has type (is type of) を介して関連づけられるでしょう。このような間接的な関係は、実際には、統合された環境の中で未知の物体を検出するのに役立つかもしれません。一方、いくつかの鋳物は、P16 used specific object (was used for) を介して、既知の鋳型を直接参照している場合があります。したがって、あるコレクションの中でどのくらいの数のオブジェクトが金型で作られているかという統計的な質問は、(P16 used specific object (was used for) - P2 has type (is type of) という経路と P125 used object of type (was type of object used in) と経路の両方をたどって)正しく答えられるかもしれません。このような一貫した分類知識の扱いは、CIDOC CRM の文化知識の統合能力を高めています。

タイプ、すなわち E55 Type とそのサブクラスのインスタンスは、CIDOC CRM クラスのインスタンスを特徴づけるために使用され、その結果、クラスの意味を洗練させることができます。タイプ artist は、P2 has type (is type of)を使って人物を特徴付けることができる。一方、CIDOC CRM の美術史アプリケーションでは、CIDOC CRM クラス E21 Person をサブクラス E21.xx Artist で拡張すれば十分です。タイプ artist とクラス E21.xx Artist の違いは何でしょう?日常的な概念の観点からは違いはありません。どちらも概念 artist を表し、同じ人の集合を識別します。したがって、この設定では、型はクラスとして見られ、型のクラスはメタクラスとして見られるかもしれません。現在のシステムではユーザ定義のメタクラスを十分に制御できないため、CIDOC CRMでは E55 Typeインスタンスを、前の段落で説明した P16やP125の関係を持ち、あたかも個物のものであるかのようにモデル化するべきだと考えています。

ユーザーは、CIDOC CRM クラスシステムを拡張したサブクラスとして、または E55 Typeインスタンスとして概念を実装することができます。新しいサブクラスは、その概念が十分に安定しており、その概念に固有の明示的にモデル化されたプロパティが追加されている場合にのみ作成されるべきです。それ以外の場合は、E55 Typeインスタンスの方がより柔軟に使用できます。CIDOC CRMを拡張した概念だけでなく、その概念自体の歴史も記述したい場合は、同じ概念をサブクラスとして、また同じ名前の E55 Typeインスタンスとして同時にモデル化することを選択することができます。同様に、CIDOC CRMクラスを詳細化した各階層の語について、元のCIDOC CRMクラスに相当する項を最上位項として想定しておくことが望ましいと考えられます。例えば、E21 Personインスタンスの用語階層は、最上位が Person であると良いということです。E55 Type の役割の一つは、CIDOC CRMドメイン固有のオントロジーシソーラス、あるいはあまり正式ではない用語体系へのインタフェイスとなることです。このような概念の集合は、CIDOC CRMにおいて E55 Type のサブクラスとして表現され、用語の階層を形成することができます。つまり、E55 TypeインスタンスP127 has broader term (has narrower term) で紐づけられるということです。このような階層は、追加のプロパティで拡張することができます。用語体系を記述するために使用される他の標準モデル、特にCIDOC CRMよりも詳細化したモデルも、意味的に互換性がある限り、それぞれの概念クラスを E55 Type と同等であると宣言し、広義・狭義関係を P127 has broader term(has narrower term) と同等であると宣言することで、CIDOC CRMと連携させることができます。

E55 Typeは、外部のシソーラスや分類システムへのインターフェースであることに加えて、CIDOC CRMの通常のクラスであり、E28 Conceptual Object のサブクラスでもあります。E55 Type とそのサブクラスは、このスーパークラスからすべてのプロパティを継承します。このようにして、CIDOC CRM のクラス E83 Type Creation とともに、型が網羅的に記述され、適切な名前が付けられるようにする厳密な学術的・科学的プロセスを CIDOC CRM の内部でモデル化することができます。特に考古学や生命科学の分野では、E83 Type Creation では模範的な標本を特定し、適切な学術的な場で型の定義を公表する必要がある場合があります。これは生命科学の研究において非常に重要なことであり、型を「分類群(taxon)」と呼び、型の説明を「初発表文(protologue)」と呼び、模範的な標本を「ホロタイプ(holotype)」*1と呼ぶことになります。

最後に、E55 Typeインスタンスまたは適切なサブクラスは、シソーラスオントロジーで構造化されていない型システムから作られる世界を記述することができる。その型システムとは例えば、工業製品名やその型が、各新製品または製品のバージョンについて生産者自身によって定義され、公開されているようなものである。

P2 has type (is type of) のスコープノート

This property allows sub typing of CIDOC CRM entities - a form of specialisation – through the use of a terminological hierarchy, or thesaurus.

The CIDOC CRM is intended to focus on the high-level entities and relationships needed to describe data structures. Consequently, it does not specialise entities any further than is required for this immediate purpose. However, entities in the isA hierarchy of the CIDOC CRM may by specialised into any number of sub entities, which can be defined in the E55 Type hierarchy. E41 Appellation, for example, may be specialised into “e-mail address”, “telephone number”, “post office box”, “URL” etc. none of which figures explicitly in the CIDOC CRM hierarchy. A comprehensive explanation about refining CIDOC CRM concepts by E55 Type is given in the section “About Types” in the section on “Specific Modelling Constructs” of this document.

このプロパティは、 CIDOC CRM エンティティのサブタイプ化 (詳細化の一形態) を、 用語階層またはシソーラスの使用によって可能にします。

CIDOC CRM は、データ構造を記述するために必要な上層のエンティティと関係に焦点を当てています。その結果、この直接の目的に必要な以上にエンティティを特化することはありません。しかし、CIDOC CRM の isA 階層に相当するエンティティは、E55 Type 階層で定義できる任意の数のサブエンティティに特化することができます。例えば、E41 Appellation は、「メールアドレス」、「電話番号」、「私書箱」、「URL」などに特化することができますが、これらはCIDOC CRMの階層では明示的に定義されていません。E55型によるCIDOC CRMの概念の洗練についての包括的な説明は、本文書の「特定のモデリング構造 (Specific Modelling Constructs)」の「型について(About Types)」の項で説明されています。

サブ疑問:P127 has broader term (has narrower term) と rdfs:subClassOf と skos:broader の関係は?

rdfs:subClassOf と skos 語彙の関係は、skosの方が「緩い」と理解できる。SKOS入門によると、

既存のRDFS/OWLオントロジーをSKOS概念体系に変換する場合を考えてみてください。このような場合には、すべての rdfs:subClassOf ステートメントを skos:broader として解釈し直すことは妥当です。

ので、rdfs:subClassOf で記述できるものは skos:broader で書けるが、

例えば、ex2:vehicles(乗り物)がex2:cars(車)より広義と述べられており、そのex2:cars(車)はex2:wheels(自動車)より広義と言明さているケースを考えてみてください。「wheels」が「vehicles」に関するより狭義の概念であると自動的に推論されれば、問題がありえます。SKOSは、skos:broaderとskos:narrowerが一般的に推移的なプロパティーであると定義しないことによって、このような問題を予測します。「推移的階層」を表現したい場合は、4.5項を読むことをお勧めします。この項で定義しているskos:broaderのセマンティクスとの互換性を担保しつつ、これを行う方法を示しています。

と書かれているように skos:broader は必ずしも rdfs:subClassOf に変換できないので、skos:broader の方が緩いと言えるのだ。

さて、P127 has broader term (has narrower term) と skos:broader については AAT Semantic Representation という文書(w3cメーリングリストに投稿されたものである。ここは公式ではないがAAT Semantic Representation - W3C Public Mailing List Archivesが見やすい)に以下の文があり、これはTGN(要は地名辞書)を想定しているが、CRMサイドとSKOSサイドで意見が異なる。私はこの解釈自体はSKOS側が正しく、概念(concepts, universals) と個々の地名(places, particulars) の双方に skos:broader は使えると考える。緩いから。一方で、CRMサイドがskosを個物に用いたくないのは分かる。その緩さがセマンティックスが混乱を引き起こすからであり、概念の関係は語彙の名前の対応( "has broader term" と "broader" )を見ても分かるように、skos の語彙と意味が対応していて、個物については P89 falls within を別途用意しているからそっちを使ってもらいたいのだ。だから、単に P127 has broader term (has narrower term) と skos:broader の1対1対応を諦めれば良い話である。CRMの関連語彙の union がskos:broader だということにすればよい。つまり、CRMの中で skos:broader は混乱を引き起こすので使わないほうがいいという結論にもなる。

CIDOC CRM uses distinct and unrelated properties for this:

  • P2 has type for "place type" and P127 has broader term for "place super-type". P127 is an analog of skos:broader
  • P89 falls within for "super-place" (earlier versions also had P88i forms part of)

Some in the CRM community (including Martin Doerr) contend that SKOS should be used only for concepts (universals), and not for named entities such as places (particulars). Some in the SKOS community (including Antoine Isaac) disagree. There are many SKOS thesauri that capture places, e.g. NISV's GTAA (e.g. Amsterdam http://data.beeldengeluid.nl/gtaa/31586). It's clear that TGN will be published as a SKOS thesaurus, with additional place-specific classes and properties. We'll respect a "concept-thing" dichotomy, using foaf:focus to relate the two. E.g.

tgn:7018759-concept a skos:Concept;
  foaf:focus tgn:7018759-place;
  skos:prefLabel "Sofiya-Grad";
  gvp:broaderPartitive tgn:7006413-concept; # Bulgaria
  gvp:placeType aat:123456. # region (administrative division)
tgn:7018759-place a geo:SpatialThing, crm:E53_Place, <Place classes from other ontologies>;
  skos:prefLabel "Sofiya-Grad"; crm:P87_is_identified_by [crm:P3_has_note "Sofiya-Grad"];
  dc:type aat:123456; crm:P2_has_type aat:123456; # region (administrative division)
  geo:lat 42.6830; geo:long 23.3160 .

tgn:7006413-concept a skos:Concept;
  foaf:focus tgn:7006413-place;
  skos:prefLabel "Bulgaria";
  gvp:placeType aat:123457. # Nation
tgn:7006413-place a geo:SpatialThing, crm:E53_Place, <Place classes from other ontologies>;
  skos:prefLabel "Bulgaria"; crm:P87_is_identified_by [crm:P3_has_note "Bulgaria"];
  dc:type aat:123457; crm:P2_has_type aat:123457; # Nation
  geo:lat 43.0; geo:long 25.0 .

結局 rdf:type とはどう違うのか

A rdf:type B を CIDOC-CRM では"日"型のドミノ的な方形を利用して上にB下にAを使って表現することが多い。より正確に言えば、AやBのラベルを上下に書き込み、URIで書くという概念は特にない(長らくcrmURIは定まっていなかったほどだ)。公式文書でも使われている記法で "in boxes showing the class label above the instance label." と書いている。

それと並行して、 このAとBのペアから P2 has type で結ばれる C rdf:type D のドミノは、A と C の rdf:type 関係を表現することが多い。Dが E55 Type であり、メタクラスの役割を果たしている。上の翻訳の鋳型の例で "P16 used specific object (was used for) - P2 has type (is type of) という経路と P125 used object of type (was type of object used in) と経路" が同じペアを結びうることが書かれているが、この時の P2 has typerdf:type であることが明白である。そして、B と C の間の関係は C rdfs:subClassOf B の関係にあり、それがタイプによる詳細化として機能しているメカニズムである。このように使われるため P2 has type は "C rdfs:subClassOf B を含意した rdf:type"と言い換えても大丈夫だろう。

f:id:cm3ak:20200829203604p:plain

公式文書より。1つめは、物である(コピー元の)ラオコーン像がヘレニズム風様式であることを示している。この has type は、ヘレニズム風様式の物というサブクラスにラオコーン像を位置づけなおしている。もう一つ、コピー先はコピーだから、コピーというタイプが付されている。これも、rdf:type。

もう一つ公式系のRDF化に関わるスライドより。

f:id:cm3ak:20200829205505p:plain

まあRDFに関わるものなので少し特殊で、label ではなく、URIが下のボックスに入っている。P2 has Type の意味も rdf:type。

非公式で古いが、CIDOC CRM 入門 にある Type の例の "Dimension Type | length" では Dimension Type が独自か古いかでよくわからないが、n-aryを実現するための長さの無名の抽象表現にlengthクラスが紐づいているので rdf:type と読めるだろう。

ここまで理解してから

現在のシステムではユーザ定義のメタクラスを十分に制御できないため、CIDOC CRMでは E55 Type のインスタンスを、前の段落で説明した P2やP16やP125の関係を持ち、あたかも個物のものであるかのようにモデル化するべきだと考えています。

というフレーズを読み返すと、いくつかのプロパティが意味階層の違うものを結んでいる( rdf:type を含意する関係)という設計が理解できるだろう。

*1:原文では original element とも呼ぶと書かれているが、分類学研究者と共同研究をしていて、一度もその呼び名は出てこなかったし、今ググってもあまり出てこないので省略した