Commit 4da4e90b authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Generate a suitable .repository file to accompany the generated ontology

parent 1c885324
......@@ -15,3 +15,4 @@ testontologies/*.pprj
siaras/ontology.owl
siaras/javadoc
siaras/OntologyCompiler.jar
*.repository
......@@ -18,6 +18,9 @@ public class GenOntology extends Parser {
for (i=0; i<args.length; i++) {
if (args[i].equals("-o")) {
outfile = args[++i];
if (outfile.endsWith(".owl")) {
outfile = outfile.substring(0,outfile.indexOf('.'));
}
}
}
try {
......@@ -35,10 +38,14 @@ public class GenOntology extends Parser {
// Generate OWL ontology, possibly transformed from Owl
// Full to OWL DL
if (outfile == null) {
outfile = "ontology.owl";
outfile = "ontology";
}
PrintStream pStream = new PrintStream(new File(outfile));
PrintStream pStream = new PrintStream(new File(outfile+".owl"));
ast.genOntology("",pStream);
// have to create a matching repository file, otherwise
// Protege will complain severely.
pStream = new PrintStream(new File(outfile+".repository"));
pStream.println("[Dublin Core DL Redirect]");
} catch (java.io.FileNotFoundException e) {
System.out.println("Could not create file: "+outfile);
e.printStackTrace();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment