From 2b32df98c588c999f06bb402006f58be9316a4c8 Mon Sep 17 00:00:00 2001 From: cmungall Date: Tue, 21 Dec 2021 19:04:15 -0800 Subject: [PATCH] Make prefix check rdflib compatible Replaces #96 For context see https://github.com/linkml/linkml/issues/537 --- linkml_runtime/utils/namespaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkml_runtime/utils/namespaces.py b/linkml_runtime/utils/namespaces.py index af88cf6c..aa3871ac 100644 --- a/linkml_runtime/utils/namespaces.py +++ b/linkml_runtime/utils/namespaces.py @@ -185,7 +185,7 @@ def uri_for(self, uri_or_curie: Any) -> URIRef: def uri_or_curie_for(self, prefix: Union[str, URIRef], suffix: str) -> str: """ Return a CURIE for prefix/suffix in possible, else a URI """ - if isinstance(prefix, URIRef) or ':/' in prefix: + if isinstance(prefix, URIRef) or ':/' in str(prefix): prefix_as_uri = str(prefix) for k, v in self.items(): if not k.startswith('@') and prefix_as_uri == str(v):