---
title: '@0xintuition/predicates'
description: Select canonical relationship keys, labels, serialized atom data, and deterministic predicate IDs.
url: https://docs.intuition.systems/docs/reference/packages/predicates
markdown_url: https://docs.intuition.systems/docs/reference/packages/predicates.md
version: V2
llms_index: https://docs.intuition.systems/llms.txt
kind: reference
reader:
  - app
  - agent
packages:
  - '@0xintuition/predicates@0.1.1'
---

## What it's for

The predicate registry provides reusable relationship vocabulary and the atom data that gives each predicate its deterministic ID. It also supplies semantic flags, display helpers, and optional enrichment-document builders.

## When to use it

Use a known predicate subpath for one relationship, or the root registry for discovery. Use [classifications](https://docs.intuition.systems/docs/reference/packages/classifications) for classification-specific object targets; legacy `expectedObjectType` strings are descriptive hints. Predicate metadata does not create graph edges, infer inverse edges, or upload an IPFS document.

## Install

```sh
npm install @0xintuition/predicates@0.1.1 viem@2.31.4
```

Use ESM `import` or CommonJS `require()` on Node 20+. Public subpaths work in both formats. See [installation and peer setup](https://docs.intuition.systems/docs/build/install) and the [runtime compatibility limits](https://docs.intuition.systems/docs/reference/compatibility#runtime-requirements).

## Entry points

| Subpath | Purpose                                                                                         |
| ------- | ----------------------------------------------------------------------------------------------- |
| `.`     | Registry, deterministic data and IDs, semantic metadata, display and bootstrap helpers.         |
| `./*`   | Standalone predicate modules keyed by the exact registry key, such as `/byArtist` or `/sameAs`. |

## Depends on and works with

Runtime dependencies: [`@0xintuition/ids`](https://docs.intuition.systems/docs/reference/packages/ids).

Published peers: `viem ^2.0.0`.

## @0xintuition/predicates - Example

```ts
import { calculateAtomId, calculateTripleId } from '@0xintuition/ids';
import {
  byArtist,
  byArtistAtomData,
  byArtistId,
  byArtistSpec,
} from '@0xintuition/predicates/byArtist';

// Synthetic local fixture atoms; these strings claim no external identity.
const recordingId = calculateAtomId('example:recording');
const artistId = calculateAtomId('example:artist');
const byArtistTripleId = calculateTripleId(recordingId, byArtistId, artistId);
console.log({
  key: byArtistSpec.key,
  label: byArtist.name,
  data: byArtistAtomData,
  predicateId: byArtistId,
  tripleId: byArtistTripleId,
});
```

The key `byArtist` selects a registry entry; the label `by artist` is display text. The data is a compact `DefinedTerm` JSON-LD string containing `@context`, `@type`, `name`, and `description` in that order. The predicate ID hashes that exact data: changing the description changes the ID even if the label stays the same.

The explicit triple above means **recording → by artist → artist**. Reversing subject and object changes the assertion and its ID. This computes a triple locally; it does not establish that any term exists on-chain.

## Related concepts

- [Predicates](https://docs.intuition.systems/docs/concepts/predicates)
- [sameAs and identity linking](https://docs.intuition.systems/docs/concepts/same-as)

See also [music catalog](https://docs.intuition.systems/docs/examples/music-catalog).

## Source

[Package README at the pinned release](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/predicates/README.md).

[byArtist specification](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/predicates/src/generated/specs/byArtist.ts) · [Standalone export](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/predicates/src/standalone/byArtist.ts) · [Predicate serialization](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/ids/src/predicate-id.ts).

Applies to V2 · `@0xintuition/predicates` 0.1.1
