def execute_script():
    print("validated input",
          ocel.validate("../logs/minimal.jsonocel", "../schemas/schema.json"))
    log = ocel.import_log("../logs/minimal.jsonocel")
    ocel.export_log(log, "log1.xmlocel")
    print("validated output",
          ocel.validate("log1.xmlocel", "../schemas/schema.xml"))
    ocel.import_log("log1.xmlocel")
Exemplo n.º 2
0
def execute_script():
    client = MongoClient(CONNECTION_STRING)
    db = client[DATABASE_NAME]
    log = mongodb_importer.apply(db)

    aa = time.time_ns()
    ocel.export_log(log, "prova.jsonocel")
    bb = time.time_ns()
    print("\nTOTAL TIME: ",(bb-aa)/10**9)
Exemplo n.º 3
0
print(str(len(rdf_objects)))
i = 0
for obj, y, z in rdf_objects:
    print("Object: " + str(obj))
    print(str(i) + "/" + str(len(rdf_objects)))
    i += 1
    if (str(obj) not in ocel_log['ocel:objects'].keys()):
        ocel_log['ocel:objects'][str(obj)] = {
            'ocel:type': ocel_log['ocel:global-object']['type'],
            'ocel:ovmap': {}
        }
    if (type(z) == rdflib.Literal):
        #attribute
        ocel_log['ocel:objects'][str(obj)]['ocel:ovmap'][str(y)] = str(z)
        if (str(y) not in ocel_log['ocel:global-log']['ocel:attribute-names']):
            ocel_log['ocel:global-log']['ocel:attribute-names'].append(str(y))
    elif (type(z) == rdflib.URIRef):
        #relation to other object
        #keep as attribute just in case
        #TODO: rework
        ocel_log['ocel:objects'][str(obj)]['ocel:ovmap'][str(y)] = str(z)
        if (str(y) not in ocel_log['ocel:global-log']['ocel:attribute-names']):
            ocel_log['ocel:global-log']['ocel:attribute-names'].append(str(y))
    else:
        #???
        pass

ocel.export_log(ocel_log, filename + ".xmlocel")
print("Validation successful: " +
      str(ocel.validate(filename + ".xmlocel", schema)))