From 76739cc803be41b5d424f512b23bc9a607586574 Mon Sep 17 00:00:00 2001 From: hvarg Date: Tue, 30 Jul 2024 15:35:36 -0400 Subject: [PATCH] Disable download nq --- server/pom.xml | 8 --- .../server/api/impl/DiskResource.java | 58 +++++++++---------- .../server/repository/DiskRepository.java | 4 +- .../diskproject/shared/api/DiskService.java | 8 +-- 4 files changed, 35 insertions(+), 43 deletions(-) diff --git a/server/pom.xml b/server/pom.xml index 3336cf7..171072c 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -29,14 +29,6 @@ UTF-8 - - - github - Github - https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/ontapi - - - 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 97f773b..411fda2 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 238ef7f..2a6ecfd 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 FileAndMeta getOntologyAll() { 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 7b05f95..92f27ea 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