# 🧠 Hybrid Strategy: JSON-Centric with Ecto Structs for Internal Processing

---

## ✅ Best Way Forward

### JSON as Canonical Manifest Format

**Benefits:**

- Universal interoperability  
- Legal enforceability  
- HTTP 430 compliance  
- IETF standardization

### Ecto Structs for Internal Processing

**Benefits:**

- Type safety during manifest generation  
- Validation guarantees  
- Database storage (if needed)

---

## 🧬 JSON-LD Context for Semantic Richness

```elixir
defmodule Palimpsest.AIBDPManifest do
  use Ecto.Schema
  @json_ld_context %{
    "@context" => %{
      "palimpsest" => "https://palimpsestlicense.org/ns#",
      "aibdp" => "https://w3id.org/aibdp#"
    }
  }

  def to_json_ld!(manifest) do
    manifest
    |> Map.from_struct()
    |> Map.merge(@json_ld_context)
    |> Jason.encode!()
  end
end
