Question: Why are URIs sometimes treated as literals in RDF?

The RDF data model distinguishes URIs and literals. When URIs appear in RDF syntaxes, they are marked up as URIs. For example, a triple with three URIs:

<http://richard.cyganiak.de/#me> <http://xmlns.com/foaf/0.1/homepage> <http://richard.cyganiak.de/> .

But sometimes, URIs appear as literals. This is often by mistake, but sometimes intentional. For example, vann:preferredNamespaceUri from the VANN vocabulary is supposed to be used like this:

<http://purl.org/vocab/vann/> <http://purl.org/vocab/vann/preferredNamespaceUri> "http://purl.org/vocab/vann/" .

I'm struggling to come up with a good explanation for this when teaching RDF or providing feedback to publishers. After all, if it's syntactically a URI, and the language provides a construct for URIs, then why not use the URI construct?

So my question is, can someone articulate a clear and simple rule for when URIs should be treated as literals in RDF? Something that's reasonably intuitive to developers and data modelers without deep knowledge of model theory and web architecture? Something short and sweet?

Asked by Richard Cyganiak on February 1st, 2011 at 14:22

Answer

You use the literal (preferably of type xsd:anyURI) to talk about the URI, and you use the URI to talk about the thing denoted by it. For example, in the following statement:

<http://zimmer.aprilfoolsreview.com/antoine#me> <http://ex.org/hasURI> "http://zimmer.aprilfoolsreview.com/antoine#me"^^xsd:anyURI .

the subject is me (a human being), who is not composed of hashes and slashes, while the object is the URI that denotes me, which does not have eyes, arms and brain. I cannot replace one by the other because one is identifying me while the other is identifying a sequence of characters.

Answered by Antoine Zimmermann on February 1st, 2011 at 15:35

Addendum

Tim Berners-Lee wrote a note about this topic in November 2017 in his series on Design Issues.