Automatically Inferring The Data Model From The Rules - Gnorion/BizVR GitHub Wiki

Automatically Inferring The Data Model From The Rules

Inferring the data model from the rules will be quite a challenge. But I think at least some of it can be done. For example a user might say:

{toy in TOYS} if toy.shape='round' and toy.color='red' then toy.price=5
{puzzle in TOYS where puzzle.type='jigsaw'} if puzzle.size='large' then puzzle.category='hard'

From this we can deduce this simple data model (as it relates to this particular decision) Entity = TOYS, Properties: color, shape, size, type, category, price

If (in a separate decision) the rules were {child in PERSONS where child.age < 18} {toy in child.TOYS} if toy.color='red' then toy.price=5 Then we have a nested data structure where each child instance of PERSONS has an array of toys (each with color and price) Entity: PERSONS, Properties: age, toys (an array of toys within each PERSON) Entity: TOYS, Properties color, price and an association PERSONS->TOYS (1 to many, rolename toys) Ultimately an executable implementation of these rules might look something like this:

image

or as a pattern matching rule in Aion

ifmatch child,toy
where child.age < 18 and
      toy in child.toys and
      toy.color = 'red'and
      toy.price = 5
end

If all the rules were in the same decision then we'd need to merge all the properties.

Well, this is not really AI - we just have to figure out all the rules that apply to deducing an ontology from sample rules.