From 27ca4898e74192228e30292e07459fa412e86fe9 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 21 Nov 2017 17:57:02 +0100 Subject: [PATCH] Using one model for the A and T box --- src/main/java/hsh/ins_jena/App.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/hsh/ins_jena/App.java b/src/main/java/hsh/ins_jena/App.java index 68c036e..0c545ad 100644 --- a/src/main/java/hsh/ins_jena/App.java +++ b/src/main/java/hsh/ins_jena/App.java @@ -24,21 +24,19 @@ public class App { } private static void readAndHandleFiles(String inputPath) { - Model tboxModel = ModelFactory.createDefaultModel(); - Model aboxModel = ModelFactory.createDefaultModel(); + Model model = ModelFactory.createDefaultModel(); InputStream inT, inA; try { inT = new FileInputStream(new File(inputPath + "/" + Generator.T_BOX_FILENAME_XML)); inA = new FileInputStream(new File(inputPath + "/" + Generator.A_BOX_FILENAME_XML)); - tboxModel.read(inT, ""); - aboxModel.read(inA, ""); + model.read(inT, ""); + model.read(inA, ""); } catch (FileNotFoundException e) { e.printStackTrace(); } - System.out.println(tboxModel); - System.out.println(aboxModel); + System.out.println(model); Query query = QueryFactory.create("" + "PREFIX : <" + Generator.OWN_URI + ">" + "" + "SELECT ?console\n" + "WHERE {\n" + " ?console :madeBy :Nintendo .\n" + " ?console :releaseYear ?releaseYear . \n" @@ -47,7 +45,7 @@ public class App { // Query query = QueryFactory // .create("PREFIX : <" + Generator.OWN_URI + ">" + " " + " SELECT ?s ?p ?p WHERE {" + "?s ?p ?o .}"); - QueryExecution queryExec = QueryExecutionFactory.create(query, aboxModel); + QueryExecution queryExec = QueryExecutionFactory.create(query, model); ResultSet rs = queryExec.execSelect();