diff options
| -rw-r--r-- | src/org/semanticweb/simpleETL/SimpleETL.java | 34 | ||||
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/reasoner/light/RDFoxQueryEngine.java | 3 | ||||
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java | 6 |
3 files changed, 26 insertions, 17 deletions
diff --git a/src/org/semanticweb/simpleETL/SimpleETL.java b/src/org/semanticweb/simpleETL/SimpleETL.java index 4d4a193..8dcd87a 100644 --- a/src/org/semanticweb/simpleETL/SimpleETL.java +++ b/src/org/semanticweb/simpleETL/SimpleETL.java | |||
| @@ -42,25 +42,31 @@ public class SimpleETL { | |||
| 42 | // RDFParser parser = new TurtleParser(); | 42 | // RDFParser parser = new TurtleParser(); |
| 43 | RDFParser parser = new RDFXMLParser(); | 43 | RDFParser parser = new RDFXMLParser(); |
| 44 | 44 | ||
| 45 | RDFWriter writer = new TurtleWriter(new FileOutputStream(m_fileToExport)); | 45 | FileOutputStream fos = new FileOutputStream(m_fileToExport); |
| 46 | try { | ||
| 47 | RDFWriter writer = new TurtleWriter(fos); | ||
| 46 | 48 | ||
| 47 | // String m_fileToExport = m_fileToImport.replace(".owl", ".ntriple"); | 49 | // String m_fileToExport = m_fileToImport.replace(".owl", ".ntriple"); |
| 48 | // RDFWriter writer = new NTriplesWriter(new FileOutputStream(m_fileToExport)); | 50 | // RDFWriter writer = new NTriplesWriter(new FileOutputStream(m_fileToExport)); |
| 49 | 51 | ||
| 50 | RDFHandlerWriter multiHandler = new RDFHandlerWriter(writer); | 52 | RDFHandlerWriter multiHandler = new RDFHandlerWriter(writer); |
| 51 | parser.setRDFHandler(multiHandler); | 53 | parser.setRDFHandler(multiHandler); |
| 52 | File fileToImport = new File(m_fileToImport); | 54 | File fileToImport = new File(m_fileToImport); |
| 53 | if(fileToImport.isDirectory()) { | 55 | if(fileToImport.isDirectory()) { |
| 54 | for(File file : fileToImport.listFiles()) { | 56 | for(File file : fileToImport.listFiles()) { |
| 55 | if(file.isFile() && (Pattern.matches(".*.owl", file.getName()) || Pattern.matches(".*.rdf", file.getName()))) { | 57 | if(file.isFile() && (Pattern.matches(".*.owl", file.getName()) || Pattern.matches(".*.rdf", file.getName()))) { |
| 56 | Utility.logDebug("Parsing " + file.getName()); | 58 | Utility.logDebug("Parsing " + file.getName()); |
| 57 | parser.parse(new FileInputStream(file), m_prefix); | 59 | parser.parse(new FileInputStream(file), m_prefix); |
| 60 | } | ||
| 58 | } | 61 | } |
| 59 | } | 62 | } |
| 63 | else | ||
| 64 | parser.parse(new FileInputStream(fileToImport), m_prefix); | ||
| 65 | writer.endRDF(); | ||
| 66 | } | ||
| 67 | finally { | ||
| 68 | fos.close(); | ||
| 60 | } | 69 | } |
| 61 | else | ||
| 62 | parser.parse(new FileInputStream(fileToImport), m_prefix); | ||
| 63 | writer.endRDF(); | ||
| 64 | Utility.logInfo("SimpleETL rewriting DONE", | 70 | Utility.logInfo("SimpleETL rewriting DONE", |
| 65 | "additional ontology data is saved in " + m_fileToExport + "."); | 71 | "additional ontology data is saved in " + m_fileToExport + "."); |
| 66 | } | 72 | } |
diff --git a/src/uk/ac/ox/cs/pagoda/reasoner/light/RDFoxQueryEngine.java b/src/uk/ac/ox/cs/pagoda/reasoner/light/RDFoxQueryEngine.java index 30771ab..70d0cc9 100644 --- a/src/uk/ac/ox/cs/pagoda/reasoner/light/RDFoxQueryEngine.java +++ b/src/uk/ac/ox/cs/pagoda/reasoner/light/RDFoxQueryEngine.java | |||
| @@ -36,8 +36,9 @@ public abstract class RDFoxQueryEngine implements QueryEngine { | |||
| 36 | DataStore store = getDataStore(); | 36 | DataStore store = getDataStore(); |
| 37 | try { | 37 | try { |
| 38 | long oldTripleCount = store.getTriplesCount(), tripleCount; | 38 | long oldTripleCount = store.getTriplesCount(), tripleCount; |
| 39 | for (String file: importedFile.split(QueryReasoner.ImportDataFileSeparator)) | 39 | for (String file: importedFile.split(QueryReasoner.ImportDataFileSeparator)) { |
| 40 | store.importTurtleFile(new File(file), prefixes); | 40 | store.importTurtleFile(new File(file), prefixes); |
| 41 | } | ||
| 41 | tripleCount = store.getTriplesCount(); | 42 | tripleCount = store.getTriplesCount(); |
| 42 | Utility.logDebug(name + " store after importing " + fileName + ": " + tripleCount + " (" + (tripleCount - oldTripleCount) + " new)"); | 43 | Utility.logDebug(name + " store after importing " + fileName + ": " + tripleCount + " (" + (tripleCount - oldTripleCount) + " new)"); |
| 43 | store.clearRulesAndMakeFactsExplicit(); | 44 | store.clearRulesAndMakeFactsExplicit(); |
diff --git a/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java b/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java index e040c18..d754a70 100644 --- a/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java +++ b/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java | |||
| @@ -107,8 +107,10 @@ public class PagodaTester { | |||
| 107 | // args = new String[] {npd_tbox, npd_abox, npd_query}; | 107 | // args = new String[] {npd_tbox, npd_abox, npd_query}; |
| 108 | // args = new String[] {npd_bench_tbox, npd_bench_abox, npd_bench_query}; | 108 | // args = new String[] {npd_bench_tbox, npd_bench_abox, npd_bench_query}; |
| 109 | // args = new String[] {"../SemFacet/WebContent/WEB-INF/data/dbpedia.owl", "../SemFacet/WebContent/WEB-INF/data/dbpediaA.nt", null}; | 109 | // args = new String[] {"../SemFacet/WebContent/WEB-INF/data/dbpedia.owl", "../SemFacet/WebContent/WEB-INF/data/dbpediaA.nt", null}; |
| 110 | // args = new String[] {"../SemFacet/WebContent/WEB-INF/data/isg.owl", "../SemFacet/WebContent/WEB-INF/data/isg.nt", null}; | 110 | // args = new String[] {"../core/WebContent/WEB-INF/data/fly.owl", "../core/WebContent/WEB-INF/data/fly-data.nt", null}; |
| 111 | args = new String[] {"..\\core\\WebContent\\WEB-INF\\data\\fly.owl", "..\\core\\WebContent\\WEB-INF\\data\\fly-data.nt", null}; | 111 | // args = new String[] {"data/lubm/univ-bench.owl", "data/lubm/lubm1.ttl", "data/lubm/lubm.sparql", "lubm.ans"}; |
| 112 | args = new String[] {"data/uobm/univ-bench-dl.owl", "data/uobm/uobm1.ttl", "data/uobm/uobm.sparql", "uobm.ans"}; | ||
| 113 | // args = new String[] {"data/fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", "data/fly/fly.sparql", "fly.ans"}; | ||
| 112 | // args = new String[] {bioModels_tbox, bioModels_abox, bioModels_queries}; | 114 | // args = new String[] {bioModels_tbox, bioModels_abox, bioModels_queries}; |
| 113 | // args = new String[] {chembl_tbox, chembl_abox, chembl_queries}; | 115 | // args = new String[] {chembl_tbox, chembl_abox, chembl_queries}; |
| 114 | // args = new String[] {reactome_tbox, reactome_abox, reactome_queries}; | 116 | // args = new String[] {reactome_tbox, reactome_abox, reactome_queries}; |
