This is always a bit of a problem. Strictly speaking, this is actually allowed (at least, I think so, reading the specs). Quoting RDF Concepts and Abstract Syntax (
http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference ):
" A URI reference within an RDF graph (an RDF URI reference) is a Unicode string that:
* does not contain any control characters ( #x00 - #x1F, #x7F-#x9F)
* and would produce a valid URI character sequence (per RFC2396 [URI], sections 2.1) representing an absolute URI with optional fragment identifier when subjected to the encoding described below.
The encoding consists of:
1. encoding the Unicode string as UTF-8 [RFC-2279], giving a sequence of octet values.
2. %-escaping octets that do not correspond to permitted US-ASCII characters."
So, IMHO the above means that in an RDF graph, a URI Reference is a string that /when encoded/ would be an RFC-compliant URI. But the RDF URI _reference_ itself should not be encoded (so the white space is actually allowed in the reference).
It's tricky to get this right though: does this only apply to white spaces, or also to, for example, angle brackets (which would make parsing a whole lot trickier)? Hm, we need to take another deep dive into the specs I guess.