SynBioDex / pySBOL2

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

Experimental Data is owned object? #410

Closed JMante1 closed 2 years ago

JMante1 commented 2 years ago

Tried to make an experimental data object in an sbol doc and ger the warning 'OwnedObject' object is not callable. Is it possible that Experimental data can only be made if an experiment top level object is created?

tcmitchell commented 2 years ago

This isn't really enough to go on, it would be nice to see a little bit of code that exhibits the problem. Short of that, I'm left to guess at what you're doing.

Here's me adding a couple of experimental data objects to a document:

>>> import sbol2
RDFLib Version: 6.0.0
>>> doc = sbol2.Document()
>>> doc.experimentalData.add(sbol2.ExperimentalData('foo'))
>>> 
>>> len(doc.experimentalData)
1
>>> for ed in doc.experimentalData:
...     print(ed)
... 
http://examples.org/ExperimentalData/foo/1
>>> 
>>> doc.experimentalData.add(sbol2.ExperimentalData('bar'))
>>> len(doc.experimentalData)
2
>>> for ed in doc.experimentalData:
...     print(ed)
... 
http://examples.org/ExperimentalData/foo/1
http://examples.org/ExperimentalData/bar/1

I can reproduce your error message if I try to invoke doc.experimentalData as a function:

>>> doc.experimentalData()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'OwnedObject' object is not callable

The same error happens with other attributes of the document, like doc.moduleDefinitions and doc.componentDefinitions. Is that what you're doing?

I need to see a code sample in order to go further on this issue.