Examples

This section contains various examples demonstrating how to use bhopengraph for different scenarios.

Basic Examples

Advanced Examples

Running Examples

All examples can be run directly from the command line. Make sure you have bhopengraph installed first:

# Navigate to the examples directory
cd examples

# Run a specific example
python 01_simple_path_finding.py
python 02_node_types_and_properties.py
python 03_edge_operations.py
python 04_graph_analysis.py
python advanced_features.py
python minimal_working_json.py

Example Outputs

Each example generates output files that demonstrate the functionality:

  • 01_simple_path_finding.py: Creates a simple graph with path finding

  • 02_node_types_and_properties.py: Shows different node types and properties

  • 03_edge_operations.py: Demonstrates edge creation and manipulation

  • 04_graph_analysis.py: Performs basic graph analysis operations

  • advanced_features.py: Shows advanced features and techniques

  • minimal_working_json.py: Creates the minimal working JSON example

These examples follow the BloodHound OpenGraph schema and best practices, making them suitable for learning and as templates for your own projects.