definePredicate
Register a new predicate in the shared vocabulary, defining its kind, description, domain/range, aliases, and attribute schema; check existing predicates first to avoid synonyms.
Instructions
Register a new predicate in the shared predicates vocabulary — but first call introspect to check existing predicates (works_at, member_of, etc.) so you don't mint a synonym. Inputs: predicate (snake_case), kind (functional for at-most-one-live-value, non-functional for multiple concurrent values), description, and optional typing: subjectKinds/objectKinds (domain/range — the entity kinds allowed on each end), sameAs (external-vocabulary IRIs), and propertySchema (a JSON Schema for the relation's attributes). Domain/range and attribute constraints are advisory by default and enforced only when [ontology] strict_domain_range is enabled. The predicate is immediately queryable via introspect and usable in relate calls. Re-registering an existing predicate updates its kind, description, domain/range, sameAs, and propertySchema and returns status=updated. Returns E_VALIDATION if the predicate name or propertySchema is malformed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | functional = at most one live value per subject (e.g. works_at). non-functional = multiple concurrent values allowed (e.g. member_of). | |
| sameAs | No | Optional alias IRIs mapping this predicate to external vocabularies, e.g. ["https://schema.org/worksFor", "wikidata:P108"]. | |
| predicate | Yes | Snake_case predicate identifier, e.g. works_at or member_of. Must be unique in the predicates vocabulary. | |
| description | Yes | One-sentence human-readable explanation of what the predicate means. | |
| objectKinds | No | Optional range constraint: entity kinds allowed as the object of this relation, e.g. ["organization"] for works_at. Omit to accept any kind. | |
| subjectKinds | No | Optional domain constraint: entity kinds allowed as the subject of this relation, e.g. ["person"] for works_at. Omit to accept any kind (open-world default). | |
| propertySchema | No | Optional JSON Schema (Draft 2020-12) constraining the relation's attributes map, e.g. require a string role. Validated against relation instances only when [ontology] strict_domain_range is enabled. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | registered = new predicate written to the vocabulary; updated = existing predicate's kind, description, domain/range, sameAs, and propertySchema overwritten. | |
| predicate | Yes | The registered predicate identifier. |