- String newName = input.getFileName().toString();
- if (newName.contains("."))
- newName = newName.split("\\.")[0];
- Path parent = input.getParent();
- Path output1 = parent.resolve(newName + ".tg");
- TransferableGraph1 tg = convertExportedSharedOntologyIntoBundleOntology(input, output1);
- String listing = PrettyPrintTG.print(tg, false);
- Path output2 = parent.resolve(newName + ".pgraph");
- Files.write(output2, listing.getBytes(),StandardOpenOption.CREATE);
+ createTGAndPGraph(input, true);
+ }
+
+ public static void createTGAndPGraph(Path input, boolean writePGraph) throws Exception {
+ TransferableGraph1 tg = convertExportedSharedOntologyIntoBundleOntology(input, replaceExtension(input, ".tg"));
+ if (writePGraph) {
+ String listing = PrettyPrintTG.print(tg, false);
+ Files.write(replaceExtension(input, ".pgraph"), listing.getBytes(),StandardOpenOption.CREATE);
+ }