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.
- 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.
- 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.
You can install knows via PyPI Docker or run it from the source code.
-
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]
-
Pull Image:
docker pull lszeremeta/knows
-
Run Container:
docker run --rm lszeremeta/knows [nodes] [edges] [options]
-
Build Image:
docker build -t knows .
-
Run Container:
docker run --rm knows [nodes] [edges] [options]
-
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]
knows [nodes] [edges] [options]
To view all available options, use:
knows -h
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.
-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.
- 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
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.
Knows is licensed under the MIT License.