Tutorials and Examples

This section contains hands-on notebooks rendered directly in the docs. From every notebook page you can also open the notebook in Google Colab, Kaggle, or a local Jupyter server.

Tutorials and examples for the core of cvcdocdb. They use only the common GraphStore API, so they work unchanged on every backend (NetworkXGraph, Neo4jGraph, MemgraphGraph, JenaGraph): most use NetworkXGraph because it needs no server. Tutorials for the optional modules live with each module in Optional modules.

The tutorials show their graphs in the Graph viewer (show(graph)): click a node to see its properties, double-click it to expand its neighbours, and search or filter from the sidebar. The viewer needs a running kernel, so it appears when you run a notebook (locally, in Colab or in Kaggle), not on these pages.

Getting Started

Start here for a minimal end-to-end graph workflow:

Core concepts

WeakNode hierarchies and deletion strategies. The WeakNode notebook is an interactive editor: a control panel adds and deletes nodes, and the viewer shows each change.

Dataset Examples

Each dataset notebook loads the same data into NetworkXGraph, Neo4jGraph, MemgraphGraph and JenaGraph so you can compare them (the server sections need a running server each). The loaders in cvcdocdb.exemples accept any backend (the neo4j_*/networkx_* module names are historical).

  • Karate Club – Zachary’s karate club social network (34 members).

  • Bibliographic references – OpenAlex papers, authors and citations (bundled offline sample if network access is limited).

  • Movies – movies, genres and IN_GENRE relations (offline fallback).

  • Game of Thrones – characters and houses (offline fallback).

Backend-specific examples

Examples of features or workflows that are specific to one backend.

NetworkX

Vector (ANN) indexes are only available on NetworkXGraph (pip install "cvcdocdb[vector]"):

Neo4j

Full propagation workflow on a real Neo4j database: load data, generate the schema and entity classes, run init_propagation() and query. The same workflow as a script: python -m cvcdocdb.exemples.demo_propagation.

Memgraph

MemgraphGraph has the same API and behaviour as Neo4jGraph, so every general tutorial runs on it by creating the graph with MemgraphGraph(url, user, password) instead. The full propagation workflow of the Neo4j demo, on Memgraph:

Apache Jena

Every general tutorial runs on JenaGraph("http://localhost:3030/ds"). On top of that, the data can be queried with SPARQL (see Apache Jena backend (SPARQL)) and with Natural-language queries in SPARQL (Text2SPARQL). The full propagation workflow of the Neo4j demo on Fuseki, querying the graph in SPARQL (RDF 1.2 included) and in Cypher:

Example scripts (cvcdocdb.exemples)

  • Dataset loaders, for any backend: load_karate_club, load_bibliografia_openalex, load_movies_sample, load_got_characters and (for RiC-O entities) load_ric_o_naf.

  • Command-line loader: python -m cvcdocdb.exemples --dataset karate --backend networkx.

  • Neo4j only: python -m cvcdocdb.exemples.demo_propagation.

Notes

  • Notebook pages keep the original .ipynb download link in the rendered output.

  • Tutorials are configured to use the cvcdocdb Jupyter kernel by default.

  • Each tutorial notebook starts with an installation cell that installs cvcdocdb[notebook] (the library plus the viewer’s anywidget) when it is missing.

  • Button links can be customized with env vars: DRM_DOCS_GITHUB_REPO, DRM_DOCS_GITHUB_REF, DRM_DOCS_LOCAL_JUPYTER_BASE, and DRM_DOCS_LOCAL_NOTEBOOK_PREFIX.