Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_uri(self, id):
if Config.getOption(ConfigOptions.VERBOSE.value) is True:
print('SBOL compliant URIs are set to ' + Config.getOption(ConfigOptions.SBOL_COMPLIANT_URIS.value))
print('SBOL typed URIs are set to ' + Config.getOption(ConfigOptions.SBOL_TYPED_URIS.value))
print('Searching for ' + id)
# Search this property's object store for the uri
object_store = self._sbol_owner.owned_objects[self._rdf_type]
for obj in object_store:
if id == obj.identity:
return obj
# If searching by the full URI fails, assume the user is searching
# for an SBOL-compliant URI using the displayId only
# Form compliant URI for child object
parent_obj = self._sbol_owner
resource_namespaces = []
resource_namespaces.append(getHomespace())
if parent_obj.doc is not None:
for ns in parent_obj.doc.resource_namespaces:
resource_namespaces.append(ns)
# Check for regular, SBOL-compliant URIs