PHPackages                             neoxygen/neogen - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. neoxygen/neogen

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

neoxygen/neogen
===============

Neo4j Graph generator for PHP5.4+

1.0.8(11y ago)1819911[6 issues](https://github.com/neoxygen/neo4j-neogen/issues)[2 PRs](https://github.com/neoxygen/neo4j-neogen/pulls)MITPHPPHP &gt;=5.4

Since Oct 3Pushed 6y ago6 watchersCompare

[ Source](https://github.com/neoxygen/neo4j-neogen)[ Packagist](https://packagist.org/packages/neoxygen/neogen)[ Docs](http://neoxygen.io)[ RSS](/packages/neoxygen-neogen/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (11)Versions (46)Used By (0)

Neogen
======

[](#neogen)

[![Build Status](https://camo.githubusercontent.com/b013a04a72819e7a11152a1f5ab02e882dcdcf4a40f3877ec07b9a2dccd3b5c5/68747470733a2f2f7472617669732d63692e6f72672f6e656f787967656e2f6e656f346a2d6e656f67656e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/neoxygen/neo4j-neogen)

Graph Generator for Neo4j
-------------------------

[](#graph-generator-for-neo4j)

The library ease the generation of test graphs. The [faker](https://github.com/fzaninotto/faker) library is also used to generate random property values.

You can define your graph model in YAML or in a slightly modified Cypher pattern.

This is in development
----------------------

[](#this-is-in-development)

The library is in its early stage and is targetted to be used in developement environment.

This library is the heart of the popular [Graphgen web application](http://graphgen.neoxygen.io)

Usage
-----

[](#usage)

### Download the library :

[](#download-the-library-)

```
git clone https://github.com/neoxygen/neogen

cd neogen
```

### Define your graph model in YAML :

[](#define-your-graph-model-in-yaml-)

```
connection:
  scheme: http
  host: localhost
  port: 7474

nodes:
  persons:
    label: Person
    count: 50
    properties:
      firstname: firstName
      lastname: lastName

  companies:
    label: Company
    count: 10
    properties:
      name: company
      description: catchPhrase

relationships:
  person_works_for:
    start: persons
    end: companies
    type: WORKS_AT
    mode: n..1

  friendships:
    start: persons
    end: persons
    type: KNOWS
    mode: n..n
```

#### Run the generate command :

[](#run-the-generate-command-)

```
vendor/bin/neogen generate
```

or you may want to export the generation queries to a file, handy for importing it in the Neo4j Console :

```
./vendor/bin/neogen generate --export="myfile.cql"
```

See the results in your graph browser !

#### Quick configuration precisions:

[](#quick-configuration-precisions)

- When defining properties types (like company, firstName, ...), these types refers to the standard [faker](https://github.com/fzaninotto/faker) types.
- count define the number of nodes you want
- relationship mode : 1 for only one existing relationship per node, random for randomized number of relationships

#### Properties parameters

[](#properties-parameters)

Sometimes you'll maybe want to define some parameters for your properties, for e.g. to have a realistic date of birth for `Person` nodes, you may want to be sure that the date will be between 50 years ago and 18 years ago if you set dob for people working for a company.

```
nodes:
  persons:
    label: Person
    count: 10
    properties:
      firstname: firstName
      date_of_birth: { type: "dateTimeBetween", params: ["-50 years", "-18 years"]}

relationships:
    person_works_for:
        start: persons
        end: companies
        type: WORKS_AT
        mode: random
        properties:
            since: { type: "dateTimeBetween", params: ["-10 years", "now"]}
```

### Define your graph model in Cypher :

[](#define-your-graph-model-in-cypher-)

```
//eg:
(person:Person {firstname:firstName, lastname:lastName} *30)-[:KNOWS *n..n]->(person)
(person)-[:WORKS_AT *n..1]->(company:Company {name:company, slogan:catchPhrase} *5)

```

For a complete description, see the [Graphgen documentation](http://graphgen.neoxygen.io/documentation)

Generating the graph from a cypher pattern :

```
./bin/neogen generate-cypher --source="pattern.cypher" --export="export.gen"
```

Or you may want to import the graph directly in an accessible neo4j database :

```
./bin/neogen generate-cypher --source="pattern.cypher" --export-db="localhost:7474"
```

---

Development
-----------

[](#development)

Contributions, feedbacks, requirements welcome. Shoot me by opening issues or PR or on twitter : [@ikwattro](https://twitter.com/ikwattro)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Recently: every ~301 days

Total

32

Last Release

2880d ago

Major Versions

0.5.9 → 1.0.02015-04-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/c66009f0f147bb7dfcfbbd6837176b2fe6c6e2cdcf82d9ad07ab7d7aa47735f4?d=identicon)[ikwattro](/maintainers/ikwattro)

---

Top Contributors

[![ikwattro](https://avatars.githubusercontent.com/u/1222009?v=4)](https://github.com/ikwattro "ikwattro (159 commits)")[![Leward](https://avatars.githubusercontent.com/u/1108235?v=4)](https://github.com/Leward "Leward (3 commits)")

---

Tags

generatorneo4jgraph

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/neoxygen-neogen/health.svg)

```
[![Health](https://phpackages.com/badges/neoxygen-neogen/health.svg)](https://phpackages.com/packages/neoxygen-neogen)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M1.0k](/packages/phpro-grumphp)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M420](/packages/drupal-core-recommended)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
