apoc.dv.CSVResource Maven / Gradle / Ivy
package apoc.dv;
import java.util.HashMap;
import java.util.Map;
public class CSVResource extends VirtualizedResource {
public CSVResource(String name, Map config) {
super(name, config, "CSV");
}
@Override
protected Map getProcedureParameters(Object queryParams, Map config) {
final Map base = Map.of("url", this.url, "config", config, "labels", labels);
Map map = new HashMap<>();
map.putAll((Map) queryParams);
map.putAll(base);
return map;
}
@Override
protected String getProcedureCall(Map config) {
return "CALL apoc.load.csv($url, $config) YIELD map WHERE " + query
+ " RETURN apoc.create.vNode($labels, map) AS node";
}
}