Skip to content

LogMap

Run LogMap matcher 4.0 in a jar command.

Credit

See LogMap repository at: https://github.com/ernestojimenezruiz/logmap-matcher.

run_logmap_repair(src_onto_path, tgt_onto_path, mapping_file_path, output_path, max_jvm_memory='10g')

Run the repair module of LogMap with java -jar.

Source code in src/deeponto/align/logmap/__init__.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def run_logmap_repair(
    src_onto_path: str, tgt_onto_path: str, mapping_file_path: str, output_path: str, max_jvm_memory: str = "10g"
):
    """Run the repair module of LogMap with `java -jar`."""

    # find logmap directory
    logmap_path = os.path.dirname(__file__)

    # obtain absolute paths
    src_onto_path = os.path.abspath(src_onto_path)
    tgt_onto_path = os.path.abspath(tgt_onto_path)
    mapping_file_path = os.path.abspath(mapping_file_path)
    output_path = os.path.abspath(output_path)

    # run jar command
    print(f"Run the repair module of LogMap from {logmap_path}.")
    repair_command = (
        f"java -Xms500m -Xmx{max_jvm_memory} -DentityExpansionLimit=100000000 -jar {logmap_path}/logmap-matcher-4.0.jar DEBUGGER "
        + f"file:{src_onto_path} file:{tgt_onto_path} TXT {mapping_file_path}"
        + f" {output_path} false false"
    )
    print(f"The jar command is:\n{repair_command}.")
    run_jar(repair_command)

Last update: February 1, 2023
Created: January 14, 2023
GitHub: @Lawhy   Personal Page: yuanhe.wiki