{'fraction_non_alphanumeric': 0.018996590355577204, 'fraction_numerical': 0.0, 'mean_word_length': 4.988338192419825, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Prolog Framework for Integrating Business Rules into Java Applications

Business specifications – that formerly only supported IT development – increasingly become business configurations in the form of rules that can be loaded directly into IT solutions. PROLOG is well–known for its qualities in the development of sophisticated rule systems. It is desirable to combine the advantages of PROLOG with JAVA, since JAVA has become one of the most used programming languages in industry. However, experts of both programming languages are rare. To overcome the resulting interoperability problems, we have developed a framework which generates a JAVA archive that provides methods to query a given set of PROLOG rules; it ensures that valid knowledge bases are transmitted between JAVA and PROLOG. We use XML Schema for describing the format for exchanging a knowledge base between PROLOG and JAVA. From the XML Schema desciption, we scaffold JAVA classes; the JAVA programmer can use them and fill in the open slots by statements accessing other JAVA data structures. The data structure on the JAVA side reflects the complex structured knowledge base, with which the PROLOG rules work, in an object–oriented way. We can to some extend verify the correctness of the data set / knowledge base sent from JAVA to PROLOG using standard methods for XML Schema. Moreover, we can add constraints that go beyond XML. For instance, we can specify standard integrity constraints known from relational databases, such as primary key, foreign key, and not–null constraints. Since we are dealing with complex structured XML data, however, there can be far more general integrity constraints. These can be expressed by standard PROLOG rules, which can be evaluated on the PROLOG side; they could also be compiled to JAVA by available PROLOG to JAVA converters such as Prolog Cafe – since they will usually be written in a supported subset of PROLOG. We have used our framework for integrating PROLOG business rules into a commercial E–Commerce system written in JAVA.