Skip to content

Conversation

kmcginnes
Copy link
Collaborator

@kmcginnes kmcginnes commented Sep 19, 2025

Description

Fixes a long standing issue around neighbor counts when calculated with neighbors having multiple labels/classes.

  • Use the loading style notification for neighbor expansion
  • Sparql now executes two queries to get neighbor counts
    • Unique neighbors - gets total count of unique resource neighbors
    • By type neighbors - gets count of neighbors grouped by types (could have the same neighbor in more than one type count)
  • Update fetched neighbor counts to include a count for each type per neighbor
  • Update gremlin & openCypher neighbor count mapping to count by type separate from unique neighbors
  • Don't allow negative unfetched counts

Validation

  • Tested in multiple data sets (air routes, premiere league, generated, nobel prize)
  • Ensured neighbor expansion filtered by type works properly
  • Known limitation: blank nodes are still not 100% correct, but this is a separate issue
  • Known limitation: schema sync counts and type list are not 100% correct, but this is a separate issue

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0
    license.
  • I have run pnpm checks to ensure code compiles and meets standards.
  • I have run pnpm test to check if all tests are passing.
  • I have covered new added functionality with unit tests if necessary.
  • I have added an entry in the Changelog.md.

@kmcginnes kmcginnes marked this pull request as ready for review September 19, 2025 19:19
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 89.18919% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.21%. Comparing base (6070a74) to head (343a19a).
⚠️ Report is 66 commits behind head on main.

Files with missing lines Patch % Lines
...raph-explorer/src/utils/testing/graphsonHelpers.ts 78.94% 8 Missing ⚠️
...ph-explorer/src/connector/sparql/neighborCounts.ts 91.13% 7 Missing ⚠️
...graph-explorer/src/core/StateProvider/neighbors.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1194      +/-   ##
==========================================
+ Coverage   33.94%   37.21%   +3.26%     
==========================================
  Files         524      529       +5     
  Lines       21535    23647    +2112     
  Branches     1563     1963     +400     
==========================================
+ Hits         7310     8800    +1490     
- Misses      14111    14738     +627     
+ Partials      114      109       -5     
Flag Coverage Δ
unittests 37.21% <89.18%> (+3.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kmcginnes kmcginnes force-pushed the sparql/multi-class-support branch from 343a19a to bfc9dbc Compare October 2, 2025 15:30
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.

Multi-label support handles neighbor counts incorrectly
1 participant