※ 本記事はnote投稿の転載です。
※ https://note.com/super_crow2005/n/n3a1b703adc80?magazine_key=m1df32e6ef6e1
他にも、プロパティの性質としては、ノード要素同士の関係を、形式的に捉えたものがある。論理的とも数学的ともいえると思うが、推移性と対称性である。推移性といえば$x\rightarrow y$かつ$y\rightarrow z$ならば$x\rightarrow z$になるということ。プロパティはノード間の矢印なので、つながった矢印があったら、一つ先のノードへの矢印がある、といったことになる。このプロパティは推意型プロパティと呼ばれ、owl:TransitivePropertyと書く。
$A$ $rdf:type$ $owl:class$.
$A2A$ $rdf:type$ $owl:TransitiveProperty$.
で、a, b, c$\ \mathbf{instance\_of}\ A$, a$\ \mathbf{A2A}$ b, b $ \mathbf{A2A}$ cならば、
a $\mathbf{A2A}$ c
であることになる。rdfs:subClassOf、rdfs:subPropertyOfは推意型のプロパティである。
対称性は$x\rightarrow y$なら$y\rightarrow x$ということである。セマンティック・ウェブの矢印は一方向なので、2つ矢印がそれぞれ逆向きになっているということになる。対象型プロパティowl:SymmetricPropertyという。
$B\ \ \ rdf:type\ \ \ owl:class$.
$B2B\ \ \ rdf:type\ \ \ owl:SymmetricProperty$.
a,b $\mathbf{instance\_of}\ \ \ B$.
ならば
a $\mathbf{B2B}$ b.
b $\mathbf{B2B}$ a.
ということである。推移型プロパティと対称型プロパティのいずれも、ドメインとコドメインは同じクラス(、集合)である。
趙州さんか過去に参加していた坐禅会の話をしよう。南泉師匠にも師匠はいたという。話によると、かなり由緒正しい坐禅の会であるようで、大昔はインドの険しい山の上、街中の竹林、富豪の庭といったところで修行していたらしい。それは置いといて、その由緒正しいことは、坐禅の方法を師匠が弟子を認定してきた習慣から来ている。南泉師匠にも師匠はおり、東馬さんという。禅の者としては「道(どう)」と呼ぶ。また東馬さんには弟子が多く、特に百丈さん(禅名は「海(かい)」)は南泉師匠が良くしてもらった兄弟弟子だったという。まあ、結構年上の兄弟子だったようで色々と教わったことも多かったようだ。趙州さんは、のんびりと取り組んできたので、特に坐禪の会も開かずにいて、弟子をどうしたものか、と心中焦っていたのであった。
まず、師匠が弟子を認定することを仏教では仏法を嗣ぐという意味で、「法を嗣ぐ」という。そして、その弟子のことを法嗣、または嗣法なんて呼んだりする。そこで「法を嗣ぐ」をプロパティとすれば、これは推移型プロパティである。因みに「認定する」や「師匠である」は、師匠が認定したことは師匠の師匠が認定することにはならないし、また師匠の師匠が師匠になるわけではないので推移型ではない(友達の友達は友達、が必ず成り立つならというなら推移型だろう)。これは「弟子が師匠の法を嗣ぐ」と弟子からみたことばであるが、逆に「師匠が弟子に法を授ける」ということでもある。「法を嗣ぐ」と「法を授ける」とは逆の関係owl:inverseOfである。ただ逆関数関係owl:InverseFunctionalPropertyではない(ドメインとコドメインの対象の関係が1対1ということではない)。対称型プロパティでもない。対称型はドメインとコドメインの要素を置き換えても成立するということであった。
対称型プロパティになるのは「兄弟弟子である」という関係だろう。南泉さんと百丈さんは兄弟弟子であった。このことはどちらを主語にしても目的語にしても成り立つ。
以上を全ての定義は以下のようになる。個物(owl:NamedIndividual)ではマニュアルで設定したものだけがファイルに出力されるが、protégéならreasonerを使えばプロパティの制約による関係が表示される。
<owl:ObjectProperty rdf:about="http://zen/zen#代表とする">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
<rdfs:domain rdf:resource="http://zen/zen#坐禅会"/>
<rdfs:range rdf:resource="http://zen/zen#人"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="http://zen/zen#兄弟弟子である">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="http://zen/zen#先生である">
<owl:equivalentProperty rdf:resource="http://zen/zen#師匠である"/>
<rdfs:domain rdf:resource="http://zen/zen#人"/>
<rdfs:range rdf:resource="http://zen/zen#人"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="http://zen/zen#師匠である">
<owl:inverseOf rdf:resource="http://zen/zen#弟子である"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="http://zen/zen#弟子である"/>
<owl:ObjectProperty rdf:about="http://zen/zen#法を嗣ぐ">
<owl:inverseOf rdf:resource="http://zen/zen#法を授ける"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="http://zen/zen#法を授ける">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="http://zen/zen#禅での人格">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
</owl:ObjectProperty>
<owl:Class rdf:about="http://zen/zen#人">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="http://zen/zen#禅での人格"/>
<owl:qualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:qualifiedCardinality>
<owl:onClass rdf:resource="http://zen/zen#人"/>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
<owl:Class rdf:about="http://zen/zen#坐禅会">
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="http://zen/zen#代表とする"/>
<owl:qualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:qualifiedCardinality>
<owl:onClass rdf:resource="http://zen/zen#人"/>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
<owl:NamedIndividual rdf:about="http://zen/zen#南泉">
<rdf:type rdf:resource="http://zen/zen#人"/>
<owl:sameAs rdf:resource="http://zen/zen#願"/>
<zen:兄弟弟子である rdf:resource="http://zen/zen#百丈"/>
<zen:先生である rdf:resource="http://zen/zen#趙州"/>
<zen:法を嗣ぐ rdf:resource="http://zen/zen#東馬"/>
<zen:禅での人格 rdf:resource="http://zen/zen#願"/>
</owl:NamedIndividual>
<owl:NamedIndividual rdf:about="http://zen/zen#南泉会">
<rdf:type rdf:resource="http://zen/zen#坐禅会"/>
<zen:代表とする rdf:resource="http://zen/zen#南泉"/>
<zen:代表とする rdf:resource="http://zen/zen#願"/>
</owl:NamedIndividual>
<owl:NamedIndividual rdf:about="http://zen/zen#東馬">
<rdf:type rdf:resource="http://zen/zen#人"/>
<owl:sameAs rdf:resource="http://zen/zen#道"/>
<zen:先生である rdf:resource="http://zen/zen#南泉"/>
<zen:先生である rdf:resource="http://zen/zen#百丈"/>
<zen:法を授ける rdf:resource="http://zen/zen#百丈"/>
<zen:禅での人格 rdf:resource="http://zen/zen#道"/>
</owl:NamedIndividual>
<owl:NamedIndividual rdf:about="http://zen/zen#海">
<rdf:type rdf:resource="http://zen/zen#人"/>
<owl:sameAs rdf:resource="http://zen/zen#百丈"/>
</owl:NamedIndividual>
<owl:NamedIndividual rdf:about="http://zen/zen#百丈">
<rdf:type rdf:resource="http://zen/zen#人"/>
<zen:禅での人格 rdf:resource="http://zen/zen#海"/>
</owl:NamedIndividual>
<owl:NamedIndividual rdf:about="http://zen/zen#諗">
<rdf:type rdf:resource="http://zen/zen#人"/>
<owl:sameAs rdf:resource="http://zen/zen#趙州"/>
</owl:NamedIndividual>
<owl:NamedIndividual rdf:about="http://zen/zen#趙州">
<rdf:type rdf:resource="http://zen/zen#人"/>
<zen:法を嗣ぐ rdf:resource="http://zen/zen#南泉"/>
<zen:禅での人格 rdf:resource="http://zen/zen#諗"/>
</owl:NamedIndividual>
<owl:NamedIndividual rdf:about="http://zen/zen#道">
<rdf:type rdf:resource="http://zen/zen#人"/>
</owl:NamedIndividual>
<owl:NamedIndividual rdf:about="http://zen/zen#願">
<rdf:type rdf:resource="http://zen/zen#人"/>
</owl:NamedIndividual>