Module term_data :: Class Cterms
[hide private]
[frames] | no frames]

Class Cterms

source code

This class encapsulates the term layer (collection of term objects)

Instance Methods [hide private]
 
__get_node_terms(self) source code
 
__init__(self, node=None, type='NAF')
Constructor of the object
source code
Cterm
__iter__(self)
Iterator that returns single term objects in the layer
source code
 
add_external_reference(self, term_id, external_ref)
Adds an external reference for the given term
source code
 
add_term(self, term_obj)
Adds a term object to the layer
source code
xml Element
get_node(self)
Returns the node of the element
source code
 
get_term(self, term_id)
Returns the term object for the supplied identifier
source code
 
remove_terms(self, list_term_ids)
Removes a list of terms from the layer
source code
 
to_kaf(self)
Converts the object to KAF (if it is NAF)
source code
 
to_naf(self)
Converts the object to NAF (if it is KAF)
source code
Method Details [hide private]

__init__(self, node=None, type='NAF')
(Constructor)

source code 

Constructor of the object

Parameters:
  • node (xml Element or None (to create and empty one)) - this is the node of the element. If it is None it will create a new object
  • type (string) - the type of the object (KAF or NAF)

__iter__(self)

source code 

Iterator that returns single term objects in the layer

Returns: Cterm
term objects

add_external_reference(self, term_id, external_ref)

source code 

Adds an external reference for the given term

Parameters:
  • term_id (string) - the term identifier
  • external_ref (CexternalReference) - the external reference object

add_term(self, term_obj)

source code 

Adds a term object to the layer

Parameters:
  • term_obj (Cterm) - the term object

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element

get_term(self, term_id)

source code 

Returns the term object for the supplied identifier

Parameters:
  • term_id (string) - term identifier

remove_terms(self, list_term_ids)

source code 

Removes a list of terms from the layer

Parameters:
  • list_term_ids (list) - list of term identifiers to be removed