0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【オントロジー】(18)OWLのプロパティ4

Posted at

※ 本記事はnote投稿の転載です。
https://note.com/super_crow2005/n/n68edda93a12d?magazine_key=m1df32e6ef6e1

個体(インディビデュアル)に限定で用いるプロパティもある。

ちょっと、個体について振り返りをする。個体に関する公理のことを「事実(fact)」と呼ぶ。基本的には、所属クラスとプロパティの値を設定することが公理であるが、これらは今まで見てきた記述そのものである。rdf:typeでクラスを明らかにし、ObjectPropertyのURIによってDatatypePropertyのデータ値を示す、というものである。

たとえば、趙州さんなら、

zen:趙州 $\mathbf{rdf:type}\ \ \ zen:人$.

であって、OWL書式では、次のようになる。

インディビデュアル「趙州さん」
<owl:NamedIndividual rdf:about="http://zen/zen#趙州">
  <rdf:type rdf:resource="http://zen/zen#人"/>
</owl:NamedIndividual>

そのような記述以外にも個体に特有の事実を記述するためのプロパティがある。

owl:sameAsは2つの個体が、名前(IRI)が異なっても同一であることを表す。
owl:differentFrom 2つの個体が異なることを表す。
owl:AllDifferent 全ての個体が異なることを表す。全ての個体は、プロパティowl:distinctMembersを使って並べる。

owl:sameAsについては、先ほどの人と禅としての人格について利用した。

owl:sameAsの例
<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>

ただ、これは少々、「わざと」このように記述したところもある。というのは属性としてしまって、DatatypePropertyとして「禅での名前」、コドメインを文字列として設定すればよさそうなものであるからである。

実際においては、まとまったオントロジーを設計し、個物(データ)を登録しているときに同じ、違うといったことはあまり気にしないのではなかろうか。

逆に、異なるデータベースのデータを合併したり参照したりする場合に必要となるだろう。RDBで、IDを紐づけるためのテーブルを作るとか、新しいIDをふり直すようなこともある。OWLでも異なる名前空間で作った個物同士を、同じものと見なすような場合に、owl:sameAsを用いると便利だろう。尤も、もともと別のドメイン(領域)のオントロジーとして開発したのだから、それらの個体が一致するものだろうか? データ件数の不整合もあり得る。アプリケーションを考えた上での処置となるだろう。

さて、owl:differentFromとowl:AllDifferentについて、書式の確認のために、例を示しておく。

differentFrom, AllDifferentの例
<owl:Class rdf:about="http://ttt/ttt#A"/>

<owl:NamedIndividual rdf:about="http://ttt/ttt#a">
  <rdf:type rdf:resource="http://ttt/ttt#A"/>
  <owl:differentFrom rdf:resource="http://ttt/ttt#b"/>
</owl:NamedIndividual>

<owl:NamedIndividual rdf:about="http://ttt/ttt#b">
  <rdf:type rdf:resource="http://ttt/ttt#A"/>
</owl:NamedIndividual>

<owl:NamedIndividual rdf:about="http://ttt/ttt#c">
  <rdf:type rdf:resource="http://ttt/ttt#A"/>
</owl:NamedIndividual>

<owl:NamedIndividual rdf:about="http://ttt/ttt#d">
  <rdf:type rdf:resource="http://ttt/ttt#A"/>
</owl:NamedIndividual>

<rdf:Description>
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AllDifferent"/>
  <owl:distinctMembers rdf:parseType="Collection">
    <rdf:Description rdf:about="http://ttt/ttt#a"/>
    <rdf:Description rdf:about="http://ttt/ttt#b"/>
    <rdf:Description rdf:about="http://ttt/ttt#c"/>
    <rdf:Description rdf:about="http://ttt/ttt#d"/>
  </owl:distinctMembers>
</rdf:Description>

owl:AllDifferentはリストされた全ての個体が、それぞれ異なることを意味するが、そもそもこれをwol:differentFromで記述しようとすると、対象が$n$個であるなら、${}_nC_2$の数だけ書かなければならない。しかもばらばらの個物の定義の記述に。これは大変だから、AllDIfferentを作ったのだと思われる。これなら、$n$個を並べるだけでよく、間違えにくいだろう。

AllDifferentは機能的にはプロパティになるのだろうが、OWLの記述的には、主語Sがないような、もしくはowl:AllDifferent自体が主語Sであるような感じであり、特殊な語彙といえるだろう。次のように書くとよくわかる。(英語のthere is構文みたいなものか)

AllDifferentの記述
<owl:AllDifferent>
  <owl:distinctMembers rdf:parseType="Collection">
    <rdf:Description rdf:about="http://ttt/ttt#a"/>
    <rdf:Description rdf:about="http://ttt/ttt#b"/>
    <rdf:Description rdf:about="http://ttt/ttt#c"/>
    <rdf:Description rdf:about="http://ttt/ttt#d"/>
  </owl:distinctMembers>
</owl:AllDifferent>

個物は、このように個々に別々のものと扱われる。普遍者はクラスであって、集合的に扱われていたが、個物はその集合の要素、といったイメージとなる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?