Statistics

Cloud CMS automatically collects and aggregates node statistics for you as you connect nodes together in the content graph. Nodes are entities and associations are used to connect them together through a series of relationships. As nodes are connected together, both the source and target node will have their statistics computed and updated so that you can quickly find out how many relationships a given node has to its neighbors.

The basic mechanics behind node statistics are similar to reference counting. Given a node, you can quickly determine how many connections of a given type exist to its neighbors. For more information on the quality of those connections and the meaning behind them, the data dictionary will need to be consulted to pull back the association type, its structure and any metadata on the association.

Cloud CMS associations are JSON objects just like nodes. They can hold JSON properties and these properties can be used to drive behavior as the graph is worked with.

Example of how Node Statistics work

Statistics are automatically computed for all associations. When you create any kind of association between any two nodes, the statistics are computed and stored on each node under the _statistics subobject.

Imagine the following scenario. You have source node named Article and a target node named Review. They are joined by a custom association called HasReview.

[Article] -> [HasReview] -> [Review]

The article might look like this:

{
    "title": "The Brewers are looking good this year"
}

And the review might look like this:

{
    "title": "My opinion with no skin in the game",
    "review": "Blah blah blah, snore"
}

When the HasReview association is created to link the source (Article) and target (Review) together, the _statistics property on both source and target will be incremented. The source will look like this:

{
    "title": "The Brewers are looking good this year",
    "_statistics": {
        "custom:hasReview": 1
    }
}

And the target will look like this:

{
    "title": "My opinion with no skin in the game",
    "review": "Blah blah blah, snore",
    "_statistics": {
        "custom:hasReview": 1
    }
}

Note that the directionality or any other JSON properties of the association are not captured by default.

Additional Node Statistics

You can adjust the way statistics are collected using some of the out-of-the-box Features provided by Cloud CMS.

For example, the Rates Feature allows you to collect custom statistics oriented around product or review ratings. And the Stats Sum Counter Feature lets you aggregate the sum of any property into a counter, in either direction.

It is also possible to implement custom node statistics collection using server-side coding (for private or on-premise installations of Cloud CMS) or server-side JavaScript. This is not covered here but information about it can be requested from Cloud CMS Support.