Note below that c.namespace is None, and that validation results in errors about the lack of a namespace.
>>> import sbol3
RDFLib Version: 5.0.0
>>> c = sbol3.Component('foo', sbol3.SBO_DNA)
/Users/tmitchel/Projects/sd2/pySBOL3/sbol3/object.py:70: UserWarning: Using a default namespace. To set a namespace use set_namespace()
warnings.warn('Using a default namespace.'
>>> c.namespace
>>> c.namespace is None
True
>>> doc = sbol3.Document()
>>> doc.add(c)
>>> report = doc.validate()
>>> len(report)
3
>>> for i in report:
... print(i)
...
http://sbols.org/unspecified_namespace/foo: Too few values for property namespace. Expected 1, found 0
http://sbols.org/unspecified_namespace/foo: Less than 1 values on <http://sbols.org/unspecified_namespace/foo>->:hasNamespace
http://sbols.org/unspecified_namespace/foo: Less than 1 values on <http://sbols.org/unspecified_namespace/foo>->:hasNamespace
>>>
Note below that
c.namespace is None
, and that validation results in errors about the lack of a namespace.