Skip to content

dhaneswara/knowledge-graph-comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KG Explorer

A local web app for exploring four knowledge graph libraries side by side: NetworkX, RDFLib, Kuzu, and PyKEEN. Each tab loads the same movies dataset into the library's native shape and lets you run native queries (Python expressions / SPARQL / Cypher / TransE link prediction).

Prerequisites

  • Python 3.11+
  • Node 20+

Quick start

Windows

.\start.ps1

macOS / Linux

chmod +x start.sh
./start.sh

The launcher installs deps, starts the FastAPI backend on :8000, starts the Vite dev server on :5173, then opens http://localhost:5173.

Manual run (two terminals)

# Terminal 1 — backend
python -m venv backend/.venv
backend/.venv/Scripts/pip install -r backend/requirements.txt   # or backend/.venv/bin/pip on Unix
backend/.venv/Scripts/python -m uvicorn backend.main:app --reload --port 8000
# Terminal 2 — frontend
cd frontend
npm install
npm run dev

Tests

# Backend
backend/.venv/Scripts/python -m pytest backend/tests -v

# Frontend smoke
cd frontend && npm test

PyKEEN training is skipped in CI via PYKEEN_STUB=1. To run real training in tests, unset the env var.

Layout

  • backend/ FastAPI app, one router per library, shared movies dataset in backend/data/movies.json.
  • frontend/ React + Vite + TypeScript, one tab component per library, Cytoscape.js for graph viz.
  • docs/superpowers/specs/ design doc.
  • docs/superpowers/plans/ implementation plan.

What each tab does

  • NetworkX — in-memory MultiDiGraph. Type any Python expression against G (sandboxed against imports, dunders, and statements). Preset algorithms: shortest path, PageRank, degree centrality.
  • RDFLib — RDF triples under http://example.org/movies#. Free-form SPARQL queries with preset examples.
  • Kuzu — embedded property graph DB. Free-form Cypher with multi-hop and aggregation presets.
  • PyKEEN — trains a small TransE model on the movies triples (cached after first run). Pick a head entity + relation, get top-k tail predictions with scores. Also shows a PCA-projected scatter of entity embeddings and the training loss curve.

About

Comparing different knowledge graph solution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors