I am working on a service that transforms, translates and normalizes records received as semi-structured json. The requirements are as follows:
- The incoming json entities of the same type (type - person, address etc.) may not to have the same same attributes.
- Some attributes may not be present in every entity of a given type.
- Attributes can be renamed.
- The incoming json entites are initially untyped. The type of the incoming entities can be determined by analyzing the available fields. So I imagine that rules are needed to reclassify entities to their Drools/Java class.
- It may not be possible to guarantee that the data in a given attribute is always of the same type (though everything can default to string).
Of course, these requirements are all the opposite of Java and comments in other posts (though a several years ago) have pointed out that it is difficult to process json with Drools.
Is there way to harmoniously apply Drools in the above scenario or are there minimal restrictions (aside from the obvious solution of imposing a strong data model) that would correct the situation?