SynBioDex / pySBOL2

A pure Python implementation of the SBOL standard.
Apache License 2.0
20 stars 6 forks source link

Combinatorial Derivations Have some issues #412

Open JMante1 opened 2 years ago

JMante1 commented 2 years ago

It seems like there is something going wrong with the way they are initialised as opposed to other objects as the xml out is:

for the command sbol2.CombinatorialDerivation('pAOX4'). Additionally, it doesn't seem like sbol:variant checks if the value given actually references an existing component definition.
tcmitchell commented 2 years ago

As with #410, there isn't enough in this bug report for me to understand or reproduce this issue. Some code would be useful to help me to debug, or to at least see the problem. My results don't agree with what you show, so I'm guessing you are doing something different from what I tried, or your settings are different from the default, or both. Here is my complete Python session which shows pAOX4 incorporated into the identity of the CombinatorialDerivation. Additionally, the resulting identity matches a similar initialization of a sbol2.Sequence.

python3
Python 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sbol2
RDFLib Version: 6.0.0
>>> cd = sbol2.CombinatorialDerivation('pAOX4')
>>> cd
<sbol2.combinatorialderivation.CombinatorialDerivation object at 0x7f8f6004af10>
>>> cd.displayId
'example'
>>> cd.identity
'http://examples.org/pAOX4/example/1'
>>> s = sbol2.Sequence()
>>> s
<sbol2.sequence.Sequence object at 0x7f8f6008ec70>
>>> s.displayId
'example'
>>> s.identity
'http://examples.org/Sequence/example/1'
>>> 

Additionally, it doesn't seem like sbol:variant checks if the value given actually references an existing component definition.

I'm guessing that you are referring to sbol2.VariableComponent.variants here. You are probably correct that it does not check the value provided when setting this attribute. I think that's typical of both pySBOL2 and pySBOL3. These libraries allow latitude to the developer to construct objects and documents in a way that suits their application. If the libraries are too strict about enforcing constraints it has led to frustration in the past. Do you know if validation detects a variant that does not reference an existing component definition? That's where I would expect this problem to be detected. If it is not detected on validation please file a bug for that, along with a short test case.

Thanks in advance for any additional information that you can provide.