org.eclipse.rdf4j.query.algebra.evaluation.impl.StrictEvaluationStrategy Java Examples

The following examples show how to use org.eclipse.rdf4j.query.algebra.evaluation.impl.StrictEvaluationStrategy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PathIteration.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public PathIteration(StrictEvaluationStrategy evaluationStrategyImpl, Scope scope, Var startVar,
		TupleExpr pathExpression, Var endVar, Var contextVar, long minLength, BindingSet bindings)
		throws QueryEvaluationException {
	this.evaluationStrategyImpl = evaluationStrategyImpl;
	this.scope = scope;
	this.startVar = startVar;
	this.endVar = endVar;

	this.startVarFixed = startVar.hasValue() || bindings.hasBinding(startVar.getName());
	this.endVarFixed = endVar.hasValue() || bindings.hasBinding(endVar.getName());

	this.pathExpression = pathExpression;
	this.contextVar = contextVar;

	this.currentLength = minLength;
	this.bindings = bindings;

	this.reportedValues = makeSet();
	this.unreportedValues = makeSet();
	this.valueQueue = makeQueue();

	createIteration();
}
 
Example #2
Source File: ZeroLengthPathIterationTest.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Before
public void setUp() {
	Model m = new LinkedHashModel();
	m.add(RDF.ALT, RDF.TYPE, RDFS.CLASS);
	m.add(RDF.BAG, RDF.TYPE, RDFS.CLASS);

	TripleSource ts = new TripleSource() {

		@Override
		public CloseableIteration<? extends Statement, QueryEvaluationException> getStatements(Resource subj,
				IRI pred, Value obj, Resource... contexts) throws QueryEvaluationException {
			return new CloseableIteratorIteration<>(m.getStatements(subj, pred, obj, contexts).iterator());
		}

		@Override
		public ValueFactory getValueFactory() {
			return vf;
		}
	};
	evaluator = new StrictEvaluationStrategy(ts, null);
}
 
Example #3
Source File: NativeStoreConnectionExt.java    From CostFed with GNU Affero General Public License v3.0 5 votes vote down vote up
protected CloseableIteration<? extends BindingSet, QueryEvaluationException> evaluatePrecompiledInternal(
		TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) {
		/*
		replaceValues(tupleExpr);
*/
		TripleSource tripleSource = null;
		//new RepositoryTripleSource(nativeStore, includeInferred, transactionActive());
		
		StrictEvaluationStrategy strategy = new StrictEvaluationStrategy(tripleSource, dataset, null);
		
		return strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
}
 
Example #4
Source File: LimitedSizePathIterator.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 3 votes vote down vote up
/**
 * @param evaluationStrategyImpl
 * @param scope
 * @param startVar
 * @param pathExpression
 * @param endVar
 * @param contextVar
 * @param minLength
 * @param bindings
 * @throws QueryEvaluationException
 */
public LimitedSizePathIterator(StrictEvaluationStrategy evaluationStrategyImpl, Scope scope, Var startVar,
		TupleExpr pathExpression, Var endVar, Var contextVar, long minLength, BindingSet bindings, AtomicLong used,
		long maxSize) throws QueryEvaluationException {
	super(evaluationStrategyImpl, scope, startVar, pathExpression, endVar, contextVar, minLength, bindings);
	this.used = used;
	this.maxSize = maxSize;
}