public static function EasyRdf_Namespace::get

Return a namespace given its prefix.

Parameters

string $prefix The namespace prefix (eg 'foaf'):

Return value

string The namespace URI (eg 'http://xmlns.com/foaf/0.1/')

8 calls to EasyRdf_Namespace::get()
EasyRdf_Namespace::expand in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Namespace.php
Expand a shortened URI (qname) back into a full URI.
EasyRdf_Parser_Rdfa::expandCurie in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rdfa.php
EasyRdf_Parser_Turtle::parseCollection in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php
Parses a collection [16], e.g: ( item1 item2 item3 ) @ignore
EasyRdf_Parser_Turtle::parseNumber in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php
Parses a numeric value, either of type integer, decimal or double @ignore
EasyRdf_Parser_Turtle::parsePredicate in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Turtle.php
Parse a predicate [11] @ignore

... See full list

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Namespace.php, line 117

Class

EasyRdf_Namespace
A namespace registry and manipulation class.

Code

public static function get($prefix) {
  if (!is_string($prefix) or $prefix === null or $prefix === '') {
    throw new InvalidArgumentException("\$prefix should be a string and cannot be null or empty");
  }
  if (preg_match('/\\W/', $prefix)) {
    throw new InvalidArgumentException("\$prefix should only contain alpha-numeric characters");
  }
  $prefix = strtolower($prefix);
  if (array_key_exists($prefix, self::$namespaces)) {
    return self::$namespaces[$prefix];
  }
  else {
    return null;
  }
}