|
19 | 19 | from fairscape_cli.models import ( |
20 | 20 | GenerateROCrate, |
21 | 21 | LinkSubcrates, |
22 | | - collect_subcrate_metadata |
| 22 | + collect_subcrate_metadata, |
| 23 | + collect_subcrate_aggregated_metrics |
23 | 24 | ) |
24 | 25 |
|
25 | 26 | from fairscape_models.rocrate import ROCrateV1_2 |
@@ -182,6 +183,9 @@ def build_release( |
182 | 183 | if keyword not in combined_keywords: |
183 | 184 | combined_keywords.append(keyword) |
184 | 185 |
|
| 186 | + # Collect aggregated metrics for AI-Ready scoring |
| 187 | + aggregated_metrics = collect_subcrate_aggregated_metrics(release_directory) |
| 188 | + |
185 | 189 | parent_params = { |
186 | 190 | "guid": guid, |
187 | 191 | "name": name, |
@@ -285,6 +289,17 @@ def build_release( |
285 | 289 | click.echo(f"ERROR: {e}") |
286 | 290 | ctx.exit(1) |
287 | 291 |
|
| 292 | + # Add aggregated metrics as individual properties (following evi: prefix pattern) |
| 293 | + parent_params["evi:datasetCount"] = aggregated_metrics.dataset_count |
| 294 | + parent_params["evi:computationCount"] = aggregated_metrics.computation_count |
| 295 | + parent_params["evi:softwareCount"] = aggregated_metrics.software_count |
| 296 | + parent_params["evi:schemaCount"] = aggregated_metrics.schema_count |
| 297 | + parent_params["evi:totalContentSizeBytes"] = aggregated_metrics.total_content_size_bytes |
| 298 | + parent_params["evi:entitiesWithSummaryStats"] = aggregated_metrics.entities_with_summary_stats |
| 299 | + parent_params["evi:entitiesWithChecksums"] = aggregated_metrics.entities_with_checksums |
| 300 | + parent_params["evi:totalEntities"] = aggregated_metrics.total_entities |
| 301 | + parent_params["evi:formats"] = sorted(list(aggregated_metrics.formats)) |
| 302 | + |
288 | 303 | try: |
289 | 304 | click.echo("\n=== Creating release RO-Crate ===") |
290 | 305 | parent_crate_root_dict = GenerateROCrate(**parent_params) |
|
0 commit comments