Skip to content

feat: add classification metadata predicate refs - #6

Merged
jonathanprozzi merged 4 commits into
mainfrom
feat/classification-metadata-predicates
Jun 12, 2026
Merged

feat: add classification metadata predicate refs#6
jonathanprozzi merged 4 commits into
mainfrom
feat/classification-metadata-predicates

Conversation

@jonathanprozzi

@jonathanprozzi jonathanprozzi commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds metadataPredicates to every classification spec as stable predicate-key references.
  • Populates schema-backed field.schemaProperty pointers for recommended atom fields without copying schema inheritance/provenance into classifications.
  • Adds cross-package validation tests that confirm schema.org property pointers resolve through getPropertiesFor(...) and that every metadata predicate key exists in @0xintuition/predicates.
  • Generalizes classification schema pointers from schema.org-specific names to schema / schemaProperty so future schema sources can fit the same shape.
  • Moves social-media-account to an Intuition-owned JSON-LD context instead of treating it as a schema.org-like exception.
  • Expands sameAs support across schema.org-backed, user-facing classifications so imports can represent strict identity links as either creation-time atom data or later metadata triples.
  • Aligns primitive convenience builder signatures with the expanded sameAs field support.

Architecture Notes

This keeps the transcript-aligned split:

  • fields[] = recommended atom data.
  • metadataPredicates[] = recommended triple metadata.
  • schema points at the source vocabulary for a classification; schema.org is the first supported source, not the only possible source.
  • classifications store predicate keys, not generated IDs, so the package stays runtime-decoupled from @0xintuition/predicates.

Schema.org-backed fields keep local UX metadata (label, description, placeholder, required) while schemaProperty points at the canonical schema property. Consumers can derive inherited schema.org provenance from @0xintuition/schema-org.

sameAs is treated as strict identity linking, not generic related content. This pass adds it broadly for schema.org-backed entities/items that users may dedupe across sources, including music recordings, albums, groups, people, articles, websites, software, applications, and similar public objects. We intentionally exclude blockchain/internal identity shapes (ethereum-account, ethereum-erc20, ethereum-smart-contract), social-media-account, and artifact-like types without clear examples (aggregate-rating, social-media-posting). Existing sameAs coverage on earlier specs is preserved. We can revisit these boundaries as product examples sharpen.

Date-like schema.org fields such as datePublished, datePosted, startDate, and endDate remain atom data for now. They are not mapped to publishedAt; that predicate remains venue/platform/location semantics until the matrix/literal-object policy is defined.

Stack

This branch is stacked on feat/predicate-metadata-backfill, which is stacked on feat/schema-org-vocabulary-package.

The predicate relationship metadata experiment remains separate in the stacked draft PR on feat/predicate-relationship-metadata. The follow-up matrix branch moves that contract into classifications instead of predicates.

Validation

  • packages/primitives: bun run typecheck
  • packages/primitives: bun run test
  • packages/primitives: bun run check
  • packages/classifications: bun run test
  • packages/classifications: bun run typecheck
  • packages/classifications: bun run build
  • root: bun run schema:validate
  • root: bun run predicates:check-generated
  • root: bun run schema-org:check-generated
  • root: bun run build
  • root: bun run typecheck
  • root: bun run test
  • root: bun run check

@jonathanprozzi
jonathanprozzi force-pushed the feat/classification-metadata-predicates branch from 67d8060 to 254dfce Compare June 9, 2026 14:45
@linear

linear Bot commented Jun 9, 2026

Copy link
Copy Markdown
ENG-12257 Add 'metadataPredicates' field and references to all entities in classifications

Scope

Add classification-level metadataPredicates references after the needed predicate specs already exist in @0xintuition/predicates.

This is the final wiring step in the transcript/spec sequence:

  1. @0xintuition/schema-org exposes the neutral vocabulary foundation.
  2. The matrix marks atom data vs. triple metadata.
  3. @0xintuition/predicates backfills the missing predicate specs and IDs.
  4. This issue adds metadataPredicates to classifications by referencing those existing predicates.

Desired behavior

For each supported classification, expose the predicates Intuition recommends for metadata triples around atoms of that type. These are recommendations and package-level metadata, not backend enforcement yet.

Example:

SpotifySongAtom
  classification: music-recording / MusicRecording

SpotifySongAtom -> inPlaylist -> MySongsPlaylist
SpotifySongAtom -> inAlbum -> SomeAlbum
SpotifySongAtom -> byArtist -> SomeArtist

In that model, music-recording.metadataPredicates can include inPlaylist, inAlbum, and byArtist only after those predicates exist in the predicates package.

Implementation notes

  • Prefer stable predicate keys/slugs in classification source if that avoids package cycles; resolve IDs through generated accessors or root-level validation as needed.
  • Add validation that every classification metadataPredicates reference exists in @0xintuition/predicates.
  • Keep atom creation fields separate from metadata predicate recommendations; a property can be both.
  • Preserve the sameAs distinction: schema.org sameAs field is URL/reference-like atom data, while the sameAs predicate is a true equivalence claim.

Out of scope

  • Do not create missing predicate specs here; that belongs to ENG-12256.
  • Do not auto-promote every schema.org property into a metadata predicate.
  • Do not enforce backend restrictions yet; this is progressive package metadata and documentation.

Inputs

@jonathanprozzi
jonathanprozzi force-pushed the feat/classification-metadata-predicates branch 2 times, most recently from c6ddb76 to 889b68d Compare June 10, 2026 14:38
@jonathanprozzi
jonathanprozzi force-pushed the feat/predicate-metadata-backfill branch from 03ec77f to 86358a2 Compare June 11, 2026 14:16
@jonathanprozzi
jonathanprozzi force-pushed the feat/classification-metadata-predicates branch from 889b68d to 29ae771 Compare June 11, 2026 14:16
@jonathanprozzi
jonathanprozzi marked this pull request as ready for review June 12, 2026 19:16
@jonathanprozzi
jonathanprozzi force-pushed the feat/predicate-metadata-backfill branch from 86358a2 to b1b4e50 Compare June 12, 2026 19:31
@jonathanprozzi
jonathanprozzi force-pushed the feat/classification-metadata-predicates branch from 29ae771 to 606e3b8 Compare June 12, 2026 19:38
@jonathanprozzi
jonathanprozzi changed the base branch from feat/predicate-metadata-backfill to main June 12, 2026 19:38
@jonathanprozzi
jonathanprozzi merged commit 48bf69c into main Jun 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant