Git Product home page Git Product logo

mgnlq_model's Introduction

mgnlq_model Build StatusCoverage Status

model load and processing code

this will be slowly migrated to anychronous processing, separating the processes:

  1. metamodel building
  2. model index building for processing access
  3. rule index building
  4. data loading and validation

for a nested document

{$match:{"bar.text":"Hi"}}, {$unwind:"$bar"}, {$match:{"bar.text":"Hi"}}, {$group:{"_id":"$_id","bars":{$push:"$bar"}}}

Database used for testing containing data

(set up via node js/makedb.js or npm load_data ) mongodb://localhost/testdb'

Creating a database

via

node js/makedb.js

or

npm run load_testdb

to load the testdb2, use project mgnql_testmodel2 and npm run load_testdb2

a mongo db instance is created, The name of the DB and the source data is controlled via the environment parameters:

var mongoConnectionString = process.env.MONGO_DBURL || 'mongodb://localhost/testdb'; var modelPath = process.env.MGNLQ_MODELPATH || 'node_modules/mgnlq_testmodel/testmodel/';

recording the test queries

SET MONGO_TEST_RECORD=RECORD

run the tests -> data is created in node_modules/mgnql_testmodel_replay/mgrecrep/data

(typcially linked with npm link mgnlq_testmodel_replay ) This data must be checked in, the package version increased and published, subsequently the dependency has to be updated to allow running unit tests on travis etc.

Testing

The unit test use mongoose_record_replay and data in (npm module) mgnlq_testmodel_replay to be run without a mongoose instance.

Alternatively, by setting MONGO_TEST_RECORD='RECORD' Unit tests can be run against a mongodb installed on

'mongodb://localhost/testdb';

var mode = 'REPLAY';
if (process.env.MONGO_TEST_RECORD) {
  mode = 'RECORD';
}
var mongoose = require('mongoose_record_replay').instrumentMongoose(require('mongoose'),
  'node_modules/mgnlq_testmodel_replay/mgrecrep/',
  mode);

This DB must be filled with data, see

  nmp run load_data

to create the db from files

Cache file control

Model data is written and read from a cache file in modelPath unless MQNLQ_MODEL_NO_FILECACHE is set to true

TODO

  • Analyze model for mismatches in category aliases
 e.g.   DomainA   element name  synonyms: [  "element names", "elementname"]
        DomainB   element name  synonyms:[ "elements" ]

When this occurs a mismatch "elements" will match only DomainB,

  • Analyze model for casing mismatches, e.g.

abc => Abc abc => abc

test migration from nodenunit to jest

npm i -g jscodeshift
jscodeshift   --print -d 

mgnlq_model's People

Contributors

jfseb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.