You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to get opil.ParameterValues from a strateos opil.ProtocolInterface (ex: CellFreeRiboswitches). I tried running the code below but unable to get desired information. What is the correct to do this?
Here is what I have tried so far.
importopilimportsbolfile_path='CellFreeRiboswitches.xml'opil_doc=opil.Document()
opil_doc.read(file_path, sbol3.RDF_XML)
opil_protocol_interfaces= [top_levelfortop_levelinopil_doc.objectsifisinstance(top_level, opil.ProtocolInterface)]
parameters=opil_protocol_interfaces[0].has_parameterparameter_values= []
forparameterinparameters:
ifparameter.default_value:
parameter_value=opil_doc.find(parameter.default_value)
ifparameter_value:
parameter_values.append(parameter_value)
iflen(parameter_values) ==0:
raiseException('Expecting ParameterValues but found none')
The text was updated successfully, but these errors were encountered:
This is easy. Notice that parameter.default_value returns a child ParameterValue object. For example:
for parameter in parameters:
if parameter.default_value:
print(parameter.default_value.identity)
http://strateos.com/CellFreeRiboswitches/MeasureParameter3/MeasureValue1
http://strateos.com/CellFreeRiboswitches/IntegerParameter1/IntegerValue1
http://strateos.com/CellFreeRiboswitches/MeasureParameter5/MeasureValue1
...
You may have been expecting a URI reference to a ParameterValue because that's how it was originally specified, but that turned out to be a bug in the specification. See discussion here: #73
I want to get
opil.ParameterValues
from a strateosopil.ProtocolInterface
(ex: CellFreeRiboswitches). I tried running the code below but unable to get desired information. What is the correct to do this?Here is what I have tried so far.
The text was updated successfully, but these errors were encountered: