All Downloads are FREE. Search and download functionalities are using the official Maven repository.

integraal.services.concrete.InteGraal_CSVEncodingFromRLSFile Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package integraal.services.concrete;

import org.slf4j.LoggerFactory;

import fr.boreal.component_builder.api.IAlgorithmParameters;
import fr.boreal.component_builder.api.IInputDataScenario;
import fr.boreal.io.csv.RLSCSVsParser;
import fr.boreal.query_evaluation.component.QueryEvaluationOutput;
import fr.boreal.query_evaluation.component.QueryEvaluator;
import integraal.services.AbstractInteGraalService;
import integraal.services.InteGraalOps;
import tools.service.CommonOps;

/**
 * Measures the time taken to encode a factbase exported in CSV.
 * 
 */
public class InteGraal_CSVEncodingFromRLSFile extends AbstractInteGraalService {

	/**
	 * @param ids input data scenario
	 * @param iap algorithm parameters
	 */
	public InteGraal_CSVEncodingFromRLSFile(IInputDataScenario ids, IAlgorithmParameters iap) {
		super(ids, iap);
		LOG = LoggerFactory.getLogger(InteGraal_CSVEncodingFromRLSFile.class);

	}

	QueryEvaluator evaluator;
	Iterable query_answers;

	public void prepareServiceSpecificOperations() {

		if (inputDataScenario.getFactbasePath().isEmpty() || inputDataScenario.getFactbasePath().get().size() != 1) {

			LOG.error("Expected exactly one RLS file but got : " + inputDataScenario.getFactbasePath());
			throw new IllegalStateException();

		}

		operations.addRunnable(InteGraalOps.ENCODE_DATA, this::encode);

	}

	/**
	 * Encode data.
	 */
	public void encode() {

		RLSCSVsParser rlscsVsParser = new RLSCSVsParser(inputDataScenario.getFactbasePath().get().iterator().next(), true);
		rlscsVsParser.close();

	}

	@Override
	protected void postProcessingTrial() {

	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy