reliefgraph

Crates.ioreliefgraph
lib.rsreliefgraph
version0.1.0
created_at2025-09-04 17:52:27.575141+00
updated_at2025-09-04 17:52:27.575141+00
descriptionThe humanitarian data knowledge graph indexer
homepagehttps://github.com/cpellet/reliefgraph
repositoryhttps://github.com/cpellet/reliefgraph
max_upload_size
id1824564
size1,100,976
Cyrus Pellet (cpellet)

documentation

https://docs.rs/reliefgraph

README

reliefgraph

reliefgraph ingests data from the ReliefWeb API and builds a structured Neo4j knowledge graph.
The graph captures reports, countries, disasters, themes, sources, and other nested entities as nodes, with relationships expressing their connections.

alt text

Features

  • ๐ŸŒ Entity graph: Countries, disasters, formats, languages, sources, themes, vulnerable groups, and more.
  • ๐Ÿ”— Relations: Each entity is linked to its parent (e.g., Report -> HAS_COUNTRY -> Country).
  • ๐Ÿ›ก Deduplication: Nodes are matched by id across runs, ensuring graph consistency.
  • ๐Ÿงน Property handling: Nested JSON fields are flattened into node properties.
  • ๐Ÿฆ Async Rust: Built on neo4rs for async Neo4j queries.

Installation

Add to your Cargo workspace:

[dependencies]
reliefgraph = 0.1.0

Or use it as a standalone binary crate:

cargo build --release

Usage

Prerequisites

Neo4j running locally or remotely. Example with Docker:

docker run -it --rm \
  --publish=7474:7474 --publish=7687:7687 \
  --env NEO4J_AUTH=neo4j/password \
  neo4j:5

Running

Set the Neo4j instance password with an environment variable:

export NEO4J_PASS=<password>

Fetch data from ReliefWeb and index it into Neo4j:

cargo run --release

By default, it connects to:

  • Bolt URI: bolt://localhost:7687
  • User: neo4j

Example graph

After indexing, you can query:

MATCH (n) RETURN n LIMIT 100;

Sample node

(:country {name: "Colombia", href: "https://api.reliefweb.int/v2/countries/64?appname=reliefgraph", id: "64", shortname: "Colombia", iso3: "col", primary: true})

Development

  • Neo4j connector is in graph/neo4j.rs
  • Recursive JSON to graph mapping is in model/nodes.rs
  • ReliefWeb integration is in source/reliefweb.rs

Roadmap

  • [] Unit & integration testing
  • [] Enhanced documentation
  • [] Smarter deduplication (e.g., fuzzy property-based matching).
  • [] Batch inserts for performance.
  • [] Configurable labels and relation naming.
  • [] Support for HDX API collections.

Documentation

Full API documentation is available at docs.rs

License

Licensed under MIT.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Commit count: 1

cargo fmt