|
| 1 | +# Structured of generated RO-Crates using `treecript.rocrate` |
| 2 | + |
| 3 | +As `treecript` gathers timeseries of metrics, the first, naïve approach, |
| 4 | +has been describing each one of the metrics of each one of the sampling events, |
| 5 | +using next classes. |
| 6 | + |
| 7 | +```mermaid |
| 8 | +flowchart LR |
| 9 | + A[ActivateAction] |
| 10 | + P[PropertyValue] |
| 11 | + E[EventSeries] |
| 12 | + I["`InstantaneousEvent |
| 13 | +Event`"] |
| 14 | + O[OrganizeAction] |
| 15 | + S[SoftwareApplication] |
| 16 | + C[ControlAction] |
| 17 | + H[HowToStep] |
| 18 | +
|
| 19 | + click A href "https://schema.org/ActivateAction" "ActivateAction" _blank |
| 20 | + click P href "https://schema.org/PropertyValue" "PropertyValue" _blank |
| 21 | + click E href "https://schema.org/EventSeries" "EventSeries" _blank |
| 22 | + click I href "https://schema.org/InstantaneousEvent" "InstantaneousEvent" _blank |
| 23 | + click O href "https://schema.org/OrganizeAction" "OrganizeAction" _blank |
| 24 | + click S href "https://schema.org/SoftwareApplication" "SoftwareApplication" _blank |
| 25 | + click C href "https://schema.org/ControlAction" "ControlAction" _blank |
| 26 | + click H href "https://schema.org/HowToStep" "HowToStep" _blank |
| 27 | +
|
| 28 | + A -->|resourceUsage| P |
| 29 | + A -->|subjectOf| E |
| 30 | + A -->|instrument| S |
| 31 | +
|
| 32 | + E --> |about| A |
| 33 | + E -->|subEvent+| I |
| 34 | + |
| 35 | + I -->|superEvent| E |
| 36 | + I -->|source| A |
| 37 | + I -->|data+| P |
| 38 | + |
| 39 | + O -->|result| A |
| 40 | + O -->|instrument| S |
| 41 | + O -->|object*| C |
| 42 | +
|
| 43 | + C -->|object| A |
| 44 | + C -->|instrument| H |
| 45 | + |
| 46 | + H -->|workExample| S |
| 47 | +``` |
| 48 | + |
| 49 | +The description of the metrics using [PropertyValue](https://schema.org/PropertyValue) uses next ontological terms and units: |
| 50 | + |
| 51 | +```json |
| 52 | + "PID": { |
| 53 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#pid", |
| 54 | + "unitCode": None, |
| 55 | + "additionalType": "Integer", |
| 56 | + }, |
| 57 | + "Virt": { |
| 58 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#virt", |
| 59 | + "unitCode": "http://qudt.org/vocab/unit/BYTE", |
| 60 | + "additionalType": "Integer", |
| 61 | + }, |
| 62 | + "Res": { |
| 63 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#res", |
| 64 | + "unitCode": "http://qudt.org/vocab/unit/BYTE", |
| 65 | + "additionalType": "Integer", |
| 66 | + }, |
| 67 | + "CPU": { |
| 68 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#cpu", |
| 69 | + "unitCode": "http://qudt.org/vocab/unit/PERCENT", |
| 70 | + "additionalType": "Float", |
| 71 | + }, |
| 72 | + "Memory": { |
| 73 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#memory", |
| 74 | + "unitCode": "http://qudt.org/vocab/unit/PERCENT", |
| 75 | + "additionalType": "Float", |
| 76 | + }, |
| 77 | + "TCP Connections": { |
| 78 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#tcp_connections", |
| 79 | + "unitCode": "http://qudt.org/vocab/unit/CountingUnit", |
| 80 | + "additionalType": "Integer", |
| 81 | + }, |
| 82 | + "Thread Count": { |
| 83 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#thread_count", |
| 84 | + "unitCode": "http://qudt.org/vocab/unit/CountingUnit", |
| 85 | + "additionalType": "Integer", |
| 86 | + }, |
| 87 | + "User": { |
| 88 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#user", |
| 89 | + "unitCode": "http://qudt.org/vocab/unit/SEC", |
| 90 | + "additionalType": "Float", |
| 91 | + }, |
| 92 | + "System": { |
| 93 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#system", |
| 94 | + "unitCode": "http://qudt.org/vocab/unit/SEC", |
| 95 | + "additionalType": "Float", |
| 96 | + }, |
| 97 | + "Children_User": { |
| 98 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#children_user", |
| 99 | + "unitCode": "http://qudt.org/vocab/unit/SEC", |
| 100 | + "additionalType": "Float", |
| 101 | + }, |
| 102 | + "Children_System": { |
| 103 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#children_system", |
| 104 | + "unitCode": "http://qudt.org/vocab/unit/SEC", |
| 105 | + "additionalType": "Float", |
| 106 | + }, |
| 107 | + "IO": { |
| 108 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#io", |
| 109 | + "unitCode": "http://qudt.org/vocab/unit/SEC", |
| 110 | + "additionalType": "Float", |
| 111 | + }, |
| 112 | + "uss": { |
| 113 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#uss", |
| 114 | + "unitCode": "http://qudt.org/vocab/unit/BYTE", |
| 115 | + "additionalType": "Integer", |
| 116 | + }, |
| 117 | + "swap": { |
| 118 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#swap", |
| 119 | + "unitCode": "http://qudt.org/vocab/unit/BYTE", |
| 120 | + "additionalType": "Integer", |
| 121 | + }, |
| 122 | + "processor_num": { |
| 123 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#processor_num", |
| 124 | + "unitCode": "http://qudt.org/vocab/unit/CountingUnit", |
| 125 | + "additionalType": "Integer", |
| 126 | + }, |
| 127 | + "core_num": { |
| 128 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#core_num", |
| 129 | + "unitCode": "http://qudt.org/vocab/unit/CountingUnit", |
| 130 | + "additionalType": "Integer", |
| 131 | + }, |
| 132 | + "cpu_num": { |
| 133 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#cpu_num", |
| 134 | + "unitCode": "http://qudt.org/vocab/unit/CountingUnit", |
| 135 | + "additionalType": "Integer", |
| 136 | + }, |
| 137 | + "processor_ids": { |
| 138 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#processor_ids", |
| 139 | + "unitCode": None, |
| 140 | + "additionalType": "String", |
| 141 | + }, |
| 142 | + "core_ids": { |
| 143 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#core_ids", |
| 144 | + "unitCode": None, |
| 145 | + "additionalType": "String", |
| 146 | + }, |
| 147 | + "cpu_ids": { |
| 148 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#cpu_ids", |
| 149 | + "unitCode": None, |
| 150 | + "additionalType": "String", |
| 151 | + }, |
| 152 | + "process_status": { |
| 153 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#process_status", |
| 154 | + "unitCode": None, |
| 155 | + "additionalType": "String", |
| 156 | + }, |
| 157 | + "read_count": { |
| 158 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#read_count", |
| 159 | + "unitCode": "http://qudt.org/vocab/unit/CountingUnit", |
| 160 | + "additionalType": "Integer", |
| 161 | + }, |
| 162 | + "write_count": { |
| 163 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#write_count", |
| 164 | + "unitCode": "http://qudt.org/vocab/unit/CountingUnit", |
| 165 | + "additionalType": "Integer", |
| 166 | + }, |
| 167 | + "read_bytes": { |
| 168 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#read_bytes", |
| 169 | + "unitCode": "http://qudt.org/vocab/unit/BYTE", |
| 170 | + "additionalType": "Integer", |
| 171 | + }, |
| 172 | + "write_bytes": { |
| 173 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#write_bytes", |
| 174 | + "unitCode": "http://qudt.org/vocab/unit/BYTE", |
| 175 | + "additionalType": "Integer", |
| 176 | + }, |
| 177 | + "read_chars": { |
| 178 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#read_chars", |
| 179 | + "unitCode": "http://qudt.org/vocab/unit/BYTE", |
| 180 | + "additionalType": "Integer", |
| 181 | + }, |
| 182 | + "write_chars": { |
| 183 | + "propertyID": "https://w3id.org/ro/terms/treecript-metrics#write_chars", |
| 184 | + "unitCode": "http://qudt.org/vocab/unit/BYTE", |
| 185 | + "additionalType": "Integer", |
| 186 | + }, |
| 187 | +``` |
| 188 | + |
| 189 | +but this approach generates an RO-Crate 100-fold the size of the original CSV files with the metrics. |
| 190 | + |
| 191 | +You can try the translation first installing treecript, |
| 192 | +capturing metrics from an execution and then translating gathered metrics to RO-Crate. |
| 193 | + |
| 194 | +```bash |
| 195 | +python3 -mvenv TREECRIPT |
| 196 | +TREECRIPT/bin/pip install --upgrade pip wheel |
| 197 | +TREECRIPT/bin/pip install 'treecript [analytics,docker] @ git+https://github.com/inab/treecript.git@exec' |
| 198 | +source TREECRIPT/bin/activate |
| 199 | + |
| 200 | +# Let's try with an example from the source distribution |
| 201 | +# the generated RO-Crate weights more than 670MB!!! |
| 202 | +git clone https://github.com/inab/treecript.git |
| 203 | +python -m treecript.rocrate --as-directory /tmp/rocrate_as_directory treecript/sample-series/Wetlab2Variations_metrics/2025_05_20-02_19-14001/ |
| 204 | +``` |
0 commit comments