Skip to main content

sumObject
sumObject

This article explains how, using a "sumObject" expression, you can count how many number concept instances or facts there are in a knowledge map. It also gives you an example knowledge map to explore the "sumObject" expression inside the Rainbird Studio. 

The sumObject expression is used to count the total amount of number concept instances/facts either within the map or entered by the user when querying the map.

The sumObject expression can only be used with number concepts and is particularly useful when the number of concept instances in a map is likely to change or is unknown.

To demonstrate the sumObject expression, this  build example will demonstrate how to build a map that uses the expression to calculate the total monthly cost of four bills the user has to pay . The map will use the following expression: 

sumObjects(%S, owes bill, *)

The SumObject expression will be used because the amount of bills a person may have to pay monthly may vary between users. 

Rainbird will calculate the total value by:

  • Asking the user which bills are due this month
  • Asking the cost of each bill
  • Summing up the values to give an answer (the overall cost)

Please continue reading the article following the sub-topics:

  1. sumObject - Build Example
  2. sumObject - Downloadable Model
0 followers
0 questions
0 posts

You will need to register to be able to post or comment on a topic.  

sumObject - Downloadable Model - File

Query and Results

The main query is built on the rule ‘has total bill value’. The outcome of the query will be the sum of the bills entered at run-time.

sumObject - Build Example

Building the Map Structure

First, create the following concepts:

Concepts:

Person – a string concept with no instances created (Rainbird will ask the user for a name at the start of the query, which will create a concept instance... (More)

.menu.bell.icon {color: #1c083b;}