class EntityType(db.Model): __tablename__ = 'entity_type' id = db.Column(db.Integer, primary_key=True, autoincrement=True) uri = db.Column(db.String(255), nullable=False, unique=True, index=True) display_name = db.Column(db.String(255), nullable=False) description = db.Column(db.String(255)) icon = db.Column(db.String(255)) father_id = db.Column(db.Integer, index=True, server_default=_text("'0'")) has_child = db.Column(db.SmallInteger, index=True, server_default=_text("'0'")) is_object = db.Column(db.Integer, server_default=_text("'0'")) created_at = db.Column(db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP"), default=db.func.now()) updated_at = db.Column( db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), default=db.func.now(), onupdate=db.func.now()) property_types = db.relationship('PropertyType', backref=db.backref('entity_type', lazy='joined'), cascade='all, delete-orphan', lazy='select')
class Catalog(db.Model): __tablename__ = 'catalog' id = db.Column(db.Integer, primary_key=True, autoincrement=True) uri = db.Column(db.String(255), unique=True, index=True) number = db.Column(db.String(255)) title = db.Column(db.String(255)) public_org = db.Column(db.String(255)) description = db.Column(db.String(255)) text = db.Column(db.Text) book_id = db.Column(db.Integer, db.ForeignKey('book.id'), index=True) created_at = db.Column(db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP"), default=db.func.now()) updated_at = db.Column( db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), default=db.func.now(), onupdate=db.func.now()) clauses = db.relationship('Clause', backref=db.backref('catalog', lazy='joined'), cascade='all, delete-orphan', lazy='select')
class PropertyType(db.Model): __tablename__ = 'property_type' id = db.Column(db.Integer, primary_key=True, autoincrement=True) uri = db.Column(db.String(255), nullable=False, index=True) display_name = db.Column(db.String(255), nullable=False) description = db.Column(db.String(255)) icon = db.Column(db.String(255)) field_type = db.Column(db.String(255)) is_entity = db.Column(db.SmallInteger, index=True, server_default=_text("'0'")) entity_type_id = db.Column(db.Integer, db.ForeignKey('entity_type.id'), nullable=False, index=True) created_at = db.Column(db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP"), default=db.func.now()) updated_at = db.Column( db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), default=db.func.now(), onupdate=db.func.now())
class Field(db.Model): __tablename__ = 'field' id = db.Column(db.Integer, primary_key=True, autoincrement=True) uri = db.Column(db.String(255), unique=True, index=True) count = db.Column(db.Integer) support = db.Column(db.String(255)) description = db.Column(db.String(255)) created_at = db.Column(db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP"), default=db.func.now()) updated_at = db.Column( db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), default=db.func.now(), onupdate=db.func.now()) books = db.relationship('Book', backref=db.backref('field', lazy='joined'), cascade='all, delete-orphan', lazy='select')
class AlgorithmMapping(db.Model): __tablename__ = 'algorithm_mapping' id = db.Column(db.Integer, primary_key=True, autoincrement=True) entity_type_uri = db.Column(db.String(255)) entity_type_id = db.Column(db.Integer, db.ForeignKey('entity_type.id'), index=True) algorithm = db.Column(db.String(255)) created_at = db.Column(db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP"), default=db.func.now()) updated_at = db.Column( db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), default=db.func.now(), onupdate=db.func.now())
class ClauseEntityTypeMapping(db.Model): __tablename__ = 'clause_entity_type_mapping' id = db.Column(db.Integer, primary_key=True, autoincrement=True) clause_id = db.Column(db.Integer, db.ForeignKey('clause.id'), nullable=False, index=True) clause_uri = db.Column(db.String(255)) object_id = db.Column(db.Integer, index=True) object_uri = db.Column(db.String(255)) object_name = db.Column(db.String(255)) concept_id = db.Column(db.Integer, index=True) concept_uri = db.Column(db.String(255)) concept_name = db.Column(db.String(255)) description = db.Column(db.String(255)) condition = db.Column(db.String(255)) created_at = db.Column(db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP"), default=db.func.now()) updated_at = db.Column( db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), default=db.func.now(), onupdate=db.func.now())
class FieldRecord(db.Model): __tablename__ = 'field_record' id = db.Column(db.Integer, primary_key=True, autoincrement=True) operator = db.Column(db.String(255)) operation_type = db.Column(db.String(255)) field_id = db.Column(db.Integer) book_id = db.Column(db.Integer) catalog_id = db.Column(db.Integer) clause_id = db.Column(db.Integer, index=True) operated_field = db.Column(db.String(255)) original_value = db.Column(db.String(14800)) new_value = db.Column(db.String(255)) operated_at = db.Column(db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
class OperationRecord(db.Model): __tablename__ = 'operation_record' id = db.Column(db.Integer, primary_key=True, autoincrement=True) operator = db.Column(db.String(255)) operation_type = db.Column(db.String(255)) entity_type_id = db.Column(db.Integer, index=True) entity_type_uri = db.Column(db.String(255)) property_type_id = db.Column(db.Integer, index=True) property_type_uri = db.Column(db.String(255)) operated_field = db.Column(db.String(255)) original_value = db.Column(db.String(14800)) new_value = db.Column(db.String(255)) operated_at = db.Column( db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
class ClauseMappingRecord(db.Model): __tablename__ = 'clause_mapping_record' id = db.Column(db.Integer, primary_key=True, autoincrement=True) operator = db.Column(db.String(255)) operation_type = db.Column(db.String(255)) clause_mapping_id = db.Column(db.Integer, index=True) object_id = db.Column(db.Integer) object_uri = db.Column(db.String(255)) concept_id = db.Column(db.Integer) concept_uri = db.Column(db.String(255)) operated_field = db.Column(db.String(255)) original_value = db.Column(db.String(14800)) new_value = db.Column(db.String(255)) operated_at = db.Column( db.TIMESTAMP, server_default=_text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
class AlgorithmList(db.Model): __tablename__ = 'algorithm_list' id = db.Column(db.Integer, primary_key=True, autoincrement=True) algorithm_name = db.Column(db.String(255))