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

fr.boreal.backward_chaining.evaluators.QueryRewriter Maven / Gradle / Ivy

Go to download

InteGraal has been designed in a modular way, in order to facilitate software reuse and extension. It should make it easy to test new scenarios and techniques, in particular by combining algorithms. The main features of Graal are currently the following: (1) internal storage to store data by using a SQL or RDF representation (Postgres, MySQL, HSQL, SQLite, Remote SPARQL endpoints, Local in-memory triplestores) as well as a native in-memory representation (2) data-integration capabilities for exploiting federated heterogeneous data-sources through mappings able to target systems such as SQL, RDF, and black-box (e.g. Web-APIs) (3) algorithms for query-answering over heterogeneous and federated data based on query rewriting and/or forward chaining (or chase)

The newest version!
package fr.boreal.backward_chaining.evaluators;

import java.util.Collection;

import org.slf4j.LoggerFactory;

import fr.boreal.model.kb.api.RuleBase;
import fr.boreal.model.query.api.Query;
import fr.boreal.model.ruleCompilation.NoRuleCompilation;
import fr.boreal.model.ruleCompilation.api.RuleCompilation;
import fr.lirmm.boreal.util.evaluator.MultiEvaluator;
import fr.lirmm.boreal.util.externalHaltingConditions.ExternalAlgorithmHaltingConditions;

/**
 * A class for rewriting a collection of FOQuery objects.
 *
 */
public class QueryRewriter extends MultiEvaluator {

	static {

		LOG = LoggerFactory.getLogger(QueryRewriter.class);

	}

	/**
	 * Constructs a QueryRewriter with the given collection of queries, rules, and
	 * compilation. base. assumptions : if a compilation different from
	 * {@link NoRuleCompilation} is used, than the ruleset should contain only
	 * non-compilable rules.
	 * 
	 * @param queries  The collection of FOQuery objects to rewrite.
	 * @param ruleBase The RuleBase containing rules for rewriting. * @param
	 *                 compilation The RuleCompilation configuration for rewriting.
	 * @param compilation 
	 * @param externalHaltingConditions 
	 */

	public QueryRewriter(Collection queries, RuleBase ruleBase, RuleCompilation compilation,
			ExternalAlgorithmHaltingConditions externalHaltingConditions) {

		super(new RewritingInputWrapper(queries, ruleBase, compilation).createRewritingInputs(),
				new DefaultRewritingFunction(), externalHaltingConditions,
				new DefaultQueryRewritingOutputIfTimeoutFunction());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy