Skip to content

[Bug]: Explorer Graph view never draws relationship edges (initial render nor after selection) #198

Description

@segashu-aws

Description

Opening Ontology → Explorer → Graph shows classes but no relationship (object-property) edges, even for an ontology whose object properties are known to be stored. The status line reads N nodes · 0 edges. Selecting a node lists its relationships in the side panel, but nothing is ever drawn between class nodes. The Induction proposal page for the same ontology does draw them, so users conclude the accepted ontology lost its relationships.

Environment

  • Commit ID: Observed on 42b5c6b (tag v0.2.2). _sample_overview() and GraphSearch.tsx are unchanged on e265573 (tag v0.3.1 = main).
  • Environment: ap-northeast-1 deployment

Step to reproduce

Two independent paths reproduce it; the second one removes scanning and the LLM from the picture entirely.

A. Induced ontology

B. Uploaded ontology with explicit object properties (deterministic)

  • Upload the Turtle below via Ontology → Induction → Upload your own ontology
  • Explorer → Ontologies tab lists it as Classes 3 / Properties 4 — the two owl:ObjectProperty are stored
  • Explorer → Classes → Graph: the three classes appear, status line says … · 0 edges
  • Click a class: the side panel lists Relationships (…), but no edge is drawn on the canvas
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex:   <https://example.com/u1-test#> .

<https://example.com/u1-test> a owl:Ontology .
ex:Customer a owl:Class . ex:Order a owl:Class . ex:Claim a owl:Class .
ex:placedBy a owl:ObjectProperty ; rdfs:domain ex:Order ; rdfs:range ex:Customer .
ex:raisedBy a owl:ObjectProperty ; rdfs:domain ex:Claim ; rdfs:range ex:Customer .

With two ontologies in the namespace the status line reads 6 nodes · 0 edges (3 seed roots per ontology).

A root cause

Two halves, one on each side.

  1. Server. The Graph view's initial data comes from GET …/ontology-overview?sample=true, served by _sample_overview() in packages/ontology-engine/src/coa_ontology/stores/neptune_db_graph.py (L1429). It returns classes only and hard-codes

    "object_properties": [],
    "datatype_properties": [],

    (L1500-1501). The docstring says: "Properties are omitted — the Graph view fetches a node's relationships on selection."

  2. Client. buildGraphData() in packages/web-app/src/pages/ontology/GraphSearch.tsx (L141-190) only draws an edge when both endpoints are visible vertices. Relationships are modelled as object-property vertices sitting between two classes, so a class→class relationship can only appear on the canvas if the property vertex itself is in the visible set. The seed never contains property vertices, and the on-selection fetch only feeds the side panel — it does not add the property vertex to visibleUris. Double-click expands sub-classes only (the hint text says so). So from the seed view there is no user action that ever brings a relationship onto the canvas.

Net effect: the Graph view is a subClassOf taxonomy view labelled as an ontology graph, with a legend that promises "Relationship" (orange) nodes that can only appear via the search path.

Fix (proposal)

  • In _sample_overview(), include object properties whose domain and range are both inside the sampled class set (bounded by construction), and/or
  • On selection / expand, add the fetched object-property vertices (and their far-end class, within budget) to visibleUris so buildGraphData() can draw them, and
  • Change the hint text to state what expand does and does not load.

Context

Reported by a customer evaluating v0.2.2 on ap-northeast-1 with a Snowflake source ("edges are not shown in Explorer's initial graph, but are shown in Induction"). Related: #196 (3-node cap in the same _sample_overview()), #197 (same evaluation). The proposal page (ProposalDetail.tsx) draws edges from the proposal JSON directly, which is why they are visible there.

Additional Information / References

Uploaded test ontology with 2 object properties, Graph view shows no edges (6 nodes = 3 seed roots × 2 ontologies):

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions