Docs For Class EasyRdf_Namespace

## Class EasyRdf_Namespace

Description

A namespace registry and manipulation class.

- copyright: Copyright (c) 2009-2010 Nicholas J Humfrey
- license: http://www.opensource.org/licenses/bsd-license.php

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])
Methods
static method delete (line 146)

Delete an existing namespace.

- access: public

static void delete (string $prefix)

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

static method expand (line 260)

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 89)

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 78)

Return all the namespaces registered

- return: Associative array of all the namespaces.
- access: public

static array namespaces ()
static method prefixOfUri (line 177)

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 163)

Delete the anonymous namespaces and reset the counter to 0

- access: public

static void reset ()
static method set (line 117)

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 216)

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

Documentation generated on Wed, 20 Jul 2011 19:54:04 +0100 by phpDocumentor 1.4.3