Property graph benchmark that creates graphs with specified node and edge numbers, supporting multiple output formats and visualization
Project description
Knows is a user-friendly tool for benchmarking property graphs. These graphs are crucial in many fields. Knows supports multiple output formats and visualization capabilities, making it a go-to tool for educators, researchers, and data enthusiasts.
Key Features 🚀
- Customizable Graph Generation: Tailor your graphs by specifying the number of nodes and edges.
- Diverse Output Formats: Export graphs in formats like GraphML, YARS-PG, GEXF, GML, SVG, JSON, and others.
- Integrated Graph Visualization: Conveniently visualize your graphs in SVG format.
- Intuitive Command-Line Interface (CLI): A user-friendly CLI for streamlined graph generation and visualization.
- Docker Compatibility: Deploy Knows in Docker containers for a consistent and isolated runtime environment.
Graph Structure
- Generates graphs with specified or random nodes and edges.
- Creates directed graphs.
- Nodes are labeled
Person
with unique IDs (N1, N2, N3, ..., Nn
). - Nodes feature
firstName
andlastName
properties with randomly assigned names. - Edges are labeled
knows
and include acreateDate
property with a random date. - Edges have random nodes, avoiding cycles.
Installation 🛠️
You can install knows via PyPI Docker or run it from the source code.
Install via PyPI
-
Installation:
pip install knows[draw]
The
draw
installs amatplotlib
library for graph visualization. You can omit the[draw]
if you don't need visualization andsvg
output generation. -
Running Knows:
knows [nodes] [edges] [options]
Docker Deployment 🐳
From Docker Hub
-
Pull Image:
docker pull lszeremeta/knows
-
Run Container:
docker run --rm lszeremeta/knows [nodes] [edges] [options]
Building from Source
-
Build Image:
docker build -t knows .
-
Run Container:
docker run --rm knows [nodes] [edges] [options]
Python from Source
-
Clone Repository:
git clone git@github.com:lszeremeta/knows.git cd knows
-
Install Requirements:
pip install -r requirements.txt
-
Execute Knows:
python -m knows [nodes] [edges] [options]
Usage 💡
Basic Usage
knows [nodes] [edges] [options]
To view all available options, use:
knows -h
Positional Arguments
nodes
: Specify the number of nodes in the graph. Selected randomly if not specified.edges
: Specify the number of edges in the graph. Selected randomly if not specified.
Options
-h
,--help
: Display the help message and exit the program.-f {graphml,yarspg,gexf,gml,svg,adjacency_list,multiline_adjacency_list,edge_list,json}
,--format {graphml,yarspg,gexf,gml,svg,adjacency_list,multiline_adjacency_list,edge_list,json}
: Choose the format to output the graph. Default:graphml
.-d
,--draw
: Generate an image of the graph (default is no image). This option may not work in the Docker.
Practical Examples 🌟
- Create a random graph in GraphML format:
knows
- Create a 100-node, 70-edge graph in YARS-PG format:
knows 100 70 -f yarspg > graph.yarspg
- Create a 100-node, 50-edge graph in GraphML format:
knows 100 50 > graph.graphml
- Create, save, and visualize a 100-node, 50-edge graph in SVG:
knows 100 50 -f svg -d > graph.svg
- Create, save a 100-node, 50-edge graph in SVG with a custom filename:
knows 100 50 -f svg > graph.svg
- Create a graph in JSON format:
knows -f json > graph.json
Contribute to Knows 👥
Your ideas and contributions can make Knows even better! If you're new to open source, read How to Contribute to Open Source and CONTRIBUTING.md.
License 📜
Knows is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.