Skip to content

Schemas

All PPX schemas are published as JSON Schema 2020-12 documents. They are the authoritative source for structural constraints.

Core schemas

Schema Raw Description
profile JSON User-scoped collection of claims, modifiers, grants.
claim JSON A single machine-readable preference statement.
context-modifier JSON Alters claim interpretation under conditions.
consent-grant JSON Scoped authorization for a grantee.
evidence-ref JSON Pointer to supporting data for a claim.
discovery-card JSON Provider advertisement at /.well-known/ppx-card.json.
extension-descriptor JSON Domain vocabulary descriptor.
derived-view JSON Task-scoped projection over one or more profiles.

Extension schemas

Namespace Raw
core JSON
fragrance JSON
travel JSON

Validating against the schemas

pip install jsonschema
python3 - <<'PY'
import json, urllib.request
from jsonschema import Draft202012Validator
url = "https://raw.githubusercontent.com/Blazing-Customs/ppx-spec/main/schemas/core/claim.schema.json"
schema = json.loads(urllib.request.urlopen(url).read())
instance = {
    "claim_id": "ppx:claim:example",
    "type": "preference",
    "namespace": "core",
    "key": "novelty_tolerance",
    "value": 0.62,
    "confidence": 0.78,
    "source": { "kind": "user_stated" }
}
errors = list(Draft202012Validator(schema).iter_errors(instance))
print("valid" if not errors else errors)
PY

Stability

Schema shape in 0.x is not stable. See the versioning policy for the rules that apply once 1.0 ships.