Skip to content

Relations json type triplet#773

Draft
trangdoan982 wants to merge 2 commits intomainfrom
cursor/ENG-1423-relations-json-type-triplet-d92a
Draft

Relations json type triplet#773
trangdoan982 wants to merge 2 commits intomainfrom
cursor/ENG-1423-relations-json-type-triplet-d92a

Conversation

@trangdoan982
Copy link
Collaborator

Change the type field in relations.json to use the relation triplet ID instead of the relation type ID.

Previously, relations were stored using the generic relationTypeId (e.g., rel_...), which is not unique for specific subject-predicate-object combinations. This PR updates the storage and all related logic to use the unique relation triplet id (e.g., rel3_...), ensuring each relation instance is correctly identified.


Linear Issue: ENG-1423

Open in Cursor Open in Web

cursoragent and others added 2 commits February 12, 2026 23:28
….json

- Updated addRelationToRelationsJson to accept relationTripletId parameter
- Added utility functions getRelationById and findRelationTripletId to typeUtils
- Updated all callers to find the relation triplet id before creating relations:
  - DiscourseRelationShape.tsx: Added node type resolution and triplet lookup
  - RelationshipSection.tsx: Updated add/delete operations to use triplet id
  - RelationPanel.tsx: Updated relation creation and grouping logic
- Fixed migration function to use relation triplet id when migrating from frontmatter
- Updated relation filtering logic to work with triplet ids instead of type ids

This ensures that RelationInstance.type stores the relation triplet id (DiscourseRelation.id with rel3_ prefix) instead of the relation type id (DiscourseRelationType.id).

Co-authored-by: Trang Doan <trangdoan982@users.noreply.github.com>
Changed relationTypeId to relationTripletId to match the updated function signature.

Co-authored-by: Trang Doan <trangdoan982@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 12, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@linear
Copy link

linear bot commented Feb 12, 2026

@supabase
Copy link

supabase bot commented Feb 12, 2026

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

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.

2 participants