Set the default namespace
Set the default namespace to either a URI or the prefix of an already defined namespace.
Example: EasyRdf_Namespace::setDefault('http://schema.org/');
string $namespace The URI or prefix of a namespace (eg 'og'):
public static function setDefault($namespace) {
if (empty($namespace)) {
self::$default = null;
}
elseif (preg_match("/^\\w+\$/", $namespace)) {
if (isset(self::$namespaces[$namespace])) {
self::$default = self::$namespaces[$namespace];
}
else {
throw new InvalidArgumentException("Unable to set default namespace to unknown prefix: {$namespace}");
}
}
else {
self::$default = $namespace;
}
}