diff --git a/server/pom.xml b/server/pom.xml index cbc267a..9e5c7eb 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -21,7 +21,7 @@ 2.36 2.6.2 1.10 - 1.3.4 + 1.3.8 0.3m 1.8 4.5.2 diff --git a/server/src/main/java/org/diskproject/server/api/impl/DiskResource.java b/server/src/main/java/org/diskproject/server/api/impl/DiskResource.java index 411fda2..97f773b 100644 --- a/server/src/main/java/org/diskproject/server/api/impl/DiskResource.java +++ b/server/src/main/java/org/diskproject/server/api/impl/DiskResource.java @@ -508,34 +508,34 @@ public Response getOutputData(@JsonProperty("request") ExternalDataRequest r) { return rBuild.build(); } - //@GET - //@Path("ontology.nq") - //@Override - //public Response getOntologyAll() { - // try { - // FileAndMeta all = this.repo.getOntologyAll(); - // ResponseBuilder rBuild = Response.ok(all.data, all.contentType); - // return rBuild.build(); - // } catch (Exception e) { - // try { - // // Create Json error response - // Gson gson = new Gson(); - // ErrorMessage error = new ErrorMessage(e.getMessage()); - // String jsonData = gson.toJson(error); - - // // Prepare the response - // response.setContentType("application/json"); - // response.setCharacterEncoding("utf-8"); - // response.setStatus(500); - - // // Send the response - // response.getWriter().print(jsonData.toString()); - // response.getWriter().flush(); - // } catch (IOException e1) { - // e1.printStackTrace(); - // } - // } - // return null; - //} + @GET + @Path("ontology.nq") + @Override + public Response getOntologyAll() { + try { + FileAndMeta all = this.repo.getOntologyAll(); + ResponseBuilder rBuild = Response.ok(all.data, all.contentType); + return rBuild.build(); + } catch (Exception e) { + try { + // Create Json error response + Gson gson = new Gson(); + ErrorMessage error = new ErrorMessage(e.getMessage()); + String jsonData = gson.toJson(error); + + // Prepare the response + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + response.setStatus(500); + + // Send the response + response.getWriter().print(jsonData.toString()); + response.getWriter().flush(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + return null; + } } \ No newline at end of file diff --git a/server/src/main/java/org/diskproject/server/repository/DiskRepository.java b/server/src/main/java/org/diskproject/server/repository/DiskRepository.java index 2a6ecfd..238ef7f 100644 --- a/server/src/main/java/org/diskproject/server/repository/DiskRepository.java +++ b/server/src/main/java/org/diskproject/server/repository/DiskRepository.java @@ -737,7 +737,7 @@ public Entity getOrCreateEntity(String username) { return this.diskDB.loadOrRegisterEntity(username); } - /*public FileAndMeta getOntologyAll() { + public FileAndMeta getOntologyAll() { this.rdf.startRead(); Dataset all = this.rdf.fac.getDataset(); ByteArrayOutputStream rawBytes = new ByteArrayOutputStream(); @@ -746,5 +746,5 @@ public Entity getOrCreateEntity(String username) { FileAndMeta fileData = new FileAndMeta(bytes, "application/n-quads"); this.rdf.end(); return fileData; - }*/ + } } diff --git a/shared/src/main/java/org/diskproject/shared/api/DiskService.java b/shared/src/main/java/org/diskproject/shared/api/DiskService.java index 92f27ea..7b05f95 100644 --- a/shared/src/main/java/org/diskproject/shared/api/DiskService.java +++ b/shared/src/main/java/org/diskproject/shared/api/DiskService.java @@ -220,8 +220,8 @@ public Response getOutputData( @JsonProperty("request") ExternalDataRequest r); // Download ontologies - //@GET - //@Path("ontology.nq") - //@Produces("application/rdf+xml") - //public Response getOntologyAll(); + @GET + @Path("ontology.nq") + @Produces("application/rdf+xml") + public Response getOntologyAll(); } \ No newline at end of file