Skip to content

Commit 5125935

Browse files
committed
Allow download nq again
1 parent 3bad0e5 commit 5125935

File tree

4 files changed

+36
-36
lines changed

4 files changed

+36
-36
lines changed

server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<jersey.version>2.36</jersey.version>
2222
<gson.version>2.6.2</gson.version>
2323
<commons-configuration.version>1.10</commons-configuration.version>
24-
<ontapi.version>1.3.4</ontapi.version>
24+
<ontapi.version>1.3.8</ontapi.version>
2525
<jbcrypt.version>0.3m</jbcrypt.version>
2626
<java.version>1.8</java.version>
2727
<httpclient.version>4.5.2</httpclient.version>

server/src/main/java/org/diskproject/server/api/impl/DiskResource.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -508,34 +508,34 @@ public Response getOutputData(@JsonProperty("request") ExternalDataRequest r) {
508508
return rBuild.build();
509509
}
510510

511-
//@GET
512-
//@Path("ontology.nq")
513-
//@Override
514-
//public Response getOntologyAll() {
515-
// try {
516-
// FileAndMeta all = this.repo.getOntologyAll();
517-
// ResponseBuilder rBuild = Response.ok(all.data, all.contentType);
518-
// return rBuild.build();
519-
// } catch (Exception e) {
520-
// try {
521-
// // Create Json error response
522-
// Gson gson = new Gson();
523-
// ErrorMessage error = new ErrorMessage(e.getMessage());
524-
// String jsonData = gson.toJson(error);
525-
526-
// // Prepare the response
527-
// response.setContentType("application/json");
528-
// response.setCharacterEncoding("utf-8");
529-
// response.setStatus(500);
530-
531-
// // Send the response
532-
// response.getWriter().print(jsonData.toString());
533-
// response.getWriter().flush();
534-
// } catch (IOException e1) {
535-
// e1.printStackTrace();
536-
// }
537-
// }
538-
// return null;
539-
//}
511+
@GET
512+
@Path("ontology.nq")
513+
@Override
514+
public Response getOntologyAll() {
515+
try {
516+
FileAndMeta all = this.repo.getOntologyAll();
517+
ResponseBuilder rBuild = Response.ok(all.data, all.contentType);
518+
return rBuild.build();
519+
} catch (Exception e) {
520+
try {
521+
// Create Json error response
522+
Gson gson = new Gson();
523+
ErrorMessage error = new ErrorMessage(e.getMessage());
524+
String jsonData = gson.toJson(error);
525+
526+
// Prepare the response
527+
response.setContentType("application/json");
528+
response.setCharacterEncoding("utf-8");
529+
response.setStatus(500);
530+
531+
// Send the response
532+
response.getWriter().print(jsonData.toString());
533+
response.getWriter().flush();
534+
} catch (IOException e1) {
535+
e1.printStackTrace();
536+
}
537+
}
538+
return null;
539+
}
540540

541541
}

server/src/main/java/org/diskproject/server/repository/DiskRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ public Entity getOrCreateEntity(String username) {
737737
return this.diskDB.loadOrRegisterEntity(username);
738738
}
739739

740-
/*public FileAndMeta getOntologyAll() {
740+
public FileAndMeta getOntologyAll() {
741741
this.rdf.startRead();
742742
Dataset all = this.rdf.fac.getDataset();
743743
ByteArrayOutputStream rawBytes = new ByteArrayOutputStream();
@@ -746,5 +746,5 @@ public Entity getOrCreateEntity(String username) {
746746
FileAndMeta fileData = new FileAndMeta(bytes, "application/n-quads");
747747
this.rdf.end();
748748
return fileData;
749-
}*/
749+
}
750750
}

shared/src/main/java/org/diskproject/shared/api/DiskService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ public Response getOutputData(
220220
@JsonProperty("request") ExternalDataRequest r);
221221

222222
// Download ontologies
223-
//@GET
224-
//@Path("ontology.nq")
225-
//@Produces("application/rdf+xml")
226-
//public Response getOntologyAll();
223+
@GET
224+
@Path("ontology.nq")
225+
@Produces("application/rdf+xml")
226+
public Response getOntologyAll();
227227
}

0 commit comments

Comments
 (0)