jimbobhickville / node-gedcom-graph

Node.js project to parse a gedcom file and generate a graph database with the contents. Currently targeting neo4j only.
MIT License
17 stars 3 forks source link

How to execute it #1

Open lousan92 opened 9 years ago

lousan92 commented 9 years ago

Hi, I'm doing a project at college which also leads with converting a GEDCOM file into a Neo4j database format, and I'm interested in your work... How can I execute this program? I'm not an expert in JS. Thank you in advance!

michaelosthege commented 7 years ago

I managed to run it and this is a dump of my notes - which commands I ran... The installation experience of both nodejs and neo4j on a fresh Ubuntu is an absolute nightmare.

# install JDK 8
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

# install neo4j
sudo wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
sudo apt-get install neo4j

# install nodejs
sudo apt-get purge node
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
sudo apt-get install npm
npm install fs-extra
#npm cache clean -f
#sudo npm install -g n
#sudo n stable
sudo ln /usr/bin/nodejs /usr/sbin/node
node --version

# the actual program requires all of these...
npm install gedcom-stream
npm install fs-extra
npm install log4js
npm install moment
npm install fast-csv
npm install nomnom
sudo node index.js -s ~/MyFamily.ged -d /var/lib/neo4j/data/databases/graph.db

Also apply https://stackoverflow.com/a/23842055/4473230 if neo4j complains about the max open files limit.

neo4j also complained about permissions to write its own .pid file. I couldn't get it to run without sudo. Same for the nodejs app which also complained about permissions. At some point it magically worked and I don't really know why. I then proceeded to copy the MyFamily.db folder to my Windows and use it with the neo4j on Windows. To my surprise that worked. In the end all umlauts (I'm German) got messed up in the import, so I will try to write some Python to parse the GEDCOM myself and push it to neo4j.

curtisdelicata commented 6 years ago

I am also working on a genealogy project. Thank you for the example.

I had to modify the logger code to work with the latest version of log4js. It is on my fork and I can send a pull request.

The latest gedcom-stream did not work, I had to manually use the index.js from jimbobhickville/gedcom-stream. I had an error on matching data before changing to the older version.

I managed to import a 15mb gedcom into the database. I also had the pid error. I manually created /var/run/neo4j and it worked the second time.

Has anyone been working on a front end?

j-Cis commented 5 years ago

Dear Sirs: @jimbobhickville , @michaelosthege , @curtisdelicata .

I wanted to test GEDCOM's cooperation with NEO4J, although I get a few mistakes.😵 Would they help me solve these problems?

I used both the version about "06c37fc commits on 22 Sep 2015" (master) and the version including "patches" (#2 on 10 Dec 2017) from by @curtisdelicata .

1. In the original version I get this error:

PS G:\node-gedcom-neo4j> node index.js -s gedcom.ged -d C:\neo4j\data\databases\graph.db -b C:\neo4j\bin
G:\node-gedcom-neo4j\node_modules\log4js\lib\configuration.js:25
      throw new Error(`Problem with log4js configuration: (${util.inspect(config, { depth: 5 })})` +
      ^

Error: Problem with log4js configuration: ({ appenders: [ { type: 'console' } ], replaceConsole: true }) - must have a property "appenders" of type object.
    at tests.forEach (G:\node-gedcom-neo4j\node_modules\log4js\lib\configuration.js:25:13)
    at Array.forEach (<anonymous>)
    at Object.throwExceptionIf (G:\node-gedcom-neo4j\node_modules\log4js\lib\configuration.js:23:9)
    at configuration.addListener (G:\node-gedcom-neo4j\node_modules\log4js\lib\appenders\index.js:80:17)
    at listeners.forEach.listener (G:\node-gedcom-neo4j\node_modules\log4js\lib\configuration.js:36:33)
    at Array.forEach (<anonymous>)
    at Object.configure (G:\node-gedcom-neo4j\node_modules\log4js\lib\configuration.js:36:13)
    at Object.configure (G:\node-gedcom-neo4j\node_modules\log4js\lib\log4js.js:62:17)
    at Object.<anonymous> (G:\node-gedcom-neo4j\index.js:48:8)
    at Module._compile (internal/modules/cjs/loader.js:722:30)

2. In the changed version I get this error:

PS G:\node-gedcom-neo4j> node index.js -s gedcom.ged -d C:\neo4j\data\databases\graph.db -b C:\neo4j\bin
G:\node-gedcom-neo4j\node_modules\gedcom-stream\index.js:81
  if (data[0].match(/@.*@/)) {
              ^

TypeError: Cannot read property 'match' of undefined
    at Gedcom._preprocessLine (G:\node-gedcom-neo4j\node_modules\gedcom-stream\index.js:81:15)
    at Array.map (<anonymous>)
    at Gedcom._preprocessLines (G:\node-gedcom-neo4j\node_modules\gedcom-stream\index.js:66:29)
    at Gedcom._process (G:\node-gedcom-neo4j\node_modules\gedcom-stream\index.js:48:8)
    at Gedcom.write (G:\node-gedcom-neo4j\node_modules\gedcom-stream\index.js:20:8)
    at ReadStream.ondata (_stream_readable.js:670:20)
    at ReadStream.emit (events.js:182:13)
    at addChunk (_stream_readable.js:287:12)
    at readableAddChunk (_stream_readable.js:268:11)
    at ReadStream.Readable.push (_stream_readable.js:223:10)

Versions of my environment:

Windows Pro 10 x64
neo4j community v3.5.1 windows
node.js v11.3.0
npm 6.4.1
fast-csv 2.4.1
fs-extra 7.0.1
gedcom-stream 1.0.1
log4js 3.0.6
moment 2.23.0
nomnom 1.8.1

Gedcom has 16 thousand people, and was generated by MyHeritage Family Tree Builder 8.0.0.8495 (GEDCOM 5.5.1 LINEAGE-LINKED UTF-8)


I would be most grateful if you would look into this matter as soon as possible. Yours sincerely, J.R. Cisowski.

michaelosthege commented 5 years ago

I can't help you with these errors. In the end I ditched the nodejs-based app and went with Python. I can't find my source code of that right now, but somehow I managed to read GEDCOM files into a igraph. From there it can surely be fed into neo4j.