Java Code Examples for org.eclipse.rdf4j.query.algebra.TupleExpr#setParentNode()

The following examples show how to use org.eclipse.rdf4j.query.algebra.TupleExpr#setParentNode() . 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: SpinParser.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public void visitInsertData(Resource query) throws RDF4JException {
	SingletonSet stub = new SingletonSet();
	tupleRoot = new QueryRoot(stub);
	tupleNode = stub;
	TupleExpr insertExpr;
	Value insert = TripleSources.singleValue(query, SP.DATA_PROPERTY, store);
	if (!(insert instanceof Resource)) {
		throw new MalformedSpinException(String.format("Value of %s is not a resource", SP.DATA_PROPERTY));
	}
	visitInsert((Resource) insert);
	insertExpr = tupleNode;
	insertExpr.setParentNode(null);

	DataVisitor visitor = new DataVisitor();
	insertExpr.visit(visitor);
	updateRoot = new InsertData(visitor.getData());
}
 
Example 2
Source File: SpinParser.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public void visitDeleteData(Resource query) throws RDF4JException {
	SingletonSet stub = new SingletonSet();
	tupleRoot = new QueryRoot(stub);
	tupleNode = stub;
	TupleExpr deleteExpr;
	Value delete = TripleSources.singleValue(query, SP.DATA_PROPERTY, store);
	if (!(delete instanceof Resource)) {
		throw new MalformedSpinException(String.format("Value of %s is not a resource", SP.DATA_PROPERTY));
	}
	visitDelete((Resource) delete);
	deleteExpr = tupleNode;
	deleteExpr.setParentNode(null);

	DataVisitor visitor = new DataVisitor();
	deleteExpr.visit(visitor);
	updateRoot = new DeleteData(visitor.getData());
}
 
Example 3
Source File: NTuple.java    From CostFed with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Construct an nary-tuple. Note that the parentNode of all arguments is
 * set to this instance.
 * 
 * @param args
 */
public NTuple(List<TupleExpr> args, QueryInfo queryInfo) {
	super();
	this.queryInfo = queryInfo;
	this.args = args;
	for (TupleExpr expr : args)
		expr.setParentNode(this);
}
 
Example 4
Source File: NTuple.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Construct an nary-tuple. Note that the parentNode of all arguments is set to this instance.
 *
 * @param args
 */
public NTuple(List<TupleExpr> args, QueryInfo queryInfo) {
	super();
	this.queryInfo = queryInfo;
	this.args = args;
	for (TupleExpr expr : args) {
		expr.setParentNode(this);
	}
}