RDFリテラル

リテラル (RDF)

[1] RDF におけるリテラル (literal) は、資源でない (RDF URI参照によって表せない) 値です。

仕様書

構成要素

[6] リテラルは、次の3つの要素により構成されます >>4

[7] 字句形 (lexical form)
Unicode文字列NFC であるべきです
[8] データ型IRI (datatype IRI)
字句形がどうリテラル値写像されるかを決めるデータ型IRI
[9] 言語タグ (language tag)
BCP 47 言語タグ空文字列ではない、整形式言語タグでなければなりません

[26] 字句形NFC たるべき、という規定は、絶対的な要件ではないものの、 厳しい要件には違いありません。 NFC は破壊的な操作で、これが原因で文字化けが生じるおそれもあります。 従って任意の自然言語文を記述するために使うのは危険です。 正規化

[10] 言語タグは、データ型IRIhttp://www.w3.org/1999/02/22-rdf-syntax-ns#langString の時に限り含まれます。この場合のリテラルを特に言語タグ付き文字列といいます。

リテラル値

[11] リテラル値 (literal value) は次のように定義されています >>4

[17] >>16意味的不整合 (semantic inconsistency) ですが、構文的には非整形式ではありません。 実装は ill-typedリテラルも受け付けて RDFグラフを生成しなければなりません。 警告を出しても構いません>>4

等値性

[18] RDFリテラル等値 (equal) であるとは、その字句形データ型IRI言語タグがいずれも文字単位で等しいことをいいます >>4

[19] リテラル値が等しくても、字句形が異なれば等しいリテラルではありません。

歴史

[2] RDF 1.0 ではリテラルには次の種類がありました。

[5] RDF 1.1 ではすべて型付きリテラルになっています。平リテラル単純リテラル言語タグ付き文字列に相当します。

[21] RDF 1.0 では任意の符号位置が認められていたようですが、 RDF 1.1 では xs:string なので、 U+0000 を使えず、 U+0001-U+001F は認めなくても良いとされているようです >>20

[22] NLP Interchange Format (NIF) 2.0 - Core Specification (Sebastian Hellmann著, ) http://persistence.uni-leipzig.org/nlp2rdf/specification/core.html

According to the RDF 1.1 specification (3.3 Literals), RDF literals are Unicode strings, which should be in Normal Form C (NFC). In NIF, we will follow this recommendation in general. There are, however, circumstances which require the use of Normal Form D (NFD) or even NFKC or NFKD. Therefore NIF allows NFD, NFKC and NFKD, if the use case justifies the usage.

One such use case is, if a linguistic annotator has the requirement to annotate individual diacritics or parts of precomposed characters and syllables. For linguists with this use case or applicable languages, using NFD is obvious and well-justified. We will only give examples here and refer the interested reader to these three documents: Gernot Katzer's page about the Korean Writing system, Wikipedia article about the Korean Hangul, Unicode Normal Form specification.

[23] RDF Literal Direction Working Group Charter () https://w3c.github.io/rdf-dir-literal/draft-charter.html

[24] RDF Literals and Base Directions () https://w3c.github.io/rdf-dir-literal/

[25] w3c/rdf-dir-literal: Proposal to add base direction to RDF Literals () https://github.com/w3c/rdf-dir-literal