hharnisc / python-meteor

A meteor client for python
MIT License
157 stars 27 forks source link

[new feature] Integration with ostrio-Neo4jreactivity #16

Closed wuxianliang closed 9 years ago

wuxianliang commented 9 years ago

Dear @hharnisc @ppettit and @dr-dimitru

I am trying to use Python-Meteor and ostrio-Neo4jreactivity for the power of Gensim / NLTK and the reactivity of Neo4j in the following way which met problems

Front End ---- call Meteor.method in .py ----> DDP client.call Neo4j.method ----> Neo4j ----> Front End

Meteor.methods({
    callPy: function(){
        var childProcess = Meteor.npmRequire("child_process");
        var Fiber = Meteor.npmRequire("fibers");
        new Fiber(function() {
            var file_path = "~/Meteor-Leaderboard-Neo4j/nlp.py";
            childProcess.exec("python " + file_path, function(error, stdout, stderr) {
                if (error) console.log(error);
                if (stdout) console.log(stdout);
                if (stderr) console.log(stderr);
            });
    }
})

Meteor.neo4j.methods({
    save: function(paramters){
       return 'CREATE (*** Cypher stuff with paramters ***)';
    }    
})
import gensim nltk

*** nlp stuff ***

parameters = ['a','b','c']

from MeteorClient import MeteorClient

*** thins I do not understand clearly ***

client.call('save', parameters)

Problem One: Is this the correct way to use parameters in .call? Problem Two: How to modify Python-Meteor to support calling Meteor.neo4j.methods? Problem Three: Is this a robust way to keep the power of NLP packages and reactivity of Neo4j at the same time? Is it worth to do it?

Thank you all sincerely!

ppettit commented 9 years ago

hi @wuxianliang,

i don't know anything about neo4j but see my answer in #15 with regard to method calls.

thanks,

paul.

hharnisc commented 9 years ago

Sounds like an interesting project, not familiar with the ostrio-Neo4jreactivity methods differ from Meteor methods. This sounds like a good question for meteor-talk. But see #15 for a couple examples on how to make calls from python-meteor