Skip to content

Commit

Permalink
Cleaning codebase. See #189
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Jan 24, 2022
1 parent 754f44d commit 4eaba5b
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 1,413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.*;

import com.github.sparqlanything.model.TriplifierHTTPException;
import com.github.sparqlanything.model.filestream.FileStreamTriplifier;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
import org.apache.commons.io.input.BOMInputStream;
Expand All @@ -41,7 +40,7 @@
import com.github.sparqlanything.model.FacadeXGraphBuilder;
import com.github.sparqlanything.model.Triplifier;

public class CSVTriplifier implements FileStreamTriplifier {
public class CSVTriplifier implements Triplifier {
private static final Logger log = LoggerFactory.getLogger(CSVTriplifier.class);
public final static String PROPERTY_FORMAT = "csv.format", PROPERTY_HEADERS = "csv.headers";
public final static String PROPERTY_DELIMITER = "csv.delimiter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
import java.util.Map;
import java.util.Properties;

import com.github.sparqlanything.model.filestream.FileStreamDatasetGraph;
import com.github.sparqlanything.model.filestream.FileStreamManager;
import com.github.sparqlanything.model.filestream.FileStreamTriplifier;
import org.apache.commons.io.FilenameUtils;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.NodeFactory;
Expand Down Expand Up @@ -298,23 +295,17 @@ private DatasetGraph triplify(final Op op, Properties p, Triplifier t) throws IO
logger.debug("Execution strategy: {} {}", strategy, op.toString());
if (t != null) {
try {
if (strategy == 2){
logger.warn("Strategy 2 is experimental!");
// XXX Experimental, Triplifier must implement FileStreamTriplifier
p.put(IRIArgument.BLANK_NODES.name(), "false");
FileStreamManager man = new FileStreamManager(ARQ.getContext(), op, p, (FileStreamTriplifier) t);
dg = new FileStreamDatasetGraph(man);

FacadeXGraphBuilder builder;
if (strategy == 1) {
logger.trace("Executing: {} [strategy={}]", p, strategy);
builder = new TripleFilteringFacadeXGraphBuilder(resourceId, op, p);
} else {
FacadeXGraphBuilder builder;
if (strategy == 1) {
logger.trace("Executing: {} [strategy={}]", p, strategy);
builder = new TripleFilteringFacadeXGraphBuilder(resourceId, op, p);
} else {
logger.trace("Executing: {} [strategy={}]", p, strategy);
builder = new BaseFacadeXGraphBuilder(resourceId, p);
}
dg = t.triplify(p, builder);
logger.trace("Executing: {} [strategy={}]", p, strategy);
builder = new BaseFacadeXGraphBuilder(resourceId, p);
}
dg = t.triplify(p, builder);

} catch (TriplifierHTTPException e) {
if (p.getProperty(PROPERTY_OPSERVICE_SILENT).equals("true")) {
// as per https://www.w3.org/TR/sparql11-federated-query/#serviceFailure
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4eaba5b

Please sign in to comment.