<commit_before>#!/bin/bash

while [ $(curl -s -o /dev/null -w "%{http_code}" -i -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" http://localhost:7474/db/data/) -ne 200 ];
do
	echo -n "."
	sleep 2
done

curl -s -o /dev/null -i -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X POST -d '{"statements": [{"statement": "MATCH (n) DETACH DELETE n"}]}' http://localhost:7474/db/data/transaction/commit
curl -s -o /dev/null -i -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X POST -d '{"statements": [{"statement": "CREATE (google:Resource {name: \"www.google.com\", location: \"http://www.google.com\"}),(yahoo:Resource {name: \"www.yahoo.com\", location: \"http://www.yahoo.com\"}),(espn:Resource {name: \"espn.go.com\", location: \"http://espn.go.com\"}),(cnn:Resource {name: \"www.cnn.com\", location: \"http://www.cnn.com\"}),(news:Tag {name: \"news\"}),(sports:Tag {name: \"sports\"}),(search:Tag {name: \"search\"}),(google)-[:TAGGED]->(search),(yahoo)-[:TAGGED]->(search),(yahoo)-[:TAGGED]->(news),(cnn)-[:TAGGED]->(news),(espn)-[:TAGGED]->(sports),(espn)-[:TAGGED]->(news)"}]}' http://localhost:7474/db/data/transaction/commit<commit_msg>Minor improvements to seeding data<commit_after>#!/bin/bash

echo -n "Connecting to databse "
while [ $(curl -s -o /dev/null -w "%{http_code}" -i -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" http://localhost:7474/db/data/) -ne 200 ];
do
	echo -n "."
	sleep 2
done
echo " connected"

echo -n "Removing data ... "
curl -s -o /dev/null -i -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X POST -d '{"statements": [{"statement": "MATCH (n) DETACH DELETE n"}]}' http://localhost:7474/db/data/transaction/commit
echo "done"

echo -n "Populating data ... "
curl -s -o /dev/null -i -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X POST -d '{"statements": [{"statement": "CREATE (google:Resource {name: \"www.google.com\", location: \"http://www.google.com\"}),(yahoo:Resource {name: \"www.yahoo.com\", location: \"http://www.yahoo.com\"}),(espn:Resource {name: \"espn.go.com\", location: \"http://espn.go.com\"}),(cnn:Resource {name: \"www.cnn.com\", location: \"http://www.cnn.com\"}),(news:Topic {name: \"news\"}),(sports:Topic {name: \"sports\"}),(search:Topic {name: \"search\"}),(google)-[:TAGGED]->(search),(yahoo)-[:TAGGED]->(search),(yahoo)-[:TAGGED]->(news),(cnn)-[:TAGGED]->(news),(espn)-[:TAGGED]->(sports),(espn)-[:TAGGED]->(news)"}]}' http://localhost:7474/db/data/transaction/commit
echo "done"
{'fraction_non_alphanumeric': 0.2618058179070646, 'fraction_numerical': 0.014355874574990555, 'mean_word_length': 4.6581196581196584, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3336021', 'n_tokens_mistral': 1027, 'n_tokens_neox': 956, 'n_words': 202}