예제 #1
0
except:
    pass

times = []
directory = 'wordnet_chunks'
for f in os.listdir(directory):
    filename = f'{directory}/{f}'
    ttl_file = open(filename)
    contents = ttl_file.read()
    ttl_file.close()
    before = time.time()
    print(f"Loading WordNet in chunks ({f})")
    client.insert_triples("instance", "main", contents,
                          f"Adding WordNet in chunks ({f})")
    after = time.time()
    total = (after - before)
    times.append(total)
    print(f"Update took {total} seconds")

print(f"Squashing main")
before = time.time()
client.checkout("main")
result = client.squash('Squash commit of properties and types')
after = time.time()
total = (after - before)
print(f"Squash took {total} seconds")

commit = result['api:commit']
print(f"Branch reset to {commit}")
client.reset(commit)
client = WOQLClient(server_url)
client.remote_auth({"type": "basic", "user": user, "key": key})
client.connect(user=user, account=account, key=key, db=new_db)
client.branch("types")
client.checkout("types")
client.pull({"remote": "origin", "remote_branch": "types"})

client.branch("properties")
client.checkout("properties")
client.pull({"remote": "origin", "remote_branch": "properties"})

client.checkout('main')
# Rebase valid data to schema branch
client.rebase({
    "rebase_from": f'{user}/{new_db}/local/branch/types',
    "author": user,
    "message": "Merging types into main"
})

client.checkout('main')
# # Rebase valid data to schema branch
client.rebase({
    "rebase_from": f'{user}/{new_db}/local/branch/properties',
    "author": user,
    "message": "Merging types into main"
})

result = client.squash('Squash commit of properties and types')
client.checkout('main')
client.reset(result['api:commit'])