Skip to content

About

Interactive visual tool for comparing and evaluating knowledge graphs with metrics, graph diffing and merge/rewire workflows

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Knowledge Graph Comparator

An interactive browser-based tool for comparing knowledge graphs against ground truth datasets.

Designed for evaluating LLM-generated graphs, entity extraction pipelines, and relationship extraction systems.


Features

Graph Comparison

  • Compare:
    • Ground truth graphs (gs<ID>.json)
    • Generated graphs (generated<ID>.json)
    • Matching by ID
  • Automatic TP / FN / FP / UNKNOWN classification

Interactive Visualization

  • D3.js-powered force graph
  • Relationship edge rendering
  • Parallel edge curves
  • Zoom + pan controls
  • Drag-and-drop graph navigation

Evaluation Metrics

  • Entity coverage
  • Relationship coverage
  • Precision metrics
  • Per-file summaries
  • Per-type breakdowns
  • Aggregate experiment statistics

Annotation & Editing Tools

Merge Tool

Merge semantically equivalent nodes across graphs.

Rewire Tool

Reconnect incorrect generated edges to correct gold-standard edges.

Verify Tool

Manually verify UNKNOWN entities and relationships:

  • Mark as TP
  • Mark as FP

Filtering

Filter graph elements by:

  • Status
    • TP
    • FN
    • FP
    • UNKNOWN
  • STIX entity type

Data Export

  • Download all modified experiments as ZIP
  • Preserves verification annotations
  • Outputs normalized JSON

Input Format

Ground Truth Example (gs1.json)

{
  "passage": "APT29 used malware X against target Y.",
  "entities": [
    {
      "name": "APT29",
      "type": "threat-actor"
    }
  ],
  "relationships": [
    {
      "source": "APT29",
      "relationship": "uses",
      "target": "Malware X"
    }
  ]
}

Generated Example (generated1.json)

{
  "entities": [
    {
      "name": "APT29",
      "type": "threat-actor"
    }
  ],
  "relationships": [
    {
      "source": "APT29",
      "relationship": "uses",
      "target": "Malware X"
    }
  ]
}

Usage

Option 1 — Folder Upload

  1. Open index.html
  2. Drag-and-drop JSON files
  3. Use naming convention:
    • gs1.json
    • generated1.json

The app automatically pairs experiments.


Option 2 — Textarea Mode

Paste JSON directly into:

  • Ground truth textarea
  • Model output textarea

Then click:

Compare Graphs

Verification Workflow

UNKNOWN items can be manually validated against the source passage.

Verification states:

  • tp
  • fp
  • unknown

These annotations persist in exported files.


Technologies

  • D3.js
  • JSZip
  • Vanilla JavaScript
  • HTML5
  • CSS3

No backend required.


Running Locally

Simply open:

index.html

Or serve locally:

python -m http.server 8000

Then visit:

http://localhost:8000

Use Cases

  • LLM evaluation
  • Cyber threat intelligence extraction
  • STIX graph QA
  • Entity resolution research
  • Relationship extraction benchmarking
  • Human-in-the-loop graph correction
  • Knowledge graph annotation workflows

Dataset Source

The testing dataset used in this project is the test dataset from QCRI/AZERG-Dataset on Hugging Face.

@article{lekssays2025azerg, title={From Text to Actionable Intelligence: Automating STIX Entity and Relationship Extraction}, author={Lekssays, Ahmed and Sencar, Husrev Taha and Yu, Ting}, journal={arXiv preprint arXiv:2507.16576}, year={2025} }


Declaration of AI use

Large Language Models (GPT-5.x series within Codex) were used to assist with code generation, enabling more rapid development. AI assistance was limited to implementing code that satisfied predefined function descriptions and requirements. Architectural decisions, system design, and overall engineering direction was led by me without the use of AI

About

Interactive visual tool for comparing and evaluating knowledge graphs with metrics, graph diffing and merge/rewire workflows

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages