class User(Node): element_type = "user" username = Property(String, nullable=False) password = Property(String, nullable=False) def after_created(self): # include code to create relationships and to index the node pass
class Concept(Node): element_type = "concept" name = Property(String, nullable=False) creation_time = Property(Float, default="current_timestamp", nullable=False) edition_time = Property(Float, default="current_timestamp", nullable=False) def current_timestamp(self): return time.time()
class Subject(Project, Person): """ Subject is the concept of a participant in a Project with a set of data collected about them Relationships contained_in Project is-a Person """ element_type = "subject" name = Property(String, nullable=False) age = Property(Integer) def __unicode__(self): return self.name
class Relation(Relationship): label = "relation" creation_time = Property(Float, default="current_timestamp", nullable=False) def current_timestamp(self): return time.time()
class Person(NodeMB): """ Project is the concept of a collection of participants in a study - potentially with a set of overlapping metadata attributes Relationships contained_in Project """ element_type = "project" name = Property(String, nullable=False) def __unicode__(self): return self.name
class Pit(Fundus): """ Pit is anatomical entity with a set of image features Relationships contained_in Fundus """ element_type = "pit" name = Property(String, nullable=False) def __unicode__(self): return self.name
class Ribbon(Sulcus): """ Sulcus is anatomical entity with a set of image features Relationships contained_in Subject """ element_type = "ribbon" name = Property(String, nullable=False) def __unicode__(self): return self.name
class Database(NodeMB): """ Database is the root node of mbdb domain model """ element_type = "database" name = Property(String, nullable=False) #def after_initialized(self): # self.create_index(index_keys = self.name) #def after_created(self): # self.index.put_unique(self.eid, key = self.element_type, value = self.name) def __unicode__(self): return self.name
class CreatedBy(Relationship): label = "created_by" creation_time = Property(Float, default="current_timestamp", nullable=False) @property def concept(self): return Concept.get(self.outV) @property def user(self): return User.get(self.inV) def current_timestamp(self): return time.time()
class Project(Database): """ Project is the concept of a collection of participants in a study - potentially with a set of overlapping metadata attributes Relationships contained_in Database """ element_type = "project" name = Property(String, nullable=False) def after_created(self): self.create_index(index_keys=self.name) def __unicode__(self): return self.name
class Fundus(Sulcus): """ Sulcus is anatomical entity with a set of image features Relationships contained_in Subject """ element_type = "fundus" name = Property(String, nullable=False) curvature = Property(Float) convexity = Property(Float) depth = Property(Float) thickness = Property(Float) length = Property(Float) def __unicode__(self): return self.name
class Knows(Relationship): label = "knows" timestamp = Property(Float)
class Person(Node): element_type = "person" name = Property(String, nullable=False) age = Property(Integer)