예제 #1
0
    "scm:owner", "mike").property("scm:balance",
                                  123)).execute(client, "Add mike")

# Switch back to the schemaless branch
client.checkout('schemaless')

# Add *valid* data
WQ().woql_and(WQ().insert("doc:jim", "scm:BankAccount").property(
    "owner", "jim").property("balance", 8)).execute(client, "Adding Jim")

# Switch back to main for a rebase
client.checkout('main')
# Rebase valid data to schema branch
client.rebase({
    "rebase_from": f'{user}/{db}/{repository}/branch/schemaless',
    "author": user,
    "message": "Merging jim into schema branch"
})

# Add invalid data to schemaless
client.checkout('schemaless')
WQ().woql_and(WQ().insert("doc:joker", "scm:BankAccount").property(
    "owner", "joker").property("elephants",
                               8)).execute(client, "Adding the joker")

# Try (and fail) with another rebase
client.checkout('main')
try:
    client.rebase({
        "rebase_from": f'{user}/{db}/{repository}/branch/schemaless',
        "author": user,
예제 #2
0
        # start the chunk work
        before = time.time()
        client.insert_triples("instance", "main", contents,
                              f"Adding {branch} in 200k chunk ({f})")
        after = time.time()

        total = (after - before)
        print(f"Update took {total} seconds")

for branch in branches:
    print(f"Rebasing {branch}")
    client.checkout('main')
    before = time.time()
    client.rebase({
        "rebase_from": f'{user}/{db}/local/branch/{branch}',
        "author": user,
        "message": f"Merging {branch} into main"
    })
    after = time.time()
    total = (after - before)
    print(f"Rebase took {total} seconds")

print(f"Squashing main")
before = time.time()
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}")
예제 #3
0
                        'volume' : volume }
                if len(objects) >= chunk_size:
                    print(f"Running chunk {chunk}")
                    client.insert_document(objects,commit_msg = f"Inserting stock exchange ticker chunk {chunk}")
                    objects = []
                    chunk+=1
                else:
                    objects.append(obj)

        if not (objects == []):
            client.insert_document(objects,commit_msg = "Adding initial schema")

load_file('indexData.csv')

branch = "second"
client.create_branch(branch)
client.branch = branch

load_file('other.csv')

print("About to rebase")
client.branch = "main"
client.rebase(f"{team}/{db}/local/branch/second")
print("About to query")

client.optimize(f"{team}/{db}")
documents = client.query_document({'@type' : 'IndexRecord',
                                   'date' : '2021-07-01'})

print(list(documents))
예제 #4
0
    client.insert_triples("instance", "main", contents,
                          f"Adding types in 100k chunk ({f})")
    after = time.time()

    total = (after - before)
    times.append(total)
    print(f"Update took {total} seconds")
print(times)
report_total(times)

print("Rebasing instance properties")
client.checkout('main')
before = time.time()
client.rebase({
    "rebase_from": f'{user}/{db}/local/branch/literal_properties',
    "author": user,
    "message": "Merging instance properties into main"
})
after = time.time()
total = (after - before)
print(f"Rebase took {total} seconds")
report_total([total])

print("Rebasing object properties")
client.checkout('main')
before = time.time()
client.rebase({
    "rebase_from": f'{user}/{db}/local/branch/object_properties',
    "author": user,
    "message": "Merging object properties into main"
})
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'])