ebi-ait / checklist

Template repository for checklists
Apache License 2.0
1 stars 0 forks source link

Develop file structure and way to organize Fields,Field groups,Checklist groups #9

Open snathanvj opened 2 months ago

snathanvj commented 2 months ago

Currently, ENA creates fields ,field group, field unit , field values, checklist group everything in database table. Since , we are going to store everything in github we have to come up with the file structure to organize them.

Things to consider:

snathanvj commented 1 month ago

Features (related to Field and Field group):

Tentative field json format:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "fields": {
            "type": "array",
            "items": [
                {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "type": {
                            "type": "string"
                        },
                        "maxValue": {
                            "type": "string"
                        },
                        "minValue": {
                            "type": "string"
                        },
                        "maxOccurrance": {
                            "type": "string"
                        },
                        "regexPattern": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "name",
                        "type",
                        "maxValue",
                        "maxOccurrance"
                    ]
                }
            ]
        }
    },
    "required": [
        "fields"
    ]
}

versioning

implementation

snathanvj commented 1 month ago

Libraries I am planning to use for github file update : https://github.com/octokit/octokit.js?tab=readme-ov-file

@amnonkhen @theisuru please check previous two comments for the idea to go ahead.Thanks.

snathanvj commented 1 month ago

Suggestion for field versioning

 -field(directory)
    -filed_name(directory )     
        - latest (directory)
            -3.0.0(directory)
                - filed_definition_json (file) 
        -v1 (directory)
            -1.0.0 (directory)
                - filed_definition_json (file) 
            -1.0.1..
                - filed_definition_json (file) 
            -1.1.0...
                - filed_definition_json (file) 
        -v2
            -2.0.0
                - filed_definition_json (file) 
            -2.0.1..
                - filed_definition_json (file) 
            -2.1.0...   
                - filed_definition_json (file) 
snathanvj commented 1 month ago

Tentative checklist schema:

  {
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "checklist": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "fields": {
          "type": "array",
          "items": [ // array of fields for the checklist
            {
              "type": "object",
              "properties": {
                "field": {
                  "type": "field json" 
                },
                "version": {
                  "type": "string"
                }
              },
              "required": [
                "field",
                "version"
              ]
            }
          ]
        }
      },
      "required": [
        "name",
        "fields"
      ]
    }
  },
  "required": [
    "checklist"
  ]
}
snathanvj commented 1 month ago

Directory structure:

- checklist (directory)
    -checklist_name(directory)
        -live (directory)
            -checklist_1 (file)
            -checklist_2 (file)
            -checklist_3 (file)
            .
            .
            .
            -checklist_N(file)
        -v1 //can have sub directories for minor and batch versions
            -checklist_1 (file)
            -checklist_2 (file)
            -checklist_3 (file)
            .
            .
            .
            -checklist_N(file)
        -v2 //can have sub directories for minor and batch versions
            -checklist_1 (file)
            -checklist_2 (file)
            -checklist_3 (file)
            .
            .
            .
            -checklist_N(file)

 - field(directory)
    - filed_name(directory )     
        - latest (directory)
            -3.0.0(directory)
                - field_definition_json (file with all fields and it's status like disabled,deprecated...) 
        -v1 (directory)
            -1.0.0 (directory)
                - field_definition_json (file) 
            -1.0.1..
                - field_definition_json (file) 
            -1.1.0...
                - field_definition_json (file) 
        -v2
            -2.0.0
                - field_definition_json (file) 
            -2.0.1..
                - field_definition_json (file) 
            -2.1.0...   
                - field_definition_json (file) 

- field_group (directory)
    -field_group_1 (file with list of fields)
    -field_group_2 (file with list of fields)
    -field_group_3 (file with list of fields)
    .
    .
    .
    -field_group_N (file with list of fields)

- checklist_group (directory)
    -checklist_group_1 (file with list of checklists)
    -checklist_group_2 (file with list of checklists)
    .
    .
    .
    -checklist_group_N (file with list of checklists)