Augmentation Directives
Augmentation Directives are Ocular Query Components that allow you to extend a Code Property Graph with nodes, property, and edges.
Take the following simple program named X42
:
newTagNode
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
Ocular Query Component which creates the actual nodes representing the tags, and the run.commit
Top-Level Command 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
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 store
and run.commit
, but you can specify both a key and a value for the nodes created: