没有“mailto:”的电子邮件地址是否允许作为 IRI?

Die*_*nné 5 rdf uri email-address iri turtle-rdf

W3C 的 RDF Turtle 文档中,我遇到了两个使用电子邮件地址作为 IRI 的示例(16 和 17):

_:b <http://xmlns.com/foaf/0.1/mbox> <bob@example.com> .
Run Code Online (Sandbox Code Playgroud)

据我了解,如果电子邮件地址前面带有适当的方案(mailto:bob@example.com. 如果上例中的电子邮件地址应该是有效的 URI,则该语句实际上应为:

_:b <http://xmlns.com/foaf/0.1/mbox> <mailto:bob@example.com> .
Run Code Online (Sandbox Code Playgroud)

这是文档中的错误还是 IRI(与 URI 相对)不需要方案?

Jos*_*lor 4

虽然我认为在这些示例中使用类似mailto:bob@example.org 的内容更有意义,但它们在语法上似乎仍然是合法的。它们只是被解析为相对于基础的相对 URI。例如,当我使用 Jena 的 rdfcat 从 Turtle 进行转换时,我在 Turtle 和 RDF/XML 中得到以下输出。

@prefix : <urn:ex:> .
@base <http://example.org> .

:a :hasEmail <bob@example.org>.
Run Code Online (Sandbox Code Playgroud)

Turtle 和 RDF/XML 中的输出:

@prefix :      <urn:ex:> .

:a      :hasEmail  <http://example.org/bob@example.org> .
Run Code Online (Sandbox Code Playgroud)
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="urn:ex:">
  <rdf:Description rdf:about="urn:ex:a">
    <hasEmail rdf:resource="http://example.org/bob@example.org"/>
  </rdf:Description>
</rdf:RDF>
Run Code Online (Sandbox Code Playgroud)