# Graph is a part of Gato which could be installed as a module
try:
    import Graph
except ImportError:
    import Gato.Graph as Graph

class Term:

    FUNCTION = 0
    PROCESS = 1
    COMPONENT = 2

    id=None # identifier
    goId=None # go identifier
    name=None # node name
    definition=None # node definition
    namespace=None # onotology the node is related to (function,component,process)
    subset = [] # subsets of GO the term is related to (GOSlims ...)
    annotations = [] # annotations related to the Term
    maxLevel = 1 #very high number
    minLevel = 9999 #lowest number
    parents = [] # list of parents goIds


    def __init__(self,id,goId,name,definition,namespace,subset=[],parents=[]):
        self.id=id
        self.goId=goId
        self.namespace=namespace
        self.name=name
        self.definition=definition
	self.subset = subset
	self.parents = parents
        self.annotations = []
        self.parents = parents
        self.subset = subset

    def addAnnotation(self,annotation):
        #print len(self.annotations)
        self.annotations.append(annotation)

    def __print__(self):
        print "id", self.id
        print  "goId", self.goId
        print "namespace", self.namespace
        print "name", self.name
        print "definition", self.definition
	print "subset", self.subset
	print "parents", self.parents
	print "maxLevel", self.maxLevel
	print "minLevel", self.minLevel        
