Skip to main content

An idea-graph engine: turn articles into a navigable graph of statements and their relationships

Project description

ideagraph

Python CI pre-commit.ci status Documentation Status codecov PyPI Version Python Versions License Ruff DOI SPEC 0 — Minimum Supported Dependencies

ideagraph is an engine for representing knowledge as a graph.

Each node carries one piece of information; edges are the typed relationships between pieces. A profile gives a graph its vocabulary and rules, so the same engine can model any domain. The built-in research profile reproduces ideagraph's original purpose — turning an article into a graph of its statements (claims, findings, methods, …), the discourse links between them, and the evidence that supports them — with support coverage, validation, and staleness as facets of that profile.

Every interface is machine-readable, so humans and AI agents share one tool. AI agents build and edit graphs through the CLI (which validates writes and returns actionable errors); humans read, visualise, and share graphs through the Django web interface.

ideagraph was previously released as ClaimKit. The claimkit package has been renamed — install ideagraph.

Core concepts

  • Node — one piece of information: a typed node (its type drawn from the active profile's vocabulary) with a stable id, text, tags, and free-form properties.
  • Edge — a typed, directed connection between two nodes. A cross-article edge simply targets a global article#node id in another graph.
  • KnowledgeGraph — the container of nodes and edges; supports traversal and a flat, versioned JSON serialisation.
  • Profile — the schema that gives a graph meaning: the node and edge types it may use, endpoint constraints, and required properties. The research profile defines statement types (claim, finding, background, method, …), evidence and activity nodes, and the provenance / discourse / cross-article edge types, plus coverage, validation, and staleness.

Under the research profile, an asserting statement's status is one of unresolved, valid, invalid, stale, or needs_review.

Installation

pip install ideagraph

Requires Python 3.12+. The web interface + REST API are an optional extra: pip install ideagraph[web].

Command-line quickstart

Build a graph, link evidence, and check it — all from the terminal:

ideagraph init graph.json
CLAIM=$(ideagraph add-claim graph.json "Half-life measured at 5.2 days." --tag decay)
ideagraph add-evidence graph.json "$CLAIM" \
    --kind workflow --reference run-42 --digest sha256:abc123

ideagraph validate graph.json            # resolve status from evidence
ideagraph stale graph.json               # flag claims whose artefacts changed
ideagraph report graph.json              # human-readable Markdown report
ideagraph export graph.json -o prov.json # export to W3C PROV-JSON
ideagraph import prov.json restored.json # import PROV-JSON back into a graph

validate and stale accept --json for machine-readable output; report and export accept -o to write to a file. Run ideagraph --help for the full command list.

Python quickstart

from ideagraph import Edge, KnowledgeGraph, Node, render_report, validate_all

graph = KnowledgeGraph()
graph.add_node(Node(type="claim", id="c1", text="Half-life measured at 5.2 days."))
graph.add_node(
    Node(type="evidence", id="e1", properties={"kind": "workflow", "reference": "run-42"})
)
graph.add_edge(Edge(type="supported_by", source="c1", target="e1"))

result = validate_all(graph)["c1"]
print(result.status, "—", result.reason)   # valid — supported by 1 piece(s)
print(render_report(graph))

Validate a graph against its profile's rules:

from ideagraph import get_profile

diagnostics = get_profile("research").validate(graph)  # [] when the graph conforms

Web interface

pip install ideagraph[web] adds a Django server: a hostable web UI to visualise graphs and a token-authenticated REST API to share them with collaborators (per-graph owner/collaborator permissions). Run it with python manage.py migrate && python manage.py runserver; the local CLI can push and pull graphs to a hosted server with ideagraph remote.

Interoperability

ideagraph graphs serialise to a versioned JSON format for storage (save_graph / load_graph) and export to / import from W3C PROV-JSON (to_prov / from_prov) for interchange with the wider provenance ecosystem.

License

BSD 3-Clause. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ideagraph-2.1.0.tar.gz (378.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ideagraph-2.1.0-py3-none-any.whl (274.2 kB view details)

Uploaded Python 3

File details

Details for the file ideagraph-2.1.0.tar.gz.

File metadata

  • Download URL: ideagraph-2.1.0.tar.gz
  • Upload date:
  • Size: 378.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ideagraph-2.1.0.tar.gz
Algorithm Hash digest
SHA256 ced68f1d8b8e7293918e68a8778b05c9d3a9b7f0319065d8ed9db3a63e267243
MD5 c8e54b1bfad16887de3f2a22b2cb3100
BLAKE2b-256 feeb5c84d25ea520f626a11a5be6c7869b3d9b3ea1da134fcdbfaf94cd65695b

See more details on using hashes here.

File details

Details for the file ideagraph-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: ideagraph-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 274.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ideagraph-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c2290c9fcc6d34c2331d10ce7422e215c184aa9916aa707434aebedaa9e8f70
MD5 217e4d35deac0d058fc2392b561cdfcf
BLAKE2b-256 a361cda65ba41127ca307b327a356991a07bf20507e50693366aab6aee4835f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page