Last modified: 2009-12-30 12:56:16 UTC
Handling of tel: URIs, like for foaf:phone, is broken, as evident from the linked URL. Obviously there is some code that tries to turn arbitrary input into a valid URI, but it only tries to generate HTTP URIs, which gives funky results if a phone number was entered. Entering a valid tel: URI also doesn't quite work, because the "+" character is escaped as "%2B" -- see the phone number of Richard Cyganiak in the linked page. I've written some code to help fixing the issue. It's attached. It's not a patch, as I'm not familiar with SMW internals, but it should be helpful in fixing this issue. It consists of a function that 1. will take a string as input, 2. will try to recognize if it's a phone number (written as a tel URI or simply as numbers), 3. will turn the phone number into a valid tel URI and return it, 4. or return null if it cannot be recognized as a phone number. It's well-tested and closely follows the relevant RFC. I suggest adding this into the function that tries to generate valid URIs from user input.
Created attachment 6530 [details] Code for detecting phone numbers and validating tel URIs Adding attachment
The next version of SMW introduces a new datatype "Telephone number" based on your code. This should fix most problems with broken tel URIs in RDF export. The new code is already used on http://semanticweb.org and the RDF exports of that site should be updated within the next day.