def parseURI(str):
    """Parse an URI based on RFC 3986  URI-reference = [
       absoluteURI | relativeURI ] [ "#" fragment ] """
    ret = libxml2mod.xmlParseURI(str)
    if ret is None:raise uriError('xmlParseURI() failed')
    return URI(_obj=ret)