}
}
+
+ public static void createTg(Path input) throws Exception {
+ Path output = input.getParent().resolve("graph.tg");
+ createTg(input, output);
+ }
+
+ private static void createTg(Path input, Path output) throws Exception {
+ convertExportedSharedOntologyIntoBundleOntology(input, output);
+ }
+
+ public static void createTGAndPGraph(Path input) throws Exception {
+ Path output1 = input.getParent().resolve("graph.tg");
+ TransferableGraph1 tg = convertExportedSharedOntologyIntoBundleOntology(input, output1);
+ String listing = PrettyPrintTG.print(tg, false);
+ String newName = input.getFileName().toString();
+ if (newName.contains("."))
+ newName = newName.split("\\.")[0];
+ Path output2 = input.getParent().resolve(newName + ".pgraph");
+ Files.write(output2, listing.getBytes(),StandardOpenOption.CREATE);
+ }
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.out.println("Required arguments: <input .sharedLibrary file> [<output .tg file>]");
} else if (args.length == 1) {
Path input = Paths.get(args[0]);
- Path output1 = input.getParent().resolve("graph.tg");
- TransferableGraph1 tg = convertExportedSharedOntologyIntoBundleOntology(input, output1);
- String listing = PrettyPrintTG.print(tg, false);
- Path output2 = Paths.get(args[0].substring(0, args[0].length() - ".sharedLibrary".length()) + ".pgraph");
- Files.write(output2, listing.getBytes(),StandardOpenOption.CREATE);
+ createTGAndPGraph(input);
} else {
convertExportedSharedOntologyIntoBundleOntology(Paths.get(args[0]), Paths.get(args[1]));
}