Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, type_uri=SBOL_COMBINATORIAL_DERIVATION, uri=URIRef("example"), strategy='http://sbols.org/v2#enumerate', version=VERSION_STRING):
super().__init__(type_uri, uri, version)
self._strategy = URIProperty(self, SBOL_STRATEGY, '1', '1', []) # TODO in original source, it doesn't look like strategy is used
self.masterTemplate = ReferencedObject(self, SBOL_TEMPLATE, SBOL_COMBINATORIAL_DERIVATION, '0', '1', [])
self.variableComponents = OwnedObject(self, SBOL_VARIABLE_COMPONENTS, '0', '*', [])
self.analyses = OwnedObject(self, SYSBIO_ANALYSIS, '0', '*', [libsbol_rule_14])
self.componentDefinitions = OwnedObject(self, SBOL_COMPONENT_DEFINITION, '0', '*', None)
self.moduleDefinitions = OwnedObject(self, SBOL_MODULE_DEFINITION, '0', '*', None)
self.models = OwnedObject(self, SBOL_MODEL, '0', '*', None)
self.sequences = OwnedObject(self, SBOL_SEQUENCE, '0', '*', None)
self.collections = OwnedObject(self, SBOL_COLLECTION, '0', '*', None)
self.activities = OwnedObject(self, PROVO_ACTIVITY, '0', '*', None)
self.plans = OwnedObject(self, PROVO_PLAN, '0', '*', None)
self.agents = OwnedObject(self, PROVO_AGENT, '0', '*', None)
self.attachments = OwnedObject(self, SBOL_ATTACHMENT, '0', '*', None)
self.combinatorialderivations = OwnedObject(self, SBOL_COMBINATORIAL_DERIVATION, '0', '*', None)
self.implementations = OwnedObject(self, SBOL_IMPLEMENTATION, '0', '*', None)
self.sampleRosters = OwnedObject(self, SYSBIO_SAMPLE_ROSTER, '0', '*', [validation.libsbol_rule_16])
self.experiments = OwnedObject(self, SBOL_EXPERIMENT, '0', '*', None)
self.experimentalData = OwnedObject(self, SBOL_EXPERIMENTAL_DATA, '0', '*', None)
self._citations = URIProperty(self, PURL_URI + "bibliographicCitation", '0', '*', None)
self._keywords = URIProperty(self, PURL_URI + "elements/1.1/subject", '0', '*', None)
def __init__(self, rdf_type, uri, definition, access, version):
super().__init__(rdf_type, uri, version)
self.definition = ReferencedObject(self, SBOL_DEFINITION, SBOL_COMPONENT_DEFINITION, '1', '1', [], definition)
self._access = URIProperty(self, SBOL_ACCESS, '0', '1', [], access)
self.mapsTos = OwnedObject(self, SBOL_MAPS_TOS, '0', '*', [])
self.measurements = OwnedObject(self, SBOL_MEASUREMENTS, '0', '*', [])
def __init__(self, type_uri=SBOL_MAPS_TO, uri=URIRef('example'), local='', remote='', refinement=SBOL_REFINEMENT_VERIFY_IDENTICAL, version=VERSION_STRING):
super().__init__(type_uri, uri, version)
self.local = ReferencedObject(self, SBOL_LOCAL, SBOL_COMPONENT, '1', '1', [], local)
self.remote = ReferencedObject(self, SBOL_REMOTE, SBOL_COMPONENT, '1', '1', [], remote)
self._refinement = URIProperty(self, SBOL_REFINEMENT, '1', '1', [], refinement)
def __init__(self, rdf_type=SBOL_MODEL, uri=URIRef('example'), source='', language=EDAM_SBML, framework=SBO_CONTINUOUS, version=VERSION_STRING):
super().__init__(rdf_type, uri, version)
self._source = URIProperty(self, SBOL_SOURCE, '0', '1', [], source)
self._language = URIProperty(self, SBOL_LANGUAGE, '0', '1', [], language)
self._framework = URIProperty(self, SBOL_FRAMEWORK, '0', '1', [], framework)
def __init__(self, type_uri=SBOL_ATTACHMENT, uri=URIRef("example"), version=VERSION_STRING, source=''):
super().__init__(type_uri, uri, version)
self._source = URIProperty(self, SBOL_SOURCE, '1', '1', [], source)
self._format = LiteralProperty(self, SBOL_URI, '#format', '0', '1', [])
self._size = LiteralProperty(self, SBOL_URI, '#size', '0', '1', [])
self._hash = LiteralProperty(self, SBOL_URI, '#hash', '0', '1', [])
def __init__(self, type_uri=SBOL_LOCATION, uri=URIRef('example'), orientation=SBOL_ORIENTATION_INLINE):
super().__init__(type_uri, uri)
self._orientation = URIProperty(self, SBOL_ORIENTATION, '1', '1', [], orientation)
self.sequence = ReferencedObject(self, SBOL_SEQUENCE_PROPERTY, SBOL_SEQUENCE, '0', '1', [])
def __init__(self, uri=URIRef('example'), value=0.0, unit='', version=VERSION_STRING):
super().__init__(SBOL_MEASURE, uri, version)
self._value = LiteralProperty(self, SBOL_VALUE, '1', '1', [], value)
self._unit = URIProperty(self, SBOL_UNIT, '1', '1', [], unit)
self._types = URIProperty(self, SBOL_TYPES, '0', '*', [])
else:
# the list is actually not a list, but a single element, even
# though lists are supported.
self._sbol_owner.properties[self._rdf_type].append(URIRef(new_value_list))
def add(self, new_value):
if self._sbol_owner is not None:
if self._rdf_type not in self._sbol_owner.properties:
self._sbol_owner.properties[self._rdf_type] = []
properties = self._sbol_owner.properties[self._rdf_type]
properties.append(Literal(new_value))
else:
self.logger.error("Unable to update property: SBOL owner not set.")
class OwnedObject(URIProperty):
def __init__(self, property_owner, sbol_uri, lower_bound, upper_bound, validation_rules=None, first_object=None):
"""Initialize a container and optionally put the first object in it.
If validation rules are specified, they will be checked upon initialization.
"""
super().__init__(property_owner, sbol_uri, lower_bound, upper_bound, validation_rules, first_object)
# Register Property in owner Object
if self._sbol_owner is not None:
self._sbol_owner.properties.pop(sbol_uri, None)
self._sbol_owner.owned_objects[sbol_uri] = [] # vector of SBOLObjects
if first_object is not None:
self._sbol_owner.owned_objects[sbol_uri].append(first_object)
def add(self, sbol_obj):
if self._sbol_owner is not None:
if sbol_obj.is_top_level() and self._sbol_owner.doc is not None:
self._sbol_owner.doc.add(sbol_obj)
def __init__(self, type_uri=SBOL_COLLECTION, uri=URIRef("example"), version=VERSION_STRING):
super().__init__(type_uri, uri, version)
self._members = URIProperty(self, SBOL_MEMBERS, '0', '*', [])