<commit_before>tinkergraph-js
==============

A pure JavaScript implementation of TinkerPop's TinkerGraph in-memory graph database

This library is a work in progress. It requires an external dependency (gulthor/gremlin-core-js) which is not yet published to npm.


## Features

Most TinkerGraph features should be working:
* `g.addVertex('key1', 'value1', 'key2', 'value2');` or `g.addVertex({ key: 'value' })`
* vertex.addEdge('label', vertex, { key: 'value' });

## Integration with Gremlin

### Steps

#### Working steps:
* g.V() - does not accept filters yet

#### Actively developed
* g.V().out()
* g.V().in()
* g.V().both()
* ...

### Traversal

* traversal.forEach()<commit_msg>Add info on latest supported steps in Readme<commit_after>tinkergraph-js
==============

A pure JavaScript implementation of TinkerGraph in-memory graph database from [TinkerPop3 framework](https://github.com/tinkerpop3) that works in Node.js and in the browser (soon).

This library is a work in progress and is not yet published on npm. It requires an external dependency (https://github.com/gulthor/gremlin-core-js) listed in the `package.json` file.

Both libraries will be published as v3.0.0 on npm once TinkerPop3 final version is released and all features are ported. They'll then track all subsequent releases.

## Install

```
$ npm install gulthor/tinkergraph-js -S
```

Run tests with:

```
$ gulp test
```

## Usage

The library is a 1:1 port of TinkerGraph. Please refer to [Gremlin docs](http://gremlindocs.com/) for a complete guide on using steps.

## Features

TinkerGraph structure features are tested and working. Features related to setting ids on creation are still work in progress.

### Graph structure

#### Adding a vertex
* `g.addVertex('key1', 'value1', 'key2', 'value2');`
* `g.addVertex({ key: 'value', key2: 'value2' });` (alternatively, JS only)

#### Adding an edge
* `vertex.addEdge('label', vertex, { key: 'value' });`

### Gremlin steps

#### Working steps
* V - does not accept filters yet

Vertex steps (accept 0, 1 or n String label paremeters):
* out / outE
* in / inE
* both / bothE

#### Being developed
* outV
* inV
* bothV
* E
* path
* map
* groupBy
* groupCount
* sideEffect
* ...

### Traversal methods

* `traversal.forEach(callback)` (working)
* `traversal.next()`
* ...

{'fraction_non_alphanumeric': 0.14490238611713666, 'fraction_numerical': 0.008676789587852495, 'mean_word_length': 4.325635103926097, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3561455', 'n_tokens_mistral': 759, 'n_tokens_neox': 709, 'n_words': 265}