Declare an ontology relation (CORE-MEMTYPE-DECLARE-1; declare-only in P1).
Record links are relations with record-class domain/range. Edge writes are NOT validated against domain/range/cardinality yet (P3). 400 on an invalid tier; 409 on an identity-slot conflict.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Body for POST /ontology/relations — mirrors OntologyService.create_relation.
Declare-only in P1 (edge validation against domain/range/cardinality is P3).
Response Body
application/json
application/json
curl -X POST "https://example.com/memory/ontology/relations" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{
"name": "string",
"iri": "string",
"wikidata_pid": "string",
"display_name": "string",
"definition": "string",
"description": "string",
"aliases": [
"string"
],
"examples": [
"string"
],
"domain": [
"string"
],
"range": [
"string"
],
"inverse_of": "string",
"cardinality": "string",
"temporal": false,
"properties_schema": {},
"transitive": false,
"symmetric": false,
"reflexive": false,
"parent_relations": [
"string"
],
"equivalent_relations": [
"string"
],
"tier": "string",
"trust_origin": "string",
"layer": "string",
"pack_id": "string",
"pack_version": "string",
"workspace_id": "string",
"source": "string",
"confidence": 0,
"frequency": 0
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Create Explicit Link
Create an explicit typed link between two zettels. LINKS_TO uses the bidirectional helper; arbitrary relation types go through add_dynamic_relation and become visible via GET /zettel/by-relation/{source_id}/{relation_type}.
Create Ontology Type
Declare an ontology class (CORE-MEMTYPE-DECLARE-1). `kind='record'` declares a concrete record type: items may then be written with `memory_type=<name>` through `/memory/add` and `/memory/ingest/structured`, schema-checked against `properties_schema` (WARNING mode in P1). 400 on an invalid schema/tier/kind/strategy; 409 when the name shadows a registered memory type or the iri/qid identity slot is already bound (the body names the conflict).