def obo(self):
        """str: the ontology serialized in obo format.
        """
        meta = self._obo_meta()
        meta = [meta] if meta else []
        newline = "\n\n" if six.PY3 else "\n\n".encode('utf-8')

        try: # if 'namespace' in self.meta:
            return newline.join( meta + [
                r.obo for r in self.typedefs
            ] + [
                t.obo for t in self
                    if t.id.startswith(self.meta['namespace'][0])
            ])
        except KeyError:
            return newline.join( meta + [
                r.obo for r in self.typedefs
            ] + [
                t.obo for t in self
            ])
def obo ( self ) : meta = self . _obo_meta ( ) meta = [ meta ] if meta else [ ] newline = "\n\n" if six . PY3 else "\n\n" . encode ( 'utf-8' ) try : return newline . join ( meta + [ r . obo for r in self . typedefs ] + [ t . obo for t in self if t . id . startswith ( self . meta [ 'namespace' ] [ 0 ] ) ] ) except KeyError : return newline . join ( meta + [ r . obo for r in self . typedefs ] + [ t . obo for t in self ] )
str: the ontology serialized in obo format.