Module features_data :: Class Cproperties
[hide private]
[frames] | no frames]

Class Cproperties

source code

This class encapsulates the property layer in KAF/NAF

Instance Methods [hide private]
 
__init__(self, node=None, type='NAF')
Constructor of the object
source code
Cproperty
__iter__(self)
Iterator that returns all the properties
source code
 
add_property(self, pid, label, term_span)
Adds a new property to the property layer
source code
xml Element
get_node(self)
Returns the node of the element
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 all the properties

Returns: Cproperty
list of properties (iterator)

add_property(self, pid, label, term_span)

source code 

Adds a new property to the property layer

Parameters:
  • pid (string) - property identifier
  • label (string) - the label of the property
  • term_span (list) - list of term identifiers

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element