Example #1
0
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
Example #2
0
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()
Example #3
0
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
Example #4
0
class Relation(Relationship):
    label = "relation"

    creation_time = Property(Float, default="current_timestamp", nullable=False)

    def current_timestamp(self):
        return time.time()
Example #5
0
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
Example #6
0
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
Example #7
0
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
Example #8
0
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
Example #9
0
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()
Example #10
0
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
Example #11
0
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
Example #12
0
class Knows(Relationship):

    label = "knows"
    timestamp = Property(Float)
Example #13
0
class Person(Node):

    element_type = "person"

    name = Property(String, nullable=False)
    age = Property(Integer)