Skip to content

Add server-side BFS entity graph with OWL seeAlso parsing#1

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

Add server-side BFS entity graph with OWL seeAlso parsing#1
damienriehl merged 2 commits into
mainfrom
entity-graph-endpoint

Conversation

@damienriehl

Copy link
Copy Markdown

Summary

  • BFS entity graph endpoint (GET /projects/{id}/ontology/graph/{iri}) with configurable depth
  • OWL restriction seeAlso parsing — extracts seeAlso from owl:someValuesFrom restrictions
  • Focus-only incoming seeAlso — prevents cascade from reverse seeAlso on intermediate nodes
  • Primary vs secondary root classification — ultimate ancestor root stays "root", seeAlso branch roots become "secondary_root"

Upstream PR: CatholicOS#37

🤖 Generated with Claude Code

damienriehl and others added 2 commits April 6, 2026 11:29
Add GET /projects/{id}/ontology/classes/{iri}/graph endpoint that builds
a multi-hop entity graph via BFS traversal. Returns nodes and edges for
visualization with lineage-based node types (focus, root, class, etc.).

Configurable: ancestors_depth, descendants_depth, max_nodes, include_see_also.
Truncation detection when node count exceeds max_nodes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The entity graph BFS only checked outgoing rdfs:seeAlso (graph.objects),
missing incoming connections (graph.subjects). For example, "Proceeding
Closed / Disposed seeAlso Motion to Dismiss" was invisible because only
MTD's outgoing seeAlso was checked, not what points TO MTD.

Now checks both directions, surfacing all cross-branch root ancestors
(e.g., "Service", "Status") that connect via seeAlso to visited nodes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@damienriehl
damienriehl merged commit 8876666 into main Apr 6, 2026
@damienriehl
damienriehl deleted the entity-graph-endpoint branch April 6, 2026 17:39
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