forked from mirkonasato/graphipedia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
import.sh
executable file
·24 lines (19 loc) · 1.01 KB
/
import.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Works as Docker and standalone import script
# For standalone running you need to package with maven first: mvn clean package
# Run with ./import.sh <wikipedia-pages-articles-multistream.xml.bz2> <output-directory>
if [ -z $1 ] && [ -z $2 ];
then
echo "Usage: ./import.sh <wikipedia-pages-articles-multistream.xml.bz2> <output-directory>"
exit 1
else
INPUT_FILE=$1
OUTPUT_DIR=$2
fi
mkdir $OUTPUT_DIR/intermediate
bzip2 -dc $INPUT_FILE | java -classpath ./graphipedia-dataimport/target/graphipedia-dataimport.jar org.graphipedia.dataimport.ExtractLinks \
- $OUTPUT_DIR/intermediate/enwiki-links.xml
java -Xmx3G -classpath ./graphipedia-dataimport/target/graphipedia-dataimport.jar org.graphipedia.dataimport.neo4j.ImportGraph \
$OUTPUT_DIR/intermediate/enwiki-links.xml $OUTPUT_DIR/neo4jdb/databases/neo4j
#This is ugly, but for some reason the new database cannot be read by Neo4j 4.0.2, recreating metadata store on startup fixes the problem
rm -f $OUTPUT_DIR/neo4jdb/databases/neo4j/neostore