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.0.0.tar.gz (364.0 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.0.0-py3-none-any.whl (260.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ideagraph-2.0.0.tar.gz
  • Upload date:
  • Size: 364.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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.0.0.tar.gz
Algorithm Hash digest
SHA256 06a75fe7f1083b3fbe87fd4494ac0a2a6bd116e8b9b6a1d845a0e8f43d86b3da
MD5 e1c22f7730bed3205e2bb3f5d0397bd0
BLAKE2b-256 6c09f5a4f54ff574e5efecc99a761f6b050ff3de5b95b26c08ee589f136b8933

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ideagraph-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 260.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 237961bdcbedf7fcc9fec3435f066bb3b6117f0c9b0edea10859cdadbeece390
MD5 060c50b467a5fba4039bbfb5250c73a7
BLAKE2b-256 8faf0c25b01dfc06352dc0eb55f57c2f5411a60065984401b15eaa034ab9cb47

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