GFDRR / rdl-standard

The Risk Data Library Standard (RDLS) is an open data standard to make it easier to work with disaster and climate risk data. It provides a common description of the data used and produced in risk assessments, including hazard, exposure, vulnerability, and modelled loss, or impact, data.
https://docs.riskdatalibrary.org/
Creative Commons Attribution Share Alike 4.0 International
13 stars 1 forks source link

[Docs update] Update or remove mermaid flowcharts #178

Closed matamadio closed 11 months ago

matamadio commented 1 year ago

There is a chart generator plugin called mermaid that creates the schema flowcharts:

immagine

It's a bit bulky and doesn't reflect the current status of the schema. It should be either:

duncandewhurst commented 1 year ago

Agree that the diagrams need to be updated or removed.

Whilst it might be possible to generate diagrams automatically from the schema, they would be extremely large and complex so some extra curation would be needed to decide which fields to include on the diagram.

I think a better approach would be generating diagrams from JSON examples of RDLS metadata (rather than from the schema). PlantUML does quite a good job of generating diagrams from JSON data. For example, I generated a diagram that covers the same fields and relationships as the diagram in the issue description, but updated for the latest version of the schema:

Diagram image

Input data

{
  "event_sets": [
    {
      "analysis_type": "",
      "events": [
        {
          "calculation_method": "",
          "hazard": {
            "type": "",
            "trigger": {}
          },
          "occurrence": {},
          "footprints": [
            {
              "intensity_measure": "",
              "data_uncertainty": ""
            },
            {
              "intensity_measure": "",
              "data_uncertainty": ""
            }
          ]
        },
 {
          "calculation_method": "",
          "hazard": {
            "type": "",
            "trigger": {}
          },
          "occurrence": {},
          "footprints": [
            {
              "intensity_measure": "",
              "data_uncertainty": ""
            },
            {
              "intensity_measure": "",
              "data_uncertainty": ""
            }
          ]
        }
      ]
    }
  ]
}
matamadio commented 1 year ago

Thanks, agree they should focus on the key connections rather than showing the whole set of attributes. Agree to generate simplified json.

duncandewhurst commented 1 year ago

@matamadio in terms of next steps on this issue, are you happy to propose a subset of fields to include in each diagram and then we can draft the necessary JSON files and generate the diagrams?

matamadio commented 1 year ago

@matamadio in terms of next steps on this issue, are you happy to propose a subset of fields to include in each diagram and then we can draft the necessary JSON files and generate the diagrams?

Yes please, diagram for each compontents proposed as follows:

Dataset (general) - all non specific attributes

Hazard

event_sets events footprints
analysis_type description intensity_measure
frequency_distribution hazard/type data_uncertainty
seasonality hazard/processes  
event_count hazard/intensity_measure  
occurrence_range hazard/trigger  
spatial disaster_identifier  
temporal calculation_method  
  occurrence  

Exposure

Vulnerability

Loss

Please mark required or optional fields.

duncandewhurst commented 1 year ago

Please mark required or optional fields.

We can use PlantUML's highlighting feature for this.

duncandewhurst commented 1 year ago

I'm assuming that temporal_resolution under vulnerability is an error since that field only exists at the top level and as a property of Resource.

matamadio commented 1 year ago

I'm assuming that temporal_resolution under vulnerability is an error since that field only exists at the top level and as a property of Resource.

Yes sorry, fixed.