How to Duplicate or Copy Graph Elements?

General Info on How to Copy Graph Elements

This article provides information on how to copy graph elements within a graph. A code example is provided in order to illustrate a potential use of the built in copy function. With the copy statement, you can copy graph elements (nodes or edges) with their attributes and add it to the graph.  Have a look at the code example for the syntax!

Code Example

1 rule createCopy{
2    pnode:Part;
3    modify{
4       newnode:copy<pnode>;
5    }
6 }

In this example a copy of the node “pnode” is created (“newnode”) and added to the graph.

Further information

Do you have further questions? Then write a comment and we’ll come back to you. Or maybe the typeof article is what you’re looking for?

Was this article helpful?

Related Articles