diff --git a/trino/datamodel.py b/trino/datamodel.py index 5b6b390a52826cf4f2d98173339cfb2ab123e5c1..67ed208904e49c22b9dd35c854c58639bae00531 100644 --- a/trino/datamodel.py +++ b/trino/datamodel.py @@ -8,7 +8,21 @@ db.Property("unique_association", datatype=db.BOOLEAN).insert() db.Property("resolve_url", datatype=db.TEXT).insert() db.Property("validation_regex", datatype=db.TEXT).insert() db.Property("display_color_code", datatype=db.TEXT).insert() -db.RecordType("WorkingGroup").add_property("short_name").insert() -db.RecordType("PubregArticle").add_property("title").insert() + +db.Property("authors", datatype=db.TEXT).insert() +db.Property("first_author", datatype=db.TEXT).insert() +db.Property("last_author", datatype=db.TEXT).insert() +db.Property("journal_title", datatype=db.TEXT).insert() +db.Property("journal_abbr", datatype=db.TEXT).insert() +db.Property("publication_year", datatype=db.INTEGER).insert() +db.Property("doi", datatype=db.TEXT).insert() +db.Property("pmid", datatype=db.INTEGER).insert() + +db.Property("leader", datatype=db.TEXT).insert() +db.Property("leader_email", datatype=db.TEXT).insert() +db.Property("leader_institution", datatype=db.TEXT).insert() + +db.RecordType("WorkingGroup").add_property("short_name").add_property("leader").add_property("leader_email").add_property("leader_institution").insert() +db.RecordType("PubregArticle").add_property("title").add_property("authors").add_property("first_author").add_property("last_author").add_property("journal_title").add_property("journal_abbr").add_property("publication_year").add_property("doi").add_property("pmid").insert() db.RecordType("AntibodyApplication").add_property("abbreviation").insert() db.RecordType("ExternalID").add_property("unique_association").add_property("display_color_code").add_property("validation_regex").add_property("resolve_url").insert() diff --git a/trino/mapping.yml b/trino/mapping.yml index 4a42b48f1a3209346d1a2a991ace2943436b1928..171785f7dc8ebff5af9b7fbd5311a908206f5412 100644 --- a/trino/mapping.yml +++ b/trino/mapping.yml @@ -11,13 +11,37 @@ mappings: column_name: title property_id: 103 #id of the title property - type: LIST_OF_REF_TO_FOREIGN_COL - property_id: 111 #id of the ExternalID record type + property_id: 122 # 111 id of the ExternalID record type mapping_id: 4 local_key: "id" # should be the same as this mapping's 'table.pk'. foreign_pk: "l.id" # the primary key of the foreign foreign_table: "mysql.menoci_test.rdp_external_id AS l LEFT JOIN mysql.menoci_test.rdp_publication_externalid AS r ON l.id=r.external_id" foreign_col: "l.subject_id" # this is the column with the foreign key contraint. order_by: "r.order_position ASC" + - type: ONE_P_ONE_COL + column_name: authors + property_id: 108 + - type: ONE_P_ONE_COL + column_name: first_author + property_id: 109 + - type: ONE_P_ONE_COL + column_name: last_author + property_id: 110 + - type: ONE_P_ONE_COL + column_name: journal_title + property_id: 111 + - type: ONE_P_ONE_COL + column_name: journal_abbr + property_id: 112 + - type: ONE_P_ONE_COL + column_name: publication_year + property_id: 113 + - type: ONE_P_ONE_COL + column_name: doi + property_id: 114 + - type: ONE_P_ONE_COL + column_name: pmid + property_id: 115 - type: ONE_RT_TO_ONE_TAB mapping_id: 4 table: @@ -55,7 +79,7 @@ mappings: importance: "FIX" - type: ONE_P_ONE_COL column_name: display_color_code - property_id: 107 # id of the display_color_core property + property_id: 107 # id of the display_color_code property importance: "FIX" - type: ONE_P_ONE_COL column_name: validation_regex @@ -74,6 +98,18 @@ mappings: - type: ONE_P_ONE_COL column_name: short_name property_id: 102 # id of the short_name property + - type: NAME_TO_ONE_COL + column_name: name + - type: ONE_P_ONE_COL + column_name: leader + property_id: 116 + - type: ONE_P_ONE_COL + column_name: leader_email + property_id: 117 + - type: ONE_P_ONE_COL + column_name: leader_institution + property_id: 118 + - type: ONE_RT_TO_ONE_TAB mapping_id: 3 @@ -86,3 +122,6 @@ mappings: - type: ONE_P_ONE_COL column_name: abbreviation property_id: 101 # id of the abbreviation property + - type: NAME_TO_ONE_COL + column_name: name +