public static function getNamespaceCOID(IRI $coid) {
    switch (self::getType($coid)) {
      case self::COID_ROOT:
        return $coid;
      case self::COID_UNVERSIONED:
      case self::COID_VERSIONED:
      case self::COID_VERSION_WILDCARD:
        return new IRI('coid://'.$coid->getHost());
      default:
        return null;
    }
  }