a 'namespace' property in the OBO format
This commit is contained in:
@ -214,7 +214,7 @@ class DefValue(TaggedValue):
|
|||||||
dbxrefs = TaggedValue._match_bracket.search(cleanvalue).group(0)
|
dbxrefs = TaggedValue._match_bracket.search(cleanvalue).group(0)
|
||||||
|
|
||||||
## recording zone
|
## recording zone
|
||||||
self.tag = "def"
|
self.tag = 'def'
|
||||||
## the value of a DefValue is not the standard value but the definition.
|
## the value of a DefValue is not the standard value but the definition.
|
||||||
self.value=definition
|
self.value=definition
|
||||||
self.dbxrefs=xrefFactory(dbxrefs)
|
self.dbxrefs=xrefFactory(dbxrefs)
|
||||||
@ -558,7 +558,7 @@ class OBOTerm(OBOEntry):
|
|||||||
assert self.stanzaName=='Term'
|
assert self.stanzaName=='Term'
|
||||||
assert 'id' in self and len(self['id'])==1,"An OBOTerm must have an id"
|
assert 'id' in self and len(self['id'])==1,"An OBOTerm must have an id"
|
||||||
assert 'name' in self and len(self['name'])==1,"An OBOTerm must have a name"
|
assert 'name' in self and len(self['name'])==1,"An OBOTerm must have a name"
|
||||||
assert 'namespace' in self and len(self['namespace'])==1, "An OBOTerm must belong to one of the cell_component, molecular_function or biological_process namespace"
|
assert 'namespace' not in self or len(self['namespace'])==1, "Only one namespace is allowed for an OBO term"
|
||||||
|
|
||||||
assert 'def' not in self or len(self['def'])==1,"Only one definition is allowed for an OBO term"
|
assert 'def' not in self or len(self['def'])==1,"Only one definition is allowed for an OBO term"
|
||||||
assert 'comment' not in self or len(self['comment'])==1,"Only one comment is allowed for an OBO term"
|
assert 'comment' not in self or len(self['comment'])==1,"Only one comment is allowed for an OBO term"
|
||||||
@ -586,9 +586,6 @@ class OBOTerm(OBOEntry):
|
|||||||
def _getId(self):
|
def _getId(self):
|
||||||
return self['id'][0]
|
return self['id'][0]
|
||||||
|
|
||||||
def _getNamespace(self):
|
|
||||||
return self['namespace'][0]
|
|
||||||
|
|
||||||
def _getName(self):
|
def _getName(self):
|
||||||
return self['name'][0]
|
return self['name'][0]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user