Neo4j - get friend list up to the 4th degree - codeigniter

I am working with one application which requires to show a friend list up to the 4th degree. After some research I came to know about one solution i.e. Neo4j.
I didn't get a clear idea from their tutorial, can I connect Neo4j to MySQL, and if not how should I implement that myself? I am currently using the codeigniter framework with MySQL.
Thanks.

neo4j is a database, and mysql is a database. so, this question is largely about connecting databases from different vendors together.
at this time, neo4j and mysql do not support direct connections to each other. you'd typically accomplish your desired task by exporting your data from mysql as CSV files (http://www.mysqltutorial.org/mysql-export-table-to-csv/) and importing to neo4j (http://jexp.de/blog/2014/06/load-csv-into-neo4j-quickly-and-successfully/)
michael hunger, a colleague of mine at neo4j, recently wrote this auto importer. you might want to check it out to make this process much easier:
https://github.com/jexp/neo4j-rdbms-import
before going through this data export/import, you may just want to download neo4j and play with the movie dataset. you can do this in about a minute (https://www.youtube.com/watch?v=om6E-HqtrZ0).
then, there are standalone PHP drivers for Neo4j:
http://neo4j.com/developer/php/
josh addell, the author of Neo4jPHP, has even written a post about how to use codeignitor 2 with his library:
http://blog.everymansoftware.com/2011/08/getting-neo4jphp-working-with.html

Related

Connecting to Oracle DB using Bottle in Python

Dears,
I am making simple web page using Bottle library in Python. And started struggling when i want to connect to Oracle DB and extract data from table for visualization. I see that Bottle has only Sqlite.db connections. Is it possible to connect to Oracle db with integrated Bottle library functionality? Or should i call cx_Oracle each time when a web page link is pressed to get data from database?
This might work for you? https://github.com/bormotov/bottle-oracle. I haven't used it myself but the code in it is simple enough you can develop your own if need be! Hope that helps, anyway.

dataflow output to neo4j using jdbcIO vs java driver

I'm currently working on a setup that uses Google Cloud Dataflow to transform data and save into a Neo4j Database hosted on a Compute Engine VM. The current setup uses a JdbcIO to write to Neo4j by running a prepared statement, but it seems also possible to use a Neo4j driver directly in Java, which allows more flexibility on creating the query dynamically.
I wonder if anyone had compared the 2 approaches and notice any differences? I would guess the Jdbc approach would be more efficient since it only need to run the prepared statement, but that is just my guess.
Update
I'm going to post my findings as I experiment more with the two methods
One difference I found was that when using JdbcIO, I run into a deadlock when multiple transaction is trying to write to the same node at the same time. However that issue did not occur when using Neo4j driver directly.

Ruby: Mongoid Criteria Selector to SQL Query

As part of my bachelor's thesis I'm building a Microservice using Postgres which would in part replace an existing part of an application using MongoDB. Now to change as little as possible at the moment on the client side I was wondering if there was an easy way to translate a Mongoid::Criteria to an SQL query (assuming all fields are named the same, of course), without having to write a complete parser myself. Are there any gems out there that might support this?
Any input is highly appreciated.
Maybe you're looking for this : https://github.com/stripe/mosql.
I don't dig it but it seems to work for what you need :
"MoSQL imports the contents of your MongoDB database cluster into a PostgreSQL instance, using an oplog tailer to keep the SQL mirror live up-to-date. This lets you run production services against a MongoDB database, and then run offline analytics or reporting using the full power of SQL."

How do I do a SQLite to PostgreSQL migration?

I have a problem with migrating my SQLite3 database to PostgreSQL. How and what do I need to do?
I am searching the internet, but find only migrations from MySQL to PostgreSQL.
Can anyone help me?
I need to convert my SQLite database to PostgreSQL database for Heroku cloud hosting.
You don't want to try to do a binary conversion.
Instead, rely on exporting the data, then importing it, or use the query language of both and using selects and inserts.
I HIGHLY recommend you look at Sequel. It's a great ORM, that makes switching between DBMs very easy.
Read through the opening page and you'll get the idea. Follow that by reading through the cheat sheet and the rest of the documentation and you'll quickly see how easy and flexible it is to use.
Read about migrations in Sequel. They're akin to migrations in Rails, and make it very easy to develop a schema and maintain it across various systems.
Sequel makes it easy to open and read the SQLite3 table, and concurrently open a PostgreSQL database and write to it. For instance, this is a slightly modified version of the first two lines of the "cheat sheet":
SQLITE_DB = Sequel.sqlite('my_blog.db')
PGSQL_DB = Sequel.connect('postgres://user:password#localhost/my_db')
Base all your subsequent interactions with either database using SQLITE_DB and PGSQL_DB and you'll be on your way to porting the data.
The author of Sequel is very responsive and is a big fan of PostgreSQL, so the ORM has great integration with all its features.

Is there a way for the Oracle Data Integrator to extract data from MongoDB

I'm trying to move snapshots of data from our MongoDB into our Oracle BI data store.
From the BI team I've been asked to make the data available for ODI, but I haven't been able to find an example of that being done.
Is it possible and what do I need to implement it?
If there is a more generic way of getting MongoDB data into Oracle then I'm happy to propose that as well.
Versions
MongoDB: 2.0.1
ODI: 11.1.1.5
Oracle: 11.2g
Edit:
This is something that will be queried once a day, maybe twice but at this stage the BI report granularity is daily
In ODI, under the Topology tab and Physical Architecture sub-tab, you can see all technologies that are supported out of the box. MongoDB is not one of them. There are also no Knowledge Modules available for importing/exporting from/to MongoDB.
ODI supports implementing your own technologies and your own Knowledge Modules.
This manual will get you started with developing your won Knowledge module, and in one of the other manuals i'm sure you can find an explanation on how to implement your own technologies. (Ctrl-F for "Data integrator")
If you're lucky, you might find someone else who has already implemented it. Your best places to look would be The Oracle Technology Network Forum, or a forum related to MongoDB.
Instead of creating a direct link, you could also take an easier workaround. Export the data from the MongoDB to a format that ODI supports, and MongoDB can extract to. CSV or XML maybe? Then load the data trough ODI into the oracle database. I think... that will be the best option, unless you have to do this frequently...
Look at the blog post below for an option;
https://blogs.oracle.com/dataintegration/entry/odi_mongodb_and_a_java
Cheers
David

Resources