我正在使用 Protege 4.3 创建我的 OWL2 本体。最近我提到在添加注释属性 rdfs:label 时,您可以选择定义数据类型(例如 xsd:string)或语言(xml:lang)。但不可能同时定义两者。如果您选择数据类型,语言字段会变淡,反之亦然。
这可能是 Protege 特有的问题,但我想知道 OWL2 本身是否禁止同时使用数据类型和语言。我做了一些研究,但找不到任何明确提到这一点的文件。但我也找不到完成它的例子。像...
<Class rdf:about="MyClass">
<rdfs:label xml:lang="en" rdfs:Datatype="xsd:string">My special class</rdfs:label>
</Class>
……或者……
<http://example.org/AboutMe> ns0:gender "male"@en^^xsd:string .
我想上面的例子是无效的,但为什么呢?
最佳答案
你不能这样做。它不是 OWL 的属性,而是底层 RDF 的属性。来自资源描述框架 (RDF):概念和抽象语法:
3.4 Literals
Literals are used to identify values such as numbers and dates by means of a lexical representation. Anything represented by a literal could also be represented by a URI, but it is often more convenient or intuitive to use literals.
A literal may be the object of an RDF statement, but not the subject or the predicate.
Literals may be plain or typed:
- A plain literal is a string combined with an optional language tag. This may be used for plain text in a natural language. As recommended in the RDF formal semantics [RDF-SEMANTICS], these plain literals are self-denoting.
- A typed literal is a string combined with a datatype URI. It denotes the member of the identified datatype's value space obtained by applying the lexical-to-value mapping to the literal string.
有一个即将发布的 RDF 新版本,其中对此进行了一些简化。将不再有普通文字;一切都会有一个数据类型。曾经是纯文字的将具有相同的词法形式,并且将具有数据类型 xsd:string
。语言标记字符串的数据类型为 http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
。这在 3.3 Literals 中有描述。的 RDF 1.1 Concepts and Abstract Syntax: W3C Candidate Recommendation 05 November 2013 .不过,该文档在被接受之前可能会发生变化,因此如果您将其用作引用,请务必获取最新版本。
关于xml - 是否可以使用 xsd 数据类型(例如 xsd :string) and xml language attribute simultaneously in OWL2/RDF?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20468097/