4

In the RDF Turtle documentation from W3C I came across two examples (16 and 17) where an email address was used as an IRI:

_:b <http://xmlns.com/foaf/0.1/mbox> <bob@example.com> .

As I understand it, email addresses are allowed as URIs when preceded with the appropriate scheme, i.e. mailto:bob@example.com. If the email address in the above example should be a valid URI then the statement should actually read:

_:b <http://xmlns.com/foaf/0.1/mbox> <mailto:bob@example.com> .

Is this an error in the documentation or do IRIs (as opposed to URIs) not require a scheme?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Dieudonné
  • 543
  • 1
  • 4
  • 16

1 Answers1

3

While I think it makes more sense to use something like mailto:bob@example.org in these examples, it appears that they're still syntactically legal. They're just resolved as relative URIs against the base. E.g., when I use Jena's rdfcat to convert from Turtle I get the following output in Turtle and RDF/XML.

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

:a :hasEmail <bob@example.org>.

Output in Turtle and RDF/XML:

@prefix :      <urn:ex:> .

:a      :hasEmail  <http://example.org/bob@example.org> .
<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>
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Thank you, I didn't expect it to be handled as relative URIs, but you are quite right. When I loaded the file using the swift library I am developing, it returned an URI I did not expect. But now I can see that it is indeed the base URI appended with the email address. :-) – Dieudonné Feb 19 '16 at 13:48