Expand a shortened URI (qname) back into a full URI.
If it isn't possible to expand the qname, for example if the namespace isn't registered, then the original string will be returned.
string $shortUri The short URI (eg 'foaf:name'):
string The full URI (eg 'http://xmlns.com/foaf/0.1/name')
public static function expand($shortUri) {
if (!is_string($shortUri) or empty($shortUri)) {
throw new InvalidArgumentException("\$shortUri should be a string and cannot be null or empty");
}
if (preg_match("/^(\\w+?):([\\w\\-]+)\$/", $shortUri, $matches)) {
$long = self::get($matches[1]);
if ($long) {
return $long . $matches[2];
}
}
elseif (preg_match("/^(\\w+)\$/", $shortUri) and isset(self::$default)) {
return self::$default . $shortUri;
}
return $shortUri;
}