CypherSmith is a random cypher generator for OpenCypher.

Overview

CypherSmith

Description

CypherSmith is a random cypher generator for OpenCypher. Its paragon is SQLsmith, a random SQL query generator.

Graph databases are widely used, but don't have any automated statement production tool to find bugs, so I wrote one myself.

It currently supports generating RegularQuery.

Building

Release

$ cargo build --release

Usage

CypherSmith connects to the target graph database to send the generated queries to. Beware that CypherSmith does call functions that could possibly have side-effects (e.g. UpdatingClause). Use a suitably underprivileged user for its connection to avoid this.

Example Invocations:

# generate queries instead of executing them
$ cypher-smith --schema ./test/schema.json --config ./test/config.json

# testing AtlasGraph
$ cypher-smith --schema ./test/schema.json --config ./test/atlas_config.json --atlas ./test/atlas.json

Description of the input JSON files:

CypherSmith can be configured easily via configuration files, which are described below. The user can modify schema to configure Schema Information. A sample of schema.json is shown below. Some comments are added to provide a brief explanation.

The following options are currently supported:

option description
--schema Schema information for the graph model
--config Basic tool configuration
--atlas(Option) Connection configuration for AtlasGraph

Schema Information description

Schema Config

option description
--name Graph name
--vertex_labels Vertex Label Information: LabelName, LabelId, LabelKind, Properties
--edge_labels Edge Label Information: LabelName, LabelId, LabelKind, Properties
{
    // graph name
    "name": "cyphersmith",
    // vertex labels
    "vertex_labels": [
        {
            // vertex label name
            "label_name": "Person",
            // vertex label id, user define
            "label_id": 0,
            // kind: vertex or edge.
            "kind": "Vertex",
            // properties: name(String), propr_id(user define, int32), prop type, is_pk(bool), nullable(bool), is_delete(bool)
            // prop_type: "Int32" | "Null" | "Bool" | "Int64" | "Float" | "Double" | "Date" | "DateTime" | "String"
            "properties": [
                {
                    "name": "id",
                    "prop_id": 0,
                    "prop_type": "Int32",
                    "is_pk": true,
                    "nullable": false,
                    "is_delete": false
                }
            ]
        },
    ],
    "edge_labels": [
        {
            "label_name": "Knows",
            "label_id": 3, 
            "kind": { 
                // Edge: relations: [[source vertex_id(user define before),  dst vertex_id]]
                // is_directed: whether directed or not
                "Edge": {
                    "relations": [[0,0]],
                    "is_directed": true
                }
            },
            "properties":[
                {
                    "name": "edge_id",
                    "prop_id": 0,
                    "prop_type": "Int32",
                    "is_pk": false,
                    "nullable": false,
                    "is_delete": false
                }
            ]
        }
    ]
}

Example: ./test/schema.json

Detailed configuration description

Basic Config

option description
--call_query whether generate function call cypher string(WIP)
--max_queries terminate after generating this many queries
--dry_run print queries instead of executing them
--dry_run_path(Option) Cypehr Output file path
--verbose(Option) emit progress output
--dump_all_graphs dump generated ASTs for debugging

Example: ./test/config.json ./test/atlas_config.json

{
    "call_query": false,
    "max_queries": 1000,
    "dry_run": true,
    "verbose": "./report/test.csv",
    "dump_all_graphs": false
}

AtlasConnection Config

Configures the user, password, and address information for AtlasGraph Server.

option description
--address ip:port
--username UserName
--password Password

Example: ./test/atlas.json

You might also like...
Nostr Vanity Address Generator (Windows, Linux and macOS)

Nostr Vanity Address Generator CLI tool to generate vanity addresses for Nostr Usage Download the latest release built by GitHub CI from the releases

A bitcoin vanity address generator written with the Rust programming language.
A bitcoin vanity address generator written with the Rust programming language.

btc-vanity A bitcoin vanity address generator written with the Rust programming language. With btc-vanity you can create a private key which has a com

r2d2-cypher is a r2d2 connection pool for rusted-cypher

r2d2-cypher is a r2d2 connection pool for rusted-cypher

Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

This crate allows you to send cypher queries to the REST endpoint of a neo4j database

rusted_cypher Rust crate for accessing the cypher endpoint of a neo4j server This crate allows you to send cypher queries to the REST endpoint of a ne

A small random number generator hacked on top of Rust's standard library. An exercise in pointlessness.

attorand from 'atto', meaning smaller than small, and 'rand', short for random. A small random number generator hacked on top of Rust's standard libra

Quad-rand implements pseudo-random generator

quad-rand quad-rand implements pseudo-random generator based on rust atomics. Compatible with wasm and any oth

Pure rust implementation of python's random module with compatible generator behaviour.

pyrand Pure rust implementation of (parts of) python's random module with compatible PRNG behaviour: seeding with equivalent values will yield identic

Sūshì is a simple but customizable static site generator / blog generator written in Rust

sūshì Sūshì is a simple but customizable static site generator / blog generator written in Rust. Installation Install with Cargo (Recommended) cargo i

Pure Rust port of CRFsuite: a fast implementation of Conditional Random Fields (CRFs)

crfs-rs Pure Rust port of CRFsuite: a fast implementation of Conditional Random Fields (CRFs) Currently only support prediction, model training is not

A Rust🦀 implementation of CRAFTML, an Efficient Clustering-based Random Forest for Extreme Multi-label Learning

craftml-rs A Rust implementation of CRAFTML, an Efficient Clustering-based Random Forest for Extreme Multi-label Learning (Siblini et al., 2018). Perf

Fast and easy random number generation.

alea A zero-dependency crate for fast number generation, with a focus on ease of use (no more passing &mut rng everywhere!). The implementation is bas

ᎩᎦᎨᎢ (IPA: [gigagei]) is a random quote fetching console utility. Written in Rust.
ᎩᎦᎨᎢ (IPA: [gigagei]) is a random quote fetching console utility. Written in Rust.

gigagei ᎩᎦᎨᎢ (IPA: [gigagei]) is a random quote fetching console utility. Written in Rust. Installing Use latest pre-built binary from releases Buildi

Display a random Shiba from your terminal whenever you feel the need to. Because why not?
Display a random Shiba from your terminal whenever you feel the need to. Because why not?

Shiba CLI Command-line interface (CLI) to display a random Shiba Inu whenever needed, by just running shiba on your terminal. How To Use • How Does It

File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files.

FTZZ File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files. Installation $ cargo +nightly install

Outputs a random number of 🌈's
Outputs a random number of 🌈's

Rainbows Outputs a random number of 🌈 's. Rust implementation of rainbows. 📦 Installation Install Rust and Cargo Run cargo install rainbows $ rainbo

SubStrings, Slices and Random String Access in Rust

SubStrings, Slices and Random String Access in Rust This is a simple way to do it. Description Rust string processing is kind of hard, because text in

Generate or convert random bytes into passphrases. A Rust port of niceware.

niceware My blog post: Porting Niceware to Rust A Rust port of niceware. Sections of this README have been copied from the original project. This libr

Random music in Annil and stream as a radio station.

anni-radio anni-radio is an audio streaming client for Project Anni. Installation cargo install --git https://github.com/project-anni/radio Dependency

Owner
Haizhi Technologies
Open source projects from Haizhi
Haizhi Technologies
A Bitcoin wallet collider that brute forces random wallet addresses written in Rust.

Plutus-Rustus Bitcoin Brute Forcer A Bitcoin wallet collider that brute forces random wallet addresses written in Rust. This is a straight port of Plu

null 46 Dec 23, 2022
A fast, simple and powerful open-source cross platform utility tool for generating strong, unique and random passwords

password-generator-pro A fast, simple and powerful open-source cross platform utility tool for generating strong, unique and random passwords. Feature

Sebastien Rousseau 3 Dec 16, 2022
Custom Ethereum vanity address generator made in Rust

ethaddrgen Custom Ethereum address generator Get a shiny ethereum address and stand out from the crowd! Disclaimer: Do not use the private key shown i

Jakub Hlusička 153 Dec 27, 2022
secret folders generator to hide hentais in your computer

hentai dream 95 secret folders generator to hide hentais in your computer, but its really old way as **** used techniquee one injection technique from

jumango pussu 7 Jul 8, 2021
A fully-featured lexer generator, implement as a proc macro

lexgen: A fully-featured lexer generator, implemented as a proc macro lexer! { // First line specifies name of the lexer and the token type return

Ömer Sinan Ağacan 43 Nov 19, 2022
Substrate Node Template Generator

Substrate Node Template Generator A tool to generate stand-alone node templates of a customized Substrate clients used in "Substrate Library Extension

Parity Technologies 2 Feb 11, 2022
A lightning-fast password generator and manager written in Rust

Passlane A lightning-fast password manager for the command line Features Generate passwords Place the generated password into the clipboard Save previ

Anssi Piirainen 4 Dec 15, 2022
Project generator written in Rust :crab:

C.R.S. Create a new project from a template Why another project generator ? It's inspired of cookiecutter (#20). It's written in rust for safety and r

0xMRTT 3 Nov 11, 2022
Binding generator for EVM and ink!

Sumi is a binding generator specifically designed for Astar Network ecosystem with XVM in mind. It takes EVM metadata and converts it to an ink! modul

Dmitry 4 Dec 15, 2022
A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap

rucksack A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap Features Password gene

null 6 Jan 18, 2023