Augmentation Directives are CPGQL Directives which extend a Code Property Graph with nodes, properties and edges.
Take the following simple program named
newTagNode is an Augmentation Directive that adds tags with user-defined keys to the nodes that are part of the traversal they're suffixing. It works together with the
store CPGQL Component which creates the actual nodes representing the tags, and the
run.commit which merges those nodes in the active Code Property Graph.
Say for example that you'd like to add tags to all the nodes of
X42's Code Property Graph that represent calls to
exit. That is, these two:
And say that you'd like to use the key
MY_KIND_OF_EXIT for the tags you want to create:
newTagNodePair is very similar to
newTagNode: it is an Augmentation Directive that adds tags with user-defined keys and user-defined values to the nodes that are part of the traversal they're suffixing. It also works together with
run.commit, but you can specify both a key and a value for the nodes created: