Example: Infer Information About Combinations of Entities

Assuming you have the data model below, you could write a rule using the InferInstanceFor function to infer "the student’s potential university" for each combination of "the student" and "the university", both of which are not known until runtime.

Data model diagram for Example 4A

For this example, we are going to store information about the combination of students and universities in the entity "the student’s potential university". The first rule creates this entity:

the student’s potential university exists for the enrolling university

This rule essentially creates a mirror (duplicate) of the university entity under the student entity. The new entity is called "the student’s potential university". In inferred associative entity rules such as this, the associative entity must:

  • be a direct child of the source entity, and
  • have a many-to-one relationship with the target entity.

The next step is to copy any data we know about "the university" into the mirror entity "the student’s potential university" using the For function:

the student’s potential university = For(the enrolling university, the university)

the student’s potential university entrance score = For(the enrolling university, the university entrance score)

We do not need to transfer data we know about "the student" into "the student’s potential university" because "the student" is a parent entity of "the student’s potential university" so data belonging to "the student" is easily accessible in rules.

Now we can reason about the combination of “the student” and university in rules:

the student’s potential university will accept the student’s enrolment if

the student’s potential university entrance score <= the student’s score

This allows us to infer a different outcome for each combination of university and student.

An interview showing different outcomes inferred for each combination of university and student

Tip: To see the rules in the example above in action, open the Worked Example 4A project in Oracle Policy Modeling.