https://github.com/parmentf/node-mongo-concept-network
Concept Network is weighted directed graph, in which activation values are propagated. This version uses MongoDb.
https://github.com/parmentf/node-mongo-concept-network
Last synced: 12 months ago
JSON representation
Concept Network is weighted directed graph, in which activation values are propagated. This version uses MongoDb.
- Host: GitHub
- URL: https://github.com/parmentf/node-mongo-concept-network
- Owner: parmentf
- License: mit
- Created: 2014-06-29T09:44:04.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-03-08T17:13:46.000Z (about 8 years ago)
- Last Synced: 2024-04-09T01:30:35.323Z (almost 2 years ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# mongo-concept-network [](http://travis-ci.org/parmentf/node-mongo-concept-network) [](http://badge.fury.io/js/mongo-concept-network)
Mongo Concept Network is weighted directed graph, in which activation values are propagated. Written in [Node.js](http://nodejs.org) 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`
```javascript
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](https://github.com/parmentf/node-concept-network), uses directly MongoDb.
As MongoDb is asynchronous, I can't keep the API of [concept-network](https://github.com/parmentf/node-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](http://mochajs.org/).
To lint:
```bash
$ npm run jshint
```
To test:
```bash
$ 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.