From eb5908491a18c3df1b89577567d505a61a97e9de Mon Sep 17 00:00:00 2001 From: lbozzato Date: Sat, 9 Apr 2016 04:00:53 +0200 Subject: [PATCH] Updates to Readme and interface. --- README.txt | 5 ----- examples/just-atomic-out.n3 | 8 ++++---- .../java/eu/fbk/dkm/aspit/cli/AspitCLI.java | 20 ++++++++++++++----- .../java/eu/fbk/dkm/aspit/kb/KBProgram.java | 2 ++ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/README.txt b/README.txt index 08b1bd8..e2fe29a 100644 --- a/README.txt +++ b/README.txt @@ -38,11 +38,6 @@ Options: - Java runtime version 1.7 (or greater) - Windows, Linux or Mac OS X operating system -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -= DEMO = - -Please refer to "/demo/DEMO_README.txt" for usage examples. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = KNOWN LIMITATIONS = diff --git a/examples/just-atomic-out.n3 b/examples/just-atomic-out.n3 index 58ef840..afc4ebe 100644 --- a/examples/just-atomic-out.n3 +++ b/examples/just-atomic-out.n3 @@ -96,15 +96,15 @@ . [ rdf:type owl:Axiom ; "\"tt\""^^xsd:string ; - owl:annotatedProperty ; + owl:annotatedTarget ; owl:annotatedSource ; - owl:annotatedTarget + owl:annotatedProperty rdf:type ] . [ rdf:type owl:Axiom ; "\"tt\""^^xsd:string ; - owl:annotatedTarget ; + owl:annotatedProperty ; owl:annotatedSource ; - owl:annotatedProperty rdf:type + owl:annotatedTarget ] . diff --git a/src/main/java/eu/fbk/dkm/aspit/cli/AspitCLI.java b/src/main/java/eu/fbk/dkm/aspit/cli/AspitCLI.java index bb368fb..02ec009 100644 --- a/src/main/java/eu/fbk/dkm/aspit/cli/AspitCLI.java +++ b/src/main/java/eu/fbk/dkm/aspit/cli/AspitCLI.java @@ -2,6 +2,7 @@ import it.unical.mat.wrapper.DLVInvocationException; +import java.io.File; import java.io.IOException; import org.semanticweb.drew.dlprogram.parser.ParseException; @@ -54,6 +55,13 @@ public void go() { printUsage(); System.exit(1); } + + //Check input file existence + File ontofile = new File(inputKB.getOntologyFilename()); + if(!ontofile.exists()){ + System.err.println("[!] Input ontology file does not exists."); + System.exit(1); + } //Load ontology file. try { @@ -65,10 +73,12 @@ public void go() { //Create new program for the input KB. outputKBProgram = new KBProgram(inputKB); - + //Set possibly custom DLV, output file path and lp program if(dlvPath != null) outputKBProgram.setDlvPath(dlvPath); + else + dlvPath = outputKBProgram.getDlvPath(); if(outputKBFilePath != null) inputKB.setOutputFilePath(outputKBFilePath); else @@ -107,7 +117,7 @@ public void go() { } if(verbose) System.out.println("Output KB saved to: " + inputKB.getOutputFilePath() + "\n"); - System.out.println("Asp-it: process complete."); + System.out.println("Asp-it: process completed."); } /** @@ -137,7 +147,7 @@ public String formatFilename(){ public boolean parseArgs(String[] args) { if (args.length == 0) { - System.err.println("Missing argument: "); + System.err.println("[!] Missing argument: "); System.err.println(); return false; } else { @@ -180,9 +190,9 @@ void printUsage() { + // " \n" + // - " OWL file containing the ontology for which IT have to be computed. \n" + " OWL file containing the ontology for which IT have to be computed.\n\n" + // - "Example: aspit input.n3\n" + "Example: asp-it input.n3\n\n" + // "Options:\n" + // diff --git a/src/main/java/eu/fbk/dkm/aspit/kb/KBProgram.java b/src/main/java/eu/fbk/dkm/aspit/kb/KBProgram.java index 04f5c60..28f5fc0 100644 --- a/src/main/java/eu/fbk/dkm/aspit/kb/KBProgram.java +++ b/src/main/java/eu/fbk/dkm/aspit/kb/KBProgram.java @@ -266,7 +266,9 @@ public void handleResult(DLVInvocation paramDLVInvocation, System.err.println("[!] No models for KB program."); } catch (DLVInvocationException | IOException e) { + System.err.println("[!] Cannot execute DLV invocation. Check if DLV executable file exists at path: " + dlvPath + "\n"); e.printStackTrace(); + System.exit(1); } }