Parser/QueryParser.cpp
antlrcpp::Any QueryParser::visitModify(SPARQLParser::ModifyContext *ctx)
{
	// ( 'WITH' iri )? not supported

	if (ctx->deleteClause() && ctx->insertClause())
	{
		query_tree_ptr->setUpdateType(QueryTree::Modify_Clause);
		visit(ctx->deleteClause());
		visit(ctx->insertClause());
	}
	else if (ctx->deleteClause())
	{
		query_tree_ptr->setUpdateType(QueryTree::Delete_Clause);
		visit(ctx->deleteClause());
	}
	else if (ctx->insertClause())
	{
		query_tree_ptr->setUpdateType(QueryTree::Insert_Clause);
		visit(ctx->insertClause());
	}

	// usingClause not supported

	visitGroupGraphPattern(ctx->groupGraphPattern(), query_tree_ptr->getGroupPattern());

	return antlrcpp::Any();
}
/**
	modify : ( K_WITH iri )? ( deleteClause insertClause? | insertClause ) 
	usingClause* K_WHERE groupGraphPattern ;
	Visit node deleteWhere: set update type according to the presence of deleteClause or 
	insertClause, and recursively visit its child groupGraphPattern.
	Assumptions:
	1) No ( K_WITH iri ) in modify.
	2) No usingClause in modify.

	@param ctx pointer to modify's context.
	@return a dummy antlrcpp::Any object.
*/
modify : ( K_WITH iri ). ( deleteClause insertClause. | insertClause )
usingClause* K_WHERE groupGraphPattern ;
Visit node deleteWhere: set update type according to the presence of deleteClause or
insertClause, and recursively visit its child groupGraphPattern.
Assumptions:
1) No ( K_WITH iri ) in modify.
2) No usingClause in modify.
modify : ( K_WITH iri ) . ( deleteClause insertClause . | insertClause ) usingClause * K_WHERE groupGraphPattern ; Visit node deleteWhere : set update type according to the presence of deleteClause or insertClause and recursively visit its child groupGraphPattern . Assumptions : 1 ) No ( K_WITH iri ) in modify . 2 ) No usingClause in modify .
antlrcpp::Any QueryParser::visitModify(SPARQLParser::ModifyContext *ctx)
{
	if (ctx->deleteClause() && ctx->insertClause())
	{
		query_tree_ptr->setUpdateType(QueryTree::Modify_Clause);
		visit(ctx->deleteClause());
		visit(ctx->insertClause());
	}
	else if (ctx->deleteClause())
	{
		query_tree_ptr->setUpdateType(QueryTree::Delete_Clause);
		visit(ctx->deleteClause());
	}
	else if (ctx->insertClause())
	{
		query_tree_ptr->setUpdateType(QueryTree::Insert_Clause);
		visit(ctx->insertClause());
	}
	visitGroupGraphPattern(ctx->groupGraphPattern(), query_tree_ptr->getGroupPattern());
	return antlrcpp::Any();
}
antlrcpp :: Any QueryParser :: visitModify ( SPARQLParser :: ModifyContext * ctx ) { if ( ctx -> deleteClause ( ) && ctx -> insertClause ( ) ) { query_tree_ptr -> setUpdateType ( QueryTree :: Modify_Clause ) ; visit ( ctx -> deleteClause ( ) ) ; visit ( ctx -> insertClause ( ) ) ; } else if ( ctx -> deleteClause ( ) ) { query_tree_ptr -> setUpdateType ( QueryTree :: Delete_Clause ) ; visit ( ctx -> deleteClause ( ) ) ; } else if ( ctx -> insertClause ( ) ) { query_tree_ptr -> setUpdateType ( QueryTree :: Insert_Clause ) ; visit ( ctx -> insertClause ( ) ) ; } visitGroupGraphPattern ( ctx -> groupGraphPattern ( ) , query_tree_ptr -> getGroupPattern ( ) ) ; return antlrcpp :: Any ( ) ; }
modify : ( K_WITH iri )?
modify : ( K_WITH iri ) ?
// ( 'WITH' iri )? not supported // usingClause not supported