Shorten a URI by substituting in the namespace prefix.
If $createNamespace is true, and the URI isn't part of an existing namespace, then EasyRdf will attempt to create a new namespace and use that namespace to shorten the URI (for example ns0:term).
If it isn't possible to shorten the URI, then null will be returned.
string $uri The full URI (eg 'http://xmlns.com/foaf/0.1/name'):
bool $createNamespace If true, a new namespace will be created:
string The shortened URI (eg 'foaf:name') or null
public static function shorten($uri, $createNamespace = false) {
if ($parts = self::splitUri($uri, $createNamespace)) {
return implode(':', $parts);
}
}