Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a CityJSON 2.0 Building Extension Schema Inspector

Format
Code-aware
Lines
104
Sections
11
Linked challenge
Build a CityJSON 2.0 Building Extension Schema Inspector

Prompt source

Original prompt text with formatting preserved for inspection.

104 lines
11 sections
No variables
1 code block
## Build
Inspect municipal CityJSON 2.0 models using custom extensions to verify taxation and historic status attributes. Validate custom object types and attribute bindings against official extension specs.

## User
City Data Governance Analyst

## Workflow
1. Ingest CityJSON 2.0 city models containing custom extension declarations in the extensions dictionary.
2. Inspect CityObjects for extended types prefixed with '+' and verify attribute schema rules.
3. Validate transform matrices and vertex coordinate bounds against declared geographical extents.
4. Generate a schema conformance report identifying unregistered extension fields or malformed types.

## Interface
A terminal CLI and web report viewer displaying schema conformance errors, extension definitions, and line numbers.

## Data
Construct small synthetic CityJSON files containing valid and invalid '+' extended attributes using standard JSON mocks.
Starter examples below are synthetic. They are not downloaded records.

## Source
[CityJSON](https://www.cityjson.org/specs/2.0.1/)
Leverages CityJSON Section 1 (extensions object) and Section 2 ('+' prefixed extended types) specifications.

## Tools
semantic-kernel, python, jsonschema.
Provides modular integration plugins for JSON Schema validation and natural language error explanation.
Instruction-following LLM to parse schema mismatches and output remediation recommendations.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Verifies that all '+' prefixed extended types match an entry in the extensions block.
- Flags missing geographicalExtent arrays on first-level CityObjects.
- Emits clear validation status and actionable field error paths.

## Starter Examples
```json
[
  {
    "input": {
      "type": "CityJSON",
      "version": "2.0",
      "extensions": {
        "HeritageTax": {
          "url": "https://example.gov/schemas/v1/heritagetax.json",
          "version": "1.0"
        }
      },
      "CityObjects": {
        "BLDG-701": {
          "type": "+HeritageBuilding",
          "geographicalExtent": [
            10,
            20,
            0,
            30,
            40,
            15
          ],
          "attributes": {
            "+taxDistrict": "Historic_Core",
            "+preservationTier": 1
          }
        }
      }
    },
    "expected_output": {
      "status": "VALID",
      "registered_extensions": [
        "HeritageTax"
      ],
      "extended_objects_count": 1,
      "schema_errors": []
    }
  },
  {
    "input": {
      "type": "CityJSON",
      "version": "2.0",
      "extensions": {},
      "CityObjects": {
        "BLDG-999": {
          "type": "+UnregisteredExtensionBuilding",
          "attributes": {
            "yearBuilt": 1910
          }
        }
      }
    },
    "expected_output": {
      "status": "INVALID",
      "registered_extensions": [],
      "extended_objects_count": 1,
      "schema_errors": [
        {
          "object_id": "BLDG-999",
          "error": "Type '+UnregisteredExtensionBuilding' used without corresponding entry in extensions object",
          "path": "CityObjects.BLDG-999.type"
        },
        {
          "object_id": "BLDG-999",
          "error": "Missing geographicalExtent member on 1st-level CityObject",
          "path": "CityObjects.BLDG-999.geographicalExtent"
        }
      ]
    }
  }
]
```

## Safety
Read-only syntax verification tool with no write privileges to municipal cadastre systems.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.