Class EasyRdf_Namespace

Description

A namespace registry and manipulation class.

Located in /EasyRdf/Namespace.php (line 46)


	
			
Method Summary
static void delete (string $prefix)
static string expand (string $shortUri)
static string get (string $prefix)
static array namespaces ()
static string prefixOfUri (string $uri)
static void reset ()
static void set (string $prefix, string $long)
static string shorten (string $uri, [bool $createNamespace = false])
static array splitUri (string $uri, [bool $createNamespace = false])
Methods
static method delete (line 149)

Delete an existing namespace.

  • access: public
static void delete (string $prefix)
  • string $prefix: The namespace prefix (eg 'foaf')
static method expand (line 264)

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.

  • return: The full URI (eg 'http://xmlns.com/foaf/0.1/name')
  • access: public
static string expand (string $shortUri)
  • string $shortUri: The short URI (eg 'foaf:name')
static method get (line 92)

Return a namespace given its prefix.

  • return: The namespace URI (eg 'http://xmlns.com/foaf/0.1/')
  • access: public
static string get (string $prefix)
  • string $prefix: The namespace prefix (eg 'foaf')
static method namespaces (line 81)

Return all the namespaces registered

  • return: Associative array of all the namespaces.
  • access: public
static array namespaces ()
static method prefixOfUri (line 228)

Return the prefix namespace that a URI belongs to.

  • return: The prefix namespace that it is a part of(eg 'foaf')
  • access: public
static string prefixOfUri (string $uri)
  • string $uri: A full URI (eg 'http://xmlns.com/foaf/0.1/name')
static method reset (line 166)

Delete the anonymous namespaces and reset the counter to 0

  • access: public
static void reset ()
static method set (line 120)

Register a new namespace.

  • access: public
static void set (string $prefix, string $long)
  • string $prefix: The namespace prefix (eg 'foaf')
  • string $long: The namespace URI (eg 'http://xmlns.com/foaf/0.1/')
static method shorten (line 248)

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.

  • return: The shortened URI (eg 'foaf:name') or null
  • access: public
static string shorten (string $uri, [bool $createNamespace = false])
  • string $uri: The full URI (eg 'http://xmlns.com/foaf/0.1/name')
  • bool $createNamespace: If true, a new namespace will be created
static method splitUri (line 187)

Try and breakup a URI into a prefix and local part

If $createNamespace is true, and the URI isn't part of an existing namespace, then EasyRdf will attempt to create a new namespace and return the name of the new prefix (for example 'ns0', 'term').

If it isn't possible to split the URI, then null will be returned.

  • return: The split URI (eg 'foaf', 'name') or null
  • access: public
static array splitUri (string $uri, [bool $createNamespace = false])
  • string $uri: The full URI (eg 'http://xmlns.com/foaf/0.1/name')
  • bool $createNamespace: If true, a new namespace will be created

Documentation generated on Wed, 16 Jan 2013 19:16:38 +0000 by phpDocumentor 1.4.4