

def urn_to_hrn(urn):
    '\n    convert a urn to hrn\n    return a tuple (hrn, type)\n    '
    if ((not urn) or (not hrn.startswith(URN_PREFIX))):
        return (urn, None)
    name = urn[len(URN_PREFIX):]
    hrn_parts = name.split('+')
    type = hrn_parts.pop(2)
    if (type == 'authority'):
        hrn_parts = hrn_parts[:(- 1)]
    hrn = '.'.join([part.replace(':', '.') for part in hrn_parts if part])
    return (str(hrn), str(type))

dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/sfa/util/namespace.py urn_to_hrn/VarMisuse@21/57 `urn`->`hrn`