This is the third in a series of posts were I follow along with the Government of Canada’s Rules as Code discovery project. In this post, I’m going to start modelling the legislation in Oracle Intelligent Advisor.
Ontology Take 2
The ontology we are going to build here is going to be smaller than the one we started with, because we are only aiming at being able to answer questions about vacation pay. Specifically, we are aiming only to be able to answer questions about how much vacation pay a person is entitled to. Because I like things more complicated than they need to be, I’m going to also try to answer question about when that pay is due.
The tool that you use to generate the ontology when using Oracle Intelligent Advisor is the “Data” section of Oracle Policy Modelling, which looks like this:
You can see that the screen is divided into three parts. The left part is a tree-structured list of “entity types”. Each entity type has a list of “attributes” in the top right, which are base data-type information about that entity type, and “relationships” on the bottom right, which are relationships between this data type and other data types.
Unlike in Flora-2, OPM allows you to specify at the ontology phase that relationships are one-to-one, one-to-many, or many-to-many.
The tree structure for entity types expresses a “has” relationship, which is always one-to-many. The entity type closer to the root “has” one or more objects of the entity type below. Entity types that are not contained by anything else are contained by the Global object.
So a text description of what the entity type tree above says might be:
The Global Object has one or more Employees, one or more Employers, and one or more Employments.
An Employer has one or more Industrial Establishments.
An Industrial Establishment has one or more Determined Year of Employment, and one or more Regular Pay Days.
An Employment has one or more Vacation Period, and one or more Year of Employment.