Temporal Reasoning in Oracle Policy Automation #4 : Time Travel
In this, the fourth part of our little series about Temporal Reasoning, we are going to look at the business of entering data. Specifically how users can enter the information they need during an interview. Thinking back to the scenario we have been discussing in the previous posts (part one, two and three) we need to enter information about our bank balance.
In a non-temporal world, entering the data would be as simple as entering a value in an input box. But we cannot have that, since there is no built-in capability to enter different values on different dates. Unlike some CRM systems like my old friend Oracle Siebel, there is no user interface element designed to facilitate the entry of temporal data.
So what options do we have. We can ask our users to enter data in row format, with each row representing a specific amount on a specific date. Put simply we can create an Entity and each instance can be converted into a temporal value. Let’s see how that works. Consider the following new Project with a simple data model:
As you can do doubt see, a single entity has been added and a few attributes. In addition I have changed the default text provided for the Containment Relationship to make it more natural. For our purposes we are interested in the date and the currency attributes which will form the basis of our conversion. To make this easier, we are going to use an Excel table to infer instances of the bank balance entry using the following table:
With this data we can now use one or other of the Temporal Reasoning functions that allow us to build temporal values from entity instances. As a first example, enter the following in a Word document in the project.
The expression targets a new attribute, the temporal bank balance, which will be populated with the output of the TemporalFromStartDate function. The function takes the relationship as the initial argument, followed by the date attribute and our currency attribute. The result in the Debugger is this (note I have superimposed the Temporal Visualization from the Debugger on the Interview output) :
Awesome. Our instances have become temporal values for our temporal attribute. But beware what this function is giving you. The implication of From Start Date is that any date prior to the first date in your Excel will show a temporal value of uncertain. Change the function to the following:
In this case, you are indicating that From the End Date of your instances, the temporal attribute will be uncertain.
If you have instances where there is both an end and a start date for each instance (which is not the case in our bank balance Excel table), you could also use this function to calculate when something was (for example) valid or invalid:
This of course assumes you have an entity, relationship and attributes that match the example above. It produces output like this:
In case you were wondering, you can reverse this process (go from temporal to instances) using a different method. In the final part of this series we will look at displaying the temporal data in cool ways.