urirdfemail-addressiriturtle-rdf

Are email addresses without "mailto:" allowed as IRIs?


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?


Solution

  • 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>