Node Specification Language

SAMSON has a powerful Node Specification Language (NSL) that may be used to select data graph nodes based on their properties. For example, the Find command of the user interface of SAMSON lets users enter a NSL string to select nodes from the data graph.

Internally, SAMSON converts a NSL string into a node predicate that may be passed to the getNodes function of SBDDataGraphNode. Developers may choose to collect nodes from the data graph either from a NSL string or from a constructed node predicate.

NSL expressions may be used to find nodes in SAMSON (press Ctrl/ Cmd⌘ + F) or in the SDK with the makeNodePredicate function.

See User guide: Node Specification Language for more information.

For developers, the NSL relies on the SBCFunctor library, to manage functors and predicates. These may be used to e.g. search the data graph:

// find all atoms with temperature factor > 1.0
SBNodeIndexer nodeIndexer;
SBNode::IsType(SBNode::Atom) && (SBAtom::GetTemperatureFactor() > 1.0));

Please, refer to Getting nodes to learn more how to use the Node Specification Language to collect nodes.

See also