shaynlink / node-mongo-concept-network

Concept Network is weighted directed graph, in which activation values are propagated. This version uses MongoDb.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mongo-concept-network Build Status NPM version

Mongo Concept Network is weighted directed graph, in which activation values are propagated. Written in Node.js and MongoDb.

Getting Started

You must ensure that mongodb is installed and running (tested with version 2.2.4).

Install the module with: npm install mongo-concept-network

var ConceptNetwork = require('mongo-concept-network').ConceptNetwork;
var ConceptNetworkState = require('mongo-concept-network').ConceptNetworkState;
var cn = new ConceptNetwork();
var cns = new ConceptNetworkState(cn);
cn.addNode("ECTOR", function (node1) {
  cn.addNode("knows", function (node2) {
    cn.addNode("Achille", function (node3) {
      cn.addLink(node1._id, node2._id, function(link1_2) {
        cn.addLink(node2._id, node3._id, function(link2_3) {
          cns.activate(node1._id, function(nodeState) {
            cns.propagate(function() {
              console.log('End');
            });
          }
        }
      }
    }
  }
}

Documentation

This version of Concept Network, on the contrary to the original concept-network, uses directly MongoDb. As MongoDb is asynchronous, I can't keep the API of concept-network. Much refactoring foreseen.

(Coming soon)

Examples

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint, and test your code using mocha.

To lint:

$ npm run jshint

To test:

$ npm test

Release History

2014/?/?: version 0.1.0: First version.

Warning: this is a work in progress.

License

Copyright (c) 2014 François Parmentier
Licensed under the MIT license.

About

Concept Network is weighted directed graph, in which activation values are propagated. This version uses MongoDb.

License:MIT License


Languages

Language:JavaScript 100.0%