Drafts

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

Annotation Properties の Semantics

2009-09-07 に書かれた Dublin Core in OWL 2 という文書には

And annotation properties allow for both because they have no semantic relevance for reasoning.

というくだりがあって、明確に Literal しか目的語に取らない Data Properties と、目的語に任意の individual を取る Object Properties に対し、どっちとるかわからない場合に押し込める先としての (Dirty?) Hack が頭にあった。

で、先日書いた「意味」の認識を更新し続けるためのフレームワークを書いた論文にも domain がハッキリしない述語に関して owl2 の semantics を引いて注を加えたのだが、そこで引いたOWL 2 Web Ontology Language Structural Specification and Functional-Style Syntax (Second Edition)の中に以下のくだりを見つけてしまった。

For annotations properties note that annotations are not "semantic-free" under the OWL 2 RDF-Based Semantics. Just like every other triple or set of triples occurring in an RDF graph, an annotation is assigned a truth value by any given OWL 2 RDF-Based interpretation. Hence, although annotations are meant to be "semantically weak", i.e., their formal meaning does not significantly exceed that originating from the RDF Semantics specification, adding an annotation may still change the meaning of an ontology. A similar discussion holds for statements that are built from ontology properties, such as owl:imports, which are used to define relationships between two ontologies.

確かに "semantically weak" だとは認めているが、annotation property の値が主語の意味を変えうると書いている(この文脈では主語は TBox の中の語彙が想定されている)。そりゃ、元の文脈で、X は ObjectProperty or DataProperty ∧ どちらも意味を持つ → X は意味を持つ、ことが当然推論されるので、"semantic-free" だとは思っていないが、じゃあそもそも "semantically weak" だとか議論する意味はどこにあったのだろうと疑問になる。OWL 意味論で拡張される部分が無いと言いたいのだろうか。

ここらへんを手がかりに Annotation Properties の Semantics を考えることで、「どっちとるかわからない場合に押し込める」というのはどのくらい正しいのか検討してみたい。

ウェブのオントロジー言語OWL -- ウェブに存在するものとその関係の定義では、

プロパティには、個体(オブジェクト)を別の個体(オブジェクト)と関連づける個体値型プロパティと、オブジェクトをデータ型値に結びつけるデータ値型プロパティがあります。両者はそれぞれowl:ObjectProperty要素、owl:DatatypeProperty要素で定義します。また、特別なプロパティとしてオントロジーの管理情報を記述するowl:OntologyProperty、オントロジーの注釈に用いるowl:AnnotationPropertyがあります。OWLでのプロパティは、必ずこの4つのどれかのタイプを持たなければなりません(個体の記述に用いるのは個体値型もしくはデータ値型のみ)。

と書かれている。Dublin Core も個々の書誌情報の記述=個体の記述なのだから、Annotaion Properties を用いるのは正しくないことになる。ところでこの制約はどこから来ているのか。

OWL 2 Web Ontology Language New Features and Rationale の punningあたりを見ていると、これは OWL 1 の制約であって、OWL 2 ではその制約が緩められている。さっきの制約を記述したページはとても古く、おそらく OWL 2 の変更を反映していないと考えられる。

ちなみに、Annotation Properties の特殊性は、OWL 2 Web Ontology Language Structural Specification and Functional-Style Syntax (Second Edition) #5.5 Annotation Properties にも "IRIs from the reserved vocabulary other than the ones listed above must not be used to identify annotation properties in an OWL 2 DL ontology." という形で、OWL 2 DL においては 9つの Annotation Properties しか許容されないと書いている。これは、これら9つしか OWL 2 DL において意味論がハッキリしていないからというだけであって、その Annotation Property を用いる対象自体は"Annotation properties can be used to provide an annotation for an ontology, axiom, or an IRI." と書いているので個体に対して用いるのもアリだ。

だって、この9つというのは、

  • The rdfs:label annotation property can be used to provide an IRI with a human-readable label.
  • The rdfs:comment annotation property can be used to provide an IRI with a human-readable comment.
  • The rdfs:seeAlso annotation property can be used to provide an IRI with another IRI such that the latter provides additional information about the former.
  • The rdfs:isDefinedBy annotation property can be used to provide an IRI with another IRI such that the latter provides information about the definition of the former; the way in which this information is provided is not described by this specification.
  • An annotation with the owl:deprecated annotation property and the value equal to "true"^^xsd:boolean can be used to specify that an IRI is deprecated.
  • The owl:versionInfo annotation property can be used to provide an IRI with a string that describes the IRI's version.
  • The owl:priorVersion annotation property is described in more detail in Section 3.5.
  • The owl:backwardCompatibleWith annotation property is described in more detail in Section 3.5.
  • The owl:incompatibleWith annotation property is described in more detail in Section 3.5.

なんだから、rdfs:label が個体に用いれないとなったら大変だ。

あと、 OWL 2 の RDF-Based Semanticsにおいて、Table 5.1 と 5.2 を見る限り、owl:AnnotationProperty の domain と range は IOAP に等しく、その外延が IR × IR であり、IR は空集合を除くすべての要素を指すわけだから、 domain と range の観点からしていえば "semantic-free" だ。一方で、semantics は domain と range にだけ依存する(≒型にのみ依存する)わけではないので、用法としてどんなIRIに用いても意味があるかは微妙。

そして、この domain や range の面からは全く制約できないこと、部分集合に対してしか意味論をキッチリ定義できないこと、あたりを指して "semantically weak" と言わざるを得ないのだと思う。一般的にはこれはもっとポジティブに「人間にとって"意味"があるが、機械にとって"意味"がない」という認識がなされていると思うが、つまり人間にとってどう意味があるか定式化できないんでしょう。


ここまで見てくると、Annotation Properties は 弱い Semantics を有していて、それは domain や range で規定されるようなものではなくて、推論機構によってはちゃんと規定された Semantics を有している Annotation Properties は9つだけに限られていたりする。そうすると、目的語が何かわからないから Dublin Core のような語彙を Annotation Property にしておくといのは Dirty Hack くさい(そういう domain や range の議論の外に Annotation Properties の Semantics の核があるから)。一方で、title が常にリテラル値を取ると決めたならば、rdfs:label の subproperty にしてしまえばいいのだ。元の"Dublin Core in OWL 2"ではdcterms:titleリテラル値以外を取るかもしれないなんて書かれているが、2012年更新版では明確にリテラル値だと書かれているのだし。

もし、リテラルかindividualかどちらを取るかわからない述語があれば、単に Property だとだけ定義しておけばいいし、その Semantics を明確に定義したければ、Object Property にしておいて、リテラル値を目的語に取りたいときには、

A 今議論している述語 [rdfs:label リテラル値].

のように空ノードを用いて individual 化すればよいのではないかと思う。こうして置くことには意義があり、SPARQLでクエリを書くときに、(間に挟まるのが Named か Non-nammed Individual かという違いはあれど)リテラル値 は同じ位置に来るため、SequencePath を用いてシンプルに書くことができる。なによりモデル構造が統一されるのは気持ちいいではないか(笑)なんにせよ、range の曖昧性は Annotation Properties を採用する理由にしてはならないと思う。

日本語でこれを書いてもこの議論に興味と見識がある人はかなり限られると思うけれど、変なところがあったらぜひ忌憚なくご指摘ください。