Skip to main content

isSubset
isSubset

This article explains how, using an "isSubset" expression, you can determine whether a set of concept instances is the subset of another set of concept instances. It also gives you an example knowledge map so you can explore the "isSubset" expression inside the Rainbird Studio.

The isSubset expression is used to compare two sets of concept instances and verify that the first is a subset of the second. This can be used to determine if a set of requirements have been met for particular outcomes.

In the example below Rainbird will use the isSubset expression to determine which recipes are viable based on whether a user has the specific ingredients. In essence, the isSubset expression will determine whether the list of ingredients in a recipe is present in the list of ingredients that a user may have in the pantry.

isSubset(%O, requires ingredients, *, %S , has ingredients in pantry, * )

In the following Build Example Rainbird will determine which desserts a user can make by:

  • Asking the user what ingredients they have in the pantry.
  • Determine whether the list of ingredients for specific recipes are present in the pantry.

Rainbird will then give the user a list of recipes that are possible to make.

Please continue reading the article following the sub-topics:

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

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

isSubset - Build Example

Tom (a user) has the recipes for three simple desserts:

  1. A meringue which requires Eggs and Sugar
  2. A Victoria sponge cake which requires Eggs, Flour, Sugar, Butter and Jam
  3. A Chocolate cake which requires Eggs, Flour, Sugar, Butter and Cocoa... (More)

isSubset - Downloadable Model file

Query and Results

The main query is built on the rule ‘can make dessert’. The outcome of the query will confirm which desserts can be created with the available ingredients.

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