Skip to content

Port entity graph to server-side BFS with multi-root seeAlso - #1

Merged
damienriehl merged 6 commits into
mainfrom
entity-graph-pr
Apr 6, 2026
Merged

Port entity graph to server-side BFS with multi-root seeAlso#1
damienriehl merged 6 commits into
mainfrom
entity-graph-pr

Conversation

@damienriehl

Copy link
Copy Markdown

Summary

  • Server-side BFS graph endpoint replaces client-side graph builder
  • OWL restriction seeAlso parsing — extracts seeAlso from owl:someValuesFrom restrictions, not just direct triples
  • Multi-root support — shows all ancestor branches (via seeAlso cross-links) with root alignment at top
  • Primary vs secondary roots — ultimate ancestor (red), seeAlso branch roots (dark gray)
  • ELK layout fixes — roots pinned to FIRST layer, seeAlso edges non-hierarchical, NETWORK_SIMPLEX placement

Companion backend work deployed on production server.
Upstream PR: CatholicOS#88

🤖 Generated with Claude Code

damienriehl and others added 6 commits April 6, 2026 11:24
Replace client-side graph building with server-driven BFS endpoint.
Port folio-mapper's ELK layout hook, add full-screen EntityGraphModal,
update node coloring (root=red, seeAlso=purple), add descendants toggle
and truncation warnings.

- New: lib/api/graph.ts (API client for graph endpoint)
- New: lib/graph/useELKLayout.ts (ELK layout hook from folio-mapper)
- New: components/graph/EntityGraphModal.tsx (full-screen overlay)
- Rewritten: useGraphData.ts (single API call replaces iterative fetches)
- Rewritten: OntologyGraph.tsx (server data + progressive expansion)
- Updated: OntologyNode.tsx (root nodes now red, not amber)
- Updated: OntologyEdge.tsx (seeAlso now purple #8b5cf6)
- Updated: StandardEditorLayout (modal expand button + EntityGraphModal)
- Updated: DeveloperEditorLayout (removed labelHints from graph)

Ref: CatholicOS#81

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Delete buildGraphData.ts and elkLayout.ts (now handled by backend
endpoint and useELKLayout hook). Extract extractTreeLabelMap to
lib/graph/utils.ts and update layout imports. Add tests for
useELKLayout, utils, and useGraphData hooks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Swap source/target Handle positions on OntologyNode — source (parent
  edge) at bottom, target (child edge) at top, matching top-down layout
- Use treeLabelHints to resolve human-readable label for EntityGraphModal
  title instead of getLocalName() which showed raw IRI path segments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Mark seeAlso edges as non-hierarchical (priority.direction=0) so they
  don't influence layer assignment — roots stay at the top
- Switch to NETWORK_SIMPLEX node placement for better vertical alignment
- Use DEPTH_FIRST cycle breaking to handle bidirectional seeAlso cleanly
- Keep connected components together (separateConnectedComponents=false)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add "secondary_root" node type for seeAlso branch roots (dark gray
  border, slate-100 bg) — visually distinct from primary root (red)
- Pin root/secondary_root nodes to ELK FIRST layer for top alignment
- Update legend: "Primary root" (red) + "Branch root" (gray)
- Update MiniMap colors for secondary_root (#64748b)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@damienriehl
damienriehl merged commit 71362d2 into main Apr 6, 2026
@damienriehl
damienriehl deleted the entity-graph-pr branch April 6, 2026 17:38
damienriehl added a commit that referenced this pull request Aug 8, 2026
damienriehl added a commit that referenced this pull request Sep 6, 2026
- resumeSession no longer stores the raw session id as the beacon token;
  session summaries carry no server-issued token, so it is cleared (#1)
- PropertyDetailPanel accept path now has a provenance-argument test (#2)
- updatePropertyInTurtle carries undescribed predicate-objects through a
  form save, so the PROV-O stamp survives the first edit; the block parser
  is hoisted from turtleClassUpdater into turtleUtils (#3)
- persistGeneratedEntity gates the prov: prefix declaration with
  isProvPrefixBoundToProvO so accepted entities stop re-declaring it (#4)
damienriehl added a commit that referenced this pull request Sep 6, 2026
…43)

* chore(parity): ledger feat/pr-party -> dev and carry 17 paths (U4)

Adds docs/audits/2026-09-05-pr-party-dev-parity-ledger.md giving every one
of the 191 name-status rows and 15 removed exports between feat/pr-party and
dev a single disposition (17 carry, 154 dev supersedes, 20 drop). Carries the
17 rows the ledger marks carry: the accepted-suggestion provenance bridge and
PROV-O emission in the Turtle snippet generator, the missing-issuer logout
guard, the server-issued beacon token, the public issuer in next.config, and
the frozen-line regression tests for each, adapted only where dev's APIs
changed. Findings F1 (auth-disabled capability routing) and F2 (provider
build args in the Dockerfile) stay dev supersedes pending review.

* fix(review): apply U4 review findings #1-#4

- resumeSession no longer stores the raw session id as the beacon token;
  session summaries carry no server-issued token, so it is cleared (#1)
- PropertyDetailPanel accept path now has a provenance-argument test (#2)
- updatePropertyInTurtle carries undescribed predicate-objects through a
  form save, so the PROV-O stamp survives the first edit; the block parser
  is hoisted from turtleClassUpdater into turtleUtils (#3)
- persistGeneratedEntity gates the prov: prefix declaration with
  isProvPrefixBoundToProvO so accepted entities stop re-declaring it (#4)
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