Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request implements the getHierarchies functionality (#89) by enhancing graph visualization and term hierarchy features. The changes introduce robust data normalization to handle multiple data formats and significantly improve the flexibility and user experience of the graph viewer and related components.
- Adds new API endpoint
getTermHierarchieswith JSON-LD and HTML fallback parsing capabilities - Refactors graph and table components to support multiple data shapes (rows, values, tableData, edges)
- Implements dynamic hierarchy visualization with children/superclass relationships
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.js | Adds proxy configuration for transitive query endpoints |
| test/*.json | Adds test data files for ontologies and task configurations |
| src/components/common/CustomizedTreeView.jsx | Refactors to accept dynamic tree data with loading states and current item highlighting |
| src/components/SingleTermView/OverView/PredicatesAccordion.jsx | Updates to handle new predicate data format and improves toggle button logic |
| src/components/SingleTermView/OverView/Predicates.jsx | Major refactor to merge triple data from multiple sources into predicate groups |
| src/components/SingleTermView/OverView/OverView.jsx | Adds hierarchy fetching logic and integrates new data flow |
| src/components/SingleTermView/OverView/Hierarchy.jsx | Implements tree building from triple data with children/superclass views |
| src/components/SingleTermView/OverView/CustomizedTable.jsx | Adds robust data normalization helper and improves table rendering |
| src/components/GraphViewer/GraphStructure.jsx | Refactors graph structure building with better data normalization |
| src/components/GraphViewer/Graph.jsx | Improves event handling, tooltip management, and fallback rendering |
| src/api/endpoints/apiService.ts | Implements new getTermHierarchies API function with HTML parsing fallback |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… up Predicates component
ddelpiano
requested changes
Aug 19, 2025
| import { getMatchTerms, getRawData, getTermHierarchies } from "../../../api/endpoints/apiService"; | ||
|
|
||
| // ---- HTML table -> triples (subject, predicate, object) ---- | ||
| function parseTransitiveHtml(html) { |
Member
There was a problem hiding this comment.
can we factor out this (if needed) in a util to make the component more readable please?
Author
There was a problem hiding this comment.
Removed on last iteration, was unused and unneeded. @ddelpiano
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request takes care of issue 89, implementing getHierarchies endpoint. It also updates the frontend libraries using this endpoint and removes any mock data used for Hierarchies
Copilot Summary
Graph Visualization Improvements:
Refactored
Graphcomponent (Graph.jsx) to improve tooltip handling, event listeners, and rendering logic. The component now usesuseCallbackfor mouse events, ensures proper cleanup, and gracefully handles cases with no data by displaying a fallback message. The expectedpredicateprop is now an object rather than a string, supporting richer data structures. [1] [2] [3]Enhanced the graph structure builder (
GraphStructure.jsx) by introducing robust normalization functions to handle various data shapes (rows,values,tableData,edges). The root node selection is now more intelligent, and the structure adapts to both legacy and new data formats.API and Data Handling Enhancements:
getTermHierarchiesinapiService.tsto fetch and parse term hierarchy data, supporting both JSON-LD and HTML fallback parsing. This enables the frontend to visualize hierarchical relationships even when the API returns HTML tables.Table Data Normalization:
CustomizedTable.jsxto use a new normalization helper that supportstableData,rows,values, andedgesformats. This ensures consistent rendering of tables regardless of the incoming data shape and improves ID generation for table rows.Minor and Style Refactors:
Cleaned up and condensed style definitions in
CustomizedTable.jsxfor better readability and maintainability. [1] [2]Improved imports and React hook usage in
CustomizedTable.jsxfor clarity and consistency.These changes collectively make the application more robust in handling various data sources and formats, improve user interaction with graphs, and simplify future maintenance.