delete – Deleting edges or nodes

General

The delete operator is only available in modify mode. It deletes the specified pattern graph elements. Multiple occurrences of delete statements are allowed. Deletion statements are executed after all other rewrite statements.

Example code:

//Rule to merge multiple edegs of the type Contains with the same source and target nodes (built through merging the nodes)
1 rule deleteParallelContainsEdges{
2
3    n1:BomNode -edge1:Contains-> n2:MergedPart;			//matching pattern: if one mergedNode n1 has a Contains edge to another mergedNode n2
4    n1 -edge2:Contains-> n2;								//matching pattern: and n1 has another Contains edge to n2 (meaning the edges are parallel)

5    modify{
6       delete(edge2);										//then delete the second edge
7    }
8 }

This code example can be found in our Soley Studio Tutorial.

How to use it:

More Examples can be found in these Packages:

Was this article helpful?

Related Articles