function replaceNamespace( address, namespaces ){
	    var separatorIndex = address.indexOf(":");
	    if ( separatorIndex === -1 ) {
	      return address;
	    }
	    var namespaceName = address.substring(0, separatorIndex);

	    for ( var i = 0, length = namespaces.length; i < length; ++i ) {
	      var namespace = namespaces[i];
	      if ( namespaceName === namespace.name ) {
	        return namespace.iri + address.substring(separatorIndex + 1);
	      }
	    }

	    return address;
	  }
/**
	   * Replaces the namespace (and the separator) if one exists and returns the new value.
	   * @param address the address with a namespace in it
	   * @param namespaces an array of namespaces
	   * @returns {string} the processed address with the (possibly) replaced namespace
	   */
Replaces the namespace (and the separator) if one exists and returns the new value.
@param address the address with a namespace in it
@param namespaces an array of namespaces
@returns {string} the processed address with the (possibly) replaced namespace
Replaces the namespace ( and the separator ) if one exists and returns the new value . @param address the address with a namespace in it @param namespaces an array of namespaces @returns { string } the processed address with the ( possibly ) replaced namespace
function replaceNamespace( address, namespaces ){
	    var separatorIndex = address.indexOf(":");
	    if ( separatorIndex === -1 ) {
	      return address;
	    }
	    var namespaceName = address.substring(0, separatorIndex);
	    for ( var i = 0, length = namespaces.length; i < length; ++i ) {
	      var namespace = namespaces[i];
	      if ( namespaceName === namespace.name ) {
	        return namespace.iri + address.substring(separatorIndex + 1);
	      }
	    }
	    return address;
	  }
function replaceNamespace ( address , namespaces ) { var separatorIndex = address . indexOf ( ":" ) ; if ( separatorIndex === - 1 ) { return address ; } var namespaceName = address . substring ( 0 , separatorIndex ) ; for ( var i = 0 , length = namespaces . length ; i < length ; ++ i ) { var namespace = namespaces [ i ] ; if ( namespaceName === namespace . name ) { return namespace . iri + address . substring ( separatorIndex + 1 ) ; } } return address ; }
Replaces the namespace (and the separator) if one exists and returns the new value.
Replaces the namespace ( and the separator ) if one exists and returns the new value .