Only check for is_valid_uri if not already cached
@@ -438,6 +438,8 @@ class NamespaceManager(object):
def compute_qname(self, uri: str, generate: bool = True) -> Tuple[str, URIRef, str]:
+ if uri not in self.__cache:
+
if not _is_valid_uri(uri):
raise ValueError(
'"{}" does not look like a valid URI, cannot serialize this. Did you want to urlencode it?'.format(
@@ -445,7 +447,6 @@ class NamespaceManager(object):
)
)
- if uri not in self.__cache:
try:
namespace, name = split_uri(uri)
except ValueError as e:
