memgraph/tests/public_benchmark/ldbc/index_creation.py
florijan 21550d3bb1 LDBC queries checked
Summary:
- checked existing queries and added new ones
- minor changes to LDBC setup

Reviewers: teon.banek, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D737
2017-09-02 10:36:02 +02:00

28 lines
784 B
Python
Executable File

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from neo4j.v1 import GraphDatabase, basic_auth
# Initialize driver and create session.
port = sys.argv[2] if len(sys.argv) > 2 else '7687'
driver = GraphDatabase.driver('bolt://localhost:%s' % port,
auth=basic_auth('', ''),
encrypted=False)
session = driver.session()
# The fist program argument is path to a file with indexes.
try:
with open(sys.argv[1], "r") as f:
for line in f.readlines():
session.run(line.strip()).consume()
print("%s -> DONE" % line.strip())
print("All indexes were created.")
except:
print("Frist argument is path to a file with indexes.")
# Do the cleanup.
session.close()
driver.close()