Skip to content

Commit

Permalink
Disable Rio pretty printing for #61
Browse files Browse the repository at this point in the history
  • Loading branch information
stkenny committed Jul 30, 2021
1 parent 78d8e4c commit 41b4738
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>nl.dtls</groupId>
<artifactId>rdf-extension</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<packaging>jar</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eclipse.rdf4j.rio.RDFHandlerException;
import org.eclipse.rdf4j.rio.RDFWriter;
import org.eclipse.rdf4j.rio.Rio;
import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
Expand All @@ -42,16 +43,17 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)

StringWriter sw = new StringWriter();
RDFWriter w = Rio.createWriter(RDFFormat.TURTLE, sw);
w.getWriterConfig().set(BasicWriterSettings.PRETTY_PRINT, false);
RdfRowVisitor visitor = new RdfRowVisitor(schema, w) {
final int limit = 10;
int _count;
@Override
public boolean visit(Project project, int rowIndex, Row row) {
if(_count>=limit){
if(_count >= limit){
return true;
}
for(Node root:roots){
root.createNode(baseUri, factory, con, project, row, rowIndex,blanks);
root.createNode(baseUri, factory, con, project, row, rowIndex, blanks);
}
_count +=1;

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/deri/grefine/rdf/exporters/RdfExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.eclipse.rdf4j.rio.RDFWriter;
import org.eclipse.rdf4j.rio.Rio;
import org.eclipse.rdf4j.sail.memory.MemoryStore;
import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings;

import com.google.refine.browsing.Engine;
import com.google.refine.browsing.FilteredRows;
Expand Down Expand Up @@ -67,6 +68,7 @@ public void export(Project project, Properties options, Engine engine,

private void export(Project project, Properties options, Engine engine,
RDFWriter writer) throws IOException {
writer.getWriterConfig().set(BasicWriterSettings.PRETTY_PRINT, false);
RdfSchema schema;
try{
schema = Util.getProjectSchema(applicationContext, project);
Expand Down

0 comments on commit 41b4738

Please sign in to comment.