当前位置: 首页>>代码示例>>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;未经允许,请勿转载。