Skip to content
Snippets Groups Projects
Commit 1c885324 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Added option for naming generated ontology

parent 8375b52d
No related branches found
No related tags found
No related merge requests found
......@@ -13,8 +13,15 @@ import java.io.*;
public class GenOntology extends Parser {
public static void main(String args[]) {
Start ast = null;
String outfile = null;
int i=0;
for (i=0; i<args.length; i++) {
if (args[i].equals("-o")) {
outfile = args[++i];
}
}
try {
Reader r = new FileReader(args[0]);
Reader r = new FileReader(args[args.length-1]);
SiarasParser parser = new SiarasParser(r);
ast = parser.Start();
......@@ -24,16 +31,16 @@ public class GenOntology extends Parser {
catch (FileNotFoundException e) {
System.err.println("file " + args[0] + " not found");
}
String fileName = null;
try {
// Generate OWL ontology, possibly transformed from Owl
// Full to OWL DL
fileName = "ontology.owl";
PrintStream pStream = new PrintStream(new File(fileName));
if (outfile == null) {
outfile = "ontology.owl";
}
PrintStream pStream = new PrintStream(new File(outfile));
ast.genOntology("",pStream);
} catch (java.io.FileNotFoundException e) {
System.out.println("Could not create file: "+fileName);
System.out.println("Could not create file: "+outfile);
e.printStackTrace();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment