How to use the sbol3.config.ConfigOptions.SBOL_COMPLIANT_URIS function in sbol3

To help you get started, we’ve selected a few sbol3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SynBioDex / pySBOL / sbol3 / config.py View on Github external
def autoconstructURI():
    if Config.getOption(ConfigOptions.SBOL_COMPLIANT_URIS) is False and hasHomespace():
        return getHomespace() + os.sep + randomIdentifier()
    elif Config.getOption(ConfigOptions.SBOL_COMPLIANT_URIS) is False and not hasHomespace():
        raise SBOLError('The autoconstructURI method requires a valid namespace authority. Use setHomespace().',
                        SBOLErrorCode.SBOL_ERROR_COMPLIANCE)
    else:
        raise SBOLError('The autoconstructURI method only works when SBOLCompliance flag is false. '
                        'Use setOption to disable SBOL-compliant URIs.', SBOLErrorCode.SBOL_ERROR_COMPLIANCE)
github SynBioDex / pySBOL / sbol3 / config.py View on Github external
def constructCompliantURI(sbol_type, display_id, version):
    if Config.getOption(ConfigOptions.SBOL_COMPLIANT_URIS.value) is True:
        return getHomespace() + os.sep + parseClassName(sbol_type) + os.sep + display_id + os.sep + version
    else:
        return ''