# Atlas Claim → Triple Mapping v1

This document defines deterministic RDF emission from claim objects.

## Prefixes
- `atlas:` → `http://world.eu.org/atlas_ontology#`
- `atlas_data:` → `http://world.eu.org/atlas_data#`

---

## 1) Core rule

Each claim yields:
1. one domain triple (subject-predicate-object)
2. one claim node (`atlas:Claim`) carrying metadata
3. one provenance node linked to the claim

This ensures provenance is attached to *the specific statement*.

---

## 2) Claim node shape

```turtle
atlas_data:claim_<id> a atlas:Claim ;
  atlas:claimSubject <subject> ;
  atlas:claimPredicate <predicate> ;
  atlas:claimObject <object-or-literal> ;
  atlas:claimLayer "raw|derived" ;
  atlas:hasProvenance atlas_data:prov_<id> .
```

### Provenance node

```turtle
atlas_data:prov_<id> a atlas:Provenance ;
  atlas:provenanceSource "wikidata" ;
  atlas:retrievalMethod "wbsearchentities+entitydata" ;
  atlas:confidence "0.99"^^xsd:decimal ;
  atlas:retrievedAt "2026-04-03T18:00:00Z"^^xsd:dateTime .
```

---

## 3) Mapping table

## 3.1 Identifier claim

Input claim:
```json
{
  "predicate": "atlas:hasIdentifier",
  "object": {"kind": "identifier", "id_type": "atlas:WikidataQID", "value": "Q22686"}
}
```

Triples:
```turtle
atlas_data:entity_trump atlas:hasIdentifier atlas_data:ident_q22686 .

atlas_data:ident_q22686 a atlas:Identifier ;
  atlas:identifierType atlas:WikidataQID ;
  atlas:identifierValue "Q22686" .
```

+ claim/provenance nodes

---

## 3.2 External type claim

```turtle
atlas_data:entity_trump atlas:hasExternalType atlas:WikidataType_Q5 .
```

+ claim/provenance nodes

---

## 3.3 Canonical type claim (derived)

```turtle
atlas_data:entity_trump atlas:hasCanonicalType atlas:Person .
```

+ claim/provenance nodes (source might be `wikidata`, `groq-llm`, or combined adjudication)

---

## 3.4 Alias claim

```turtle
atlas_data:entity_trump atlas:hasAlias atlas_data:alias_trump .
atlas_data:alias_trump a atlas:Alias ;
  atlas:aliasLabel "Trump" ;
  atlas:resolvedTo atlas_data:entity_trump .
```

+ claim/provenance nodes

---

## 3.5 Description claim

```turtle
atlas_data:entity_trump atlas:canonicalDescription "45th and 47th U.S. President" .
```

+ claim/provenance nodes

---

## 4) Read-back policy

When reading from store:
- reconstruct normal response from canonical triples
- reconstruct debug claims from `atlas:Claim` + linked provenance nodes
- never infer provenance if claim metadata is missing

---

## 5) Write policy

- Batch writes preferred (`batch_insert`) to reduce call overhead.
- One entity resolution write should include:
  - entity node
  - identifier nodes
  - alias nodes
  - claim nodes
  - provenance nodes
- Idempotency key should be derived from `(entity_id, claim_id)`.

---

## 6) Minimal first storage set

For first iteration, write:
- canonical label
- canonical type
- identifiers (MID + QID where available)
- alias used in resolution
- claim/provenance for each of the above
- needs_curation flag

Add enrichment-derived claims in later phase.
