Java Code Examples for org.eclipse.rdf4j.query.algebra.StatementPattern#setScope()

The following examples show how to use org.eclipse.rdf4j.query.algebra.StatementPattern#setScope() . 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: ZeroLengthPathIteration.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private CloseableIteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException {
	Var startVar = createAnonVar(ANON_SUBJECT_VAR);
	Var predicate = createAnonVar(ANON_PREDICATE_VAR);
	Var endVar = createAnonVar(ANON_OBJECT_VAR);

	StatementPattern subjects = new StatementPattern(startVar, predicate, endVar);

	if (contextVar != null) {
		subjects.setScope(Scope.NAMED_CONTEXTS);
		subjects.setContextVar(contextVar);
	}
	CloseableIteration<BindingSet, QueryEvaluationException> iter = evaluationStrategy.evaluate(subjects, bindings);

	return iter;
}
 
Example 2
Source File: GroupBuilder.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public GroupBuilder<T, E> setScope(StatementPattern.Scope theScope) {
	mScope = theScope;

	for (StatementPattern aPattern : mGroup.getPatterns()) {
		aPattern.setScope(mScope);
	}

	return this;
}
 
Example 3
Source File: GroupBuilder.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public GroupBuilder<T, E> atoms(Set<StatementPattern> thePatterns) {
	for (StatementPattern aPattern : thePatterns) {
		aPattern.setContextVar(mContext);
		aPattern.setScope(mScope);
	}

	mGroup.addAll(thePatterns);

	return this;
}
 
Example 4
Source File: GroupBuilder.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private GroupBuilder<T, E> addPattern(StatementPattern thePattern) {
	thePattern.setContextVar(mContext);
	thePattern.setScope(mScope);

	mGroup.add(thePattern);

	return this;
}