create_geocroissant_scaffold
Generate a standards-conformant GeoCroissant JSON-LD scaffold that passes official validation, with spatial coverage, band configuration, and RecordSet wiring.
Instructions
Generates a validated GeoCroissant JSON-LD scaffold from parameters.
Produces a standards-conformant starting point modeled on the official
GeoCroissant example: correct @context (including the `geocr` prefix),
dual conformance (`croissant/1.1` + `geocr`), schema.org spatial/temporal
coverage, GeoCroissant properties (CRS, resolutions, band configuration,
spectral bands), distribution entries and a RecordSet wired to them via
proper cr:source/cr:extract declarations.
The generated document is then parsed and checked by the real
``mlcroissant`` validator, so `valid=True` means the scaffold already
passes the official library checks.
Usage: Call FIRST when creating new dataset metadata, then edit the
returned JSON-LD for domain specifics and re-check with
`validate_croissant`. Use `inspect_geocroissant` afterwards to review it.
Returns:
--------
ScaffoldResult containing:
- valid: Whether the scaffold passed mlcroissant validation.
- json_ld: The generated document.
- errors/warnings: Library messages when not fully clean.
- path: Output file path when output_filename was given.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bbox | No | Spatial coverage as [min_lon, min_lat, max_lon, max_lat] in EPSG:4326 (standard GIS order). | |
| name | Yes | Name of the dataset. | |
| license | No | License URL, preferably SPDX, e.g. "https://creativecommons.org/licenses/by/4.0/". | |
| version | No | Dataset version, e.g. "1.0". | |
| creators | No | Creator names (rendered as sc:Organization entries). | |
| file_sets | No | List of FileSet specs: {"id": "images", "name": "Images", "encoding_format": "image/tiff", "includes": "images/**/*.tif"}. | |
| band_names | No | Ordered raster band names, e.g. ["Blue","Green","Red","NIR"]. | |
| field_name | No | Name of the main data Field inside the RecordSet. | data |
| description | No | Description of the dataset. | |
| file_objects | No | List of FileObject specs: {"id": "data.zip", "name": "data.zip", "content_url": "https://...", "encoding_format": "application/zip", "sha256": "...", "md5": "..."}. | |
| date_published | No | Publication date as YYYY-MM-DD. | |
| field_is_array | No | Whether the main Field is an array (raster/tensor). | |
| spectral_bands | No | Per-band spectral metadata entries like {"name": "Blue", "centerWavelength": {"value": 490, "unitText": "nm"}, "bandwidth": {...}}. | |
| field_data_type | No | Field dataType, e.g. "sc:ImageObject", "sc:Text", "sc:URL". | sc:ImageObject |
| output_filename | No | When provided, writes the validated JSON-LD to this filename inside GEOCR_OUTPUT_DIR (or the system temp dir) and returns the path. | |
| record_set_name | No | Name/@id of the scaffolded RecordSet. | records |
| field_array_shape | No | Array shape as comma-separated dims, e.g. "512,512,6" (requires field_is_array=True). | |
| temporal_coverage | No | Temporal coverage interval, e.g. "2018-01-01/2021-12-31". | |
| source_file_set_id | No | @id of the FileSet/FileObject the main Field reads from. Defaults to the first declared distribution entry. | |
| spatial_resolution | No | Ground sampling distance value (with unit below). | |
| record_set_description | No | Description of the scaffolded RecordSet. | |
| spatial_resolution_unit | No | Unit for spatial_resolution, e.g. "m". | m |
| temporal_resolution_unit | No | Unit for temporal cadence, e.g. "days". | days |
| temporal_resolution_value | No | Revisit cadence value (with unit below). | |
| coordinate_reference_system | No | CRS identifier, e.g. "EPSG:4326". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | File path when the scaffold was written to disk. | |
| valid | Yes | Whether the generated JSON-LD passes mlcroissant validation. | |
| errors | No | Validation errors on the generated file. | |
| json_ld | Yes | The generated JSON-LD document. | |
| warnings | No | Validation warnings on the generated file. |