Skip to content

Commit

Permalink
Disable download nq
Browse files Browse the repository at this point in the history
  • Loading branch information
hvarg committed Jul 30, 2024
1 parent d331e43 commit 76739cc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 43 deletions.
8 changes: 0 additions & 8 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>github</id>
<name>Github</name>
<url>https://maven.pkg.github.com/KnowledgeCaptureAndDiscovery/ontapi</url>
</repository>
</repositories>

<dependencies>
<!-- Disk ontapi -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
//}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -746,5 +746,5 @@ public FileAndMeta getOntologyAll() {
FileAndMeta fileData = new FileAndMeta(bytes, "application/n-quads");
this.rdf.end();
return fileData;
}
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 76739cc

Please sign in to comment.