當前位置: 首頁>>代碼示例>>Java>>正文


Java TransformFilterDisjunction類代碼示例

本文整理匯總了Java中com.hp.hpl.jena.sparql.algebra.optimize.TransformFilterDisjunction的典型用法代碼示例。如果您正苦於以下問題:Java TransformFilterDisjunction類的具體用法?Java TransformFilterDisjunction怎麽用?Java TransformFilterDisjunction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TransformFilterDisjunction類屬於com.hp.hpl.jena.sparql.algebra.optimize包,在下文中一共展示了TransformFilterDisjunction類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: optimizeAlgebra

import com.hp.hpl.jena.sparql.algebra.optimize.TransformFilterDisjunction; //導入依賴的package包/類
private Op optimizeAlgebra(Op opRoot) {
	/*
	 * Algebra Optimierer fuehrt High-Level Transformationen aus (z.B. Filter Equalilty)
	 * -> nicht BGP reordering
	 * 
	 * zunaechst muss gesetzt werden was alles optimiert werden soll, z.B.
	 * ARQ.set(ARQ.optFilterEquality, true);
	 * oder
	 * ARQ.set(ARQ.optFilterPlacement, true);
	 * 
	 * Danach kann dann Algebra.optimize(op) aufgerufen werden
	 */

	/*
	 * Algebra.optimize always executes TransformJoinStrategy -> not always wanted
	 * ARQ.set(ARQ.optFilterPlacement, false);
	 * ARQ.set(ARQ.optFilterEquality, true);
	 * ARQ.set(ARQ.optFilterConjunction, true);
	 * ARQ.set(ARQ.optFilterDisjunction, true);
	 * opRoot = Algebra.optimize(opRoot);
	 */

	/*
	 * Reihenfolge der Optimierungen wichtig!
	 * 
	 * 1. Transformationen der SPARQL-Algebra bis auf FilterPlacement -> koennte Kreuzprodukte erzeugen
	 * 2. BGPOptimizer -> Neuanordnung der Triple im BGP zur Vermeidung von Kreuzprodukten und zur Minimierung von Joins
	 * 3. FilterPlacement -> Vorziehen des Filters soweit moeglich
	 */

	// Perform Join optimization only if optimization level is set to ALL
	if (Tags.optimizer == Optimizer.ALL) {
		TransformJoinStrategy joinStrategy = new TransformJoinStrategy();
		opRoot = Transformer.transform(joinStrategy, opRoot);
	}

	// Perform filter optimizations if optimization level is set to FILTER or ALL
	if (Tags.optimizer == Optimizer.FILTER || Tags.optimizer == Optimizer.ALL) {
		// ARQ optimization of Filter conjunction
		TransformFilterConjunction filterConjunction = new TransformFilterConjunction();
		opRoot = Transformer.transform(filterConjunction, opRoot);

		// ARQ optimization of Filter disjunction
		TransformFilterDisjunction filterDisjunction = new TransformFilterDisjunction();
		opRoot = Transformer.transform(filterDisjunction, opRoot);

		// ARQ optimization of Filter equality
		TransformFilterEquality filterEquality = new TransformFilterEquality();
		opRoot = Transformer.transform(filterEquality, opRoot);

		// Own optimization of Filter variable equality
		TransformFilterVarEquality filterVarEquality = new TransformFilterVarEquality();
		opRoot = filterVarEquality.transform(opRoot);
	}

	// Perform BGP optimization if optimization level is set to BGP, FILTER or ALL
	if (Tags.optimizer == Optimizer.BGP || Tags.optimizer == Optimizer.FILTER || Tags.optimizer == Optimizer.ALL) {
		// Own BGP optimizer using variable counting heuristics
		BGPOptimizerNoStats bgpOptimizer = new BGPOptimizerNoStats();
		opRoot = bgpOptimizer.optimize(opRoot);
	}

	// Perform filter optimizations if optimization level is set to FILTER or ALL
	// Filter Placement must be done last!
	if (Tags.optimizer == Optimizer.FILTER || Tags.optimizer == Optimizer.ALL) {
		// ARQ optimization of Filter placement
		TransformFilterPlacement filterPlacement = new TransformFilterPlacement();
		opRoot = Transformer.transform(filterPlacement, opRoot);
	}
	return opRoot;
}
 
開發者ID:aschaetzle,項目名稱:PigSPARQL,代碼行數:72,代碼來源:PigCompiler.java


注:本文中的com.hp.hpl.jena.sparql.algebra.optimize.TransformFilterDisjunction類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。