Class ExternalAPI

java.lang.Object
fr.inria.rules.integraal.api.external.ExternalAPI
Direct Known Subclasses:
MyAwfulTests, MyAwfulTests2

public class ExternalAPI extends Object
Defines external access to the internal API services. The purpose is to enable the use of the internal API services offered by InteGraal without directly manipulating InteGraal objects. All elements manipulated by InteGraal will be designated here by names (String). The proposed functionalities enable the management of fact bases, rule bases, and queries, performing saturation, rewriting rules, querying a knowledge base, extracting rules, unfolding rules, transforming rules, and executing queries with different options.
Author:
Jean-François Baget, Carole Beaugeois, Pierre Bisquert, Michel Leclère, Federico Ulliana
  • Field Details

    • DEFAULT_ENV

      public static String DEFAULT_ENV
      Default environment created at class initialization time.
  • Constructor Details

    • ExternalAPI

      protected ExternalAPI()
      Protected constructor for subclasses and compatibility helpers.
  • Method Details

    • createEnvironment

      public static String createEnvironment(String envKey)
      Creates a new environment, storing both the registries required to access InteGraal objects stored by their name, and the IntegraalEnvironment required to load and write those objects. In two distinct environments, a predicate with same name can have different arities, and two distinct rules can have the same name. Note that nothing can be done by the external API without an existing environment. A universal, static DEFAULT_ENV is provided.
      Parameters:
      envKey - the name given to the environment, used to retrieve all objects created and manipulated in this environment. If the given envKey is the empty String, a new one will be generated. If the given envKey already points to an existing environment, an error will be indicated in the EUA string.
      Returns:
      an EUA string (the string representation of a JSON object). In case of success (result field = 1), the EUA string will be such as {"result":1,"data":{"envname":"E1"},"message":""}, where data.envname property indicates the name finally associated with the created environment. While in case of failure, the EUA string will be similar to {"result":-2,"data":{},"message":"Duplicate key for distinct objects E1"}
    • deleteEnvironment

      public static void deleteEnvironment(String envKey)
      Deletes an environment.
      Parameters:
      envKey - the environment name.
    • exploreAllEnvironments

      public static List<String> exploreAllEnvironments()
      Lists all available environments.
      Returns:
      the list of environment names.
    • createFactBase

      public static String createFactBase(String envKey, String fbName, String dlgpe)
      Creates a new FactBase.
      Parameters:
      envKey - the key to the environment in which the FactBase is created.
      fbName - the name that will be given to the created FactBase. Note that this name may conflict with the dlgpe naming of the FactBase (generating an error). A safe way is to use the empty string as fbName to let an automatic generation of the fbname which is then read from DLGPE file or obtain from a safe name generation.
      dlgpe - the dlgpe string representing the FactBase. Note that there must be a single FactBase, whose atoms are separated by commas, and ending with a period. Its name can be indicated in the string, such as in [F] p(a, b), p(b, X)..
      Returns:
      an EUA string (the string representation of a JSON object). In case of success (result field = 1), the EUA string will be such as {"result":1,"data":{"fbname":"FB:1772562638165_2"},"message":""}, while in case of failure, the EUA string will be similar to {"result":-4,"data":{},"message":"Unwanted item p(c)"}
    • createFactBaseFromMerge

      public static String createFactBaseFromMerge(String envKey, String fbName, String dlgpe)
      Creates a new FactBase.
      Parameters:
      envKey - the key to the environment in which the FactBase is created.
      fbName - the name that will be given to the created FactBase. Here the dlgpe string can encode many FactBases (each FactBase ending with a period) whose dlgpe naming will be lost.
      dlgpe - the dlgpe string representing 0 or more FactBases. Atoms in each FactBase are separated by commas, and FactBases are ending with a period. Note that variable names are local to each FactBase, and are thus renamed when merging in a single FactBase to avoid conflicts.
      Returns:
      an EUA string (the string representation of a JSON object). In case of success (result field = 1), the EUA string will be such as {"result":1,"data":{"fbname":"FB:1772562638165_2"},"message":""}, while in case of failure, the EUA string will be similar to {"result":-4,"data":{},"message":"Unwanted item ?(X) :- q(X)"}
    • exportFactBase

      public static String exportFactBase(String envKey, String fbName)
      Exports a fact base.
      Parameters:
      envKey - the environment name.
      fbName - the fact base name.
      Returns:
      an EUA string describing the exported fact base.
    • copyFactBase

      public static String copyFactBase(String envKey, String fbName)
      Copies a fact base.
      Parameters:
      envKey - the environment name.
      fbName - the fact base name.
      Returns:
      an EUA string describing the copied fact base.
    • deleteFactBase

      public static String deleteFactBase(String envKey, String name)
      Deletes a fact base.
      Parameters:
      envKey - the environment name.
      name - the fact base name.
      Returns:
      an EUA string describing the deletion result.
    • exploreAllFactBases

      public static String exploreAllFactBases(String envKey)
      Lists all fact bases in an environment.
      Parameters:
      envKey - the environment name.
      Returns:
      an EUA string containing the registered fact base names.
    • existFactBase

      public static String existFactBase(String envKey, String name)
      Checks whether a fact base exists.
      Parameters:
      envKey - the environment name.
      name - the fact base name.
      Returns:
      an EUA string describing whether the fact base exists.
    • isEmptyFactBase

      public static String isEmptyFactBase(String envKey, String name)
      Checks whether a fact base is empty.
      Parameters:
      envKey - the environment name.
      name - the fact base name.
      Returns:
      an EUA string describing whether the fact base is empty.
    • addToFactBase

      public static String addToFactBase(String envKey, String fbName, String dlgpe)
      Adds data to a fact base.
      Parameters:
      envKey - the environment name.
      fbName - the fact base name.
      dlgpe - the DLGPE content to add.
      Returns:
      an EUA string describing the merge result.
    • addToFactBase

      public static String addToFactBase(String envKey, String fbName, String dlgpe, String jsSubst, boolean freeze)
      Adds data to a fact base with substitution and freezing options.
      Parameters:
      envKey - the environment name.
      fbName - the fact base name.
      dlgpe - the DLGPE content to add.
      jsSubst - the substitution encoded as JSON.
      freeze - whether to freeze the added data.
      Returns:
      an EUA string describing the merge result.
    • removeFromFactBase

      public static String removeFromFactBase(String env, String name, String dlgpe, String jsSubst)
      Removes data from a fact base.
      Parameters:
      env - the environment name.
      name - the fact base name.
      dlgpe - the DLGPE content to remove.
      jsSubst - the substitution encoded as JSON.
      Returns:
      an EUA string describing the removal result.
    • createFactBaseCollection

      public static String createFactBaseCollection(String envKey, String fbcName, String dlgpe)
      Creates a fact base collection.
      Parameters:
      envKey - the environment name.
      fbcName - the collection name.
      dlgpe - the DLGPE content.
      Returns:
      an EUA string describing the created collection.
    • exportFactBaseCollection

      public static String exportFactBaseCollection(String env, String name)
      Exports a fact base collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the exported collection.
    • deleteFactBaseCollection

      public static String deleteFactBaseCollection(String env, String name)
      Deletes a fact base collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the deletion result.
    • exploreAllFactBaseCollections

      public static String exploreAllFactBaseCollections(String env)
      Lists all fact base collections in an environment.
      Parameters:
      env - the environment name.
      Returns:
      an EUA string containing the collection names.
    • existFactBaseCollection

      public static String existFactBaseCollection(String envKey, String name)
      Checks whether a fact base collection exists.
      Parameters:
      envKey - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing whether the collection exists.
    • isEmptyFactBaseCollection

      public static String isEmptyFactBaseCollection(String envKey, String name)
      Checks whether a fact base collection is empty.
      Parameters:
      envKey - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing whether the collection is empty.
    • exploreFactBaseCollection

      public static String exploreFactBaseCollection(String env, String name)
      Explores a fact base collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the collection content.
    • existInFactBaseCollection

      public static String existInFactBaseCollection(String envKey, String fbName, String fbCollectionName)
      Checks whether a fact base belongs to a fact base collection.
      Parameters:
      envKey - the environment name.
      fbName - the fact base name.
      fbCollectionName - the collection name.
      Returns:
      an EUA string describing whether the fact base belongs to the collection.
    • addFactBase

      public static String addFactBase(String env, String fbCollection, String fb)
      Adds a fact base to a fact base collection.
      Parameters:
      env - the environment name.
      fbCollection - the collection name.
      fb - the fact base name.
      Returns:
      an EUA string describing the add result.
    • removeFactBase

      public static String removeFactBase(String env, String fbcollection, String fb)
      Removes a fact base from a fact base collection.
      Parameters:
      env - the environment name.
      fbcollection - the collection name.
      fb - the fact base name.
      Returns:
      an EUA string describing the removal result.
    • mergeFactBaseCollection

      public static String mergeFactBaseCollection(String env, String base, String other)
      Merges two fact base collections.
      Parameters:
      env - the environment name.
      base - the target collection name.
      other - the source collection name.
      Returns:
      an EUA string describing the merge result.
    • copyFactBaseCollection

      public static String copyFactBaseCollection(String env, String name)
      Copies a fact base collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the copied collection.
    • createRule

      public static String createRule(String env, String name, String dlgp)
      Creates a rule.
      Parameters:
      env - the environment name.
      name - the rule name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created rule.
    • exploreAllRules

      public static String exploreAllRules(String env)
      Lists all rules in an environment.
      Parameters:
      env - the environment name.
      Returns:
      an EUA string containing the rule names.
    • existRule

      public static String existRule(String envKey, String rName)
      Checks whether a rule exists.
      Parameters:
      envKey - the environment name.
      rName - the rule name.
      Returns:
      an EUA string describing whether the rule exists.
    • exportRule

      public static String exportRule(String env, String name)
      Exports a rule.
      Parameters:
      env - the environment name.
      name - the rule name.
      Returns:
      an EUA string describing the exported rule.
    • copyRule

      public static String copyRule(String env, String name)
      Copies a rule.
      Parameters:
      env - the environment name.
      name - the rule name.
      Returns:
      an EUA string describing the copied rule.
    • deleteRule

      public static String deleteRule(String env, String name)
      Deletes a rule.
      Parameters:
      env - the environment name.
      name - the rule name.
      Returns:
      an EUA string describing the deletion result.
    • createRuleBase

      public static String createRuleBase(String env, String name, String dlgp)
      Creates a rule base.
      Parameters:
      env - the environment name.
      name - the rule base name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created rule base.
    • exportRuleBase

      public static String exportRuleBase(String env, String name)
      Exports a rule base.
      Parameters:
      env - the environment name.
      name - the rule base name.
      Returns:
      an EUA string describing the exported rule base.
    • exploreAllRuleBases

      public static String exploreAllRuleBases(String env)
      Lists all rule bases in an environment.
      Parameters:
      env - the environment name.
      Returns:
      an EUA string containing the rule base names.
    • existRuleBase

      public static String existRuleBase(String envKey, String name)
      Checks whether a rule base exists.
      Parameters:
      envKey - the environment name.
      name - the rule base name.
      Returns:
      an EUA string describing whether the rule base exists.
    • isEmptyRuleBase

      public static String isEmptyRuleBase(String envKey, String name)
      Checks whether a rule base is empty.
      Parameters:
      envKey - the environment name.
      name - the rule base name.
      Returns:
      an EUA string describing whether the rule base is empty.
    • exploreRuleBase

      public static String exploreRuleBase(String env, String name)
      Explores a rule base.
      Parameters:
      env - the environment name.
      name - the rule base name.
      Returns:
      an EUA string describing the rule base content.
    • existInRuleBase

      public static String existInRuleBase(String envKey, String ruleName, String ruleBaseName)
      Checks whether a rule belongs to a rule base.
      Parameters:
      envKey - the environment name.
      ruleName - the rule name.
      ruleBaseName - the rule base name.
      Returns:
      an EUA string describing whether the rule belongs to the rule base.
    • deleteRuleBase

      public static String deleteRuleBase(String env, String name)
      Deletes a rule base.
      Parameters:
      env - the environment name.
      name - the rule base name.
      Returns:
      an EUA string describing the deletion result.
    • addRule

      public static String addRule(String env, String rulebase, String rule)
      Adds a rule to a rule base.
      Parameters:
      env - the environment name.
      rulebase - the rule base name.
      rule - the rule name.
      Returns:
      an EUA string describing the add result.
    • removeRuleBase

      public static String removeRuleBase(String env, String rulebase, String rule)
      Removes a rule from a rule base.
      Parameters:
      env - the environment name.
      rulebase - the rule base name.
      rule - the rule name.
      Returns:
      an EUA string describing the removal result.
    • mergeRuleBase

      public static String mergeRuleBase(String env, String base, String other)
      Merges two rule bases.
      Parameters:
      env - the environment name.
      base - the target rule base name.
      other - the source rule base name.
      Returns:
      an EUA string describing the merge result.
    • copyRuleBase

      public static String copyRuleBase(String env, String name)
      Copies a rule base.
      Parameters:
      env - the environment name.
      name - the rule base name.
      Returns:
      an EUA string describing the copied rule base.
    • createQuery

      public static String createQuery(String env, String name, String dlgp)
      Creates a query.
      Parameters:
      env - the environment name.
      name - the query name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created query.
    • exploreAllQueries

      public static String exploreAllQueries(String env)
      Lists all queries in an environment.
      Parameters:
      env - the environment name.
      Returns:
      an EUA string containing the query names.
    • exportQuery

      public static String exportQuery(String env, String name)
      Exports a query.
      Parameters:
      env - the environment name.
      name - the query name.
      Returns:
      an EUA string describing the exported query.
    • existQuery

      public static String existQuery(String envKey, String name)
      Checks whether a query exists.
      Parameters:
      envKey - the environment name.
      name - the query name.
      Returns:
      an EUA string describing whether the query exists.
    • copyQuery

      public static String copyQuery(String env, String name)
      Copies a query.
      Parameters:
      env - the environment name.
      name - the query name.
      Returns:
      an EUA string describing the copied query.
    • deleteQuery

      public static String deleteQuery(String env, String name)
      Deletes a query.
      Parameters:
      env - the environment name.
      name - the query name.
      Returns:
      an EUA string describing the deletion result.
    • createQueryCollection

      public static String createQueryCollection(String env, String name, String dlgp)
      Creates a query collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created collection.
    • exportQueryCollection

      public static String exportQueryCollection(String env, String name)
      Exports a query collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the exported collection.
    • exploreAllQueryCollections

      public static String exploreAllQueryCollections(String env)
      Lists all query collections in an environment.
      Parameters:
      env - the environment name.
      Returns:
      an EUA string containing the collection names.
    • existQueryCollection

      public static String existQueryCollection(String envKey, String name)
      Checks whether a query collection exists.
      Parameters:
      envKey - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing whether the collection exists.
    • isEmptyQueryCollection

      public static String isEmptyQueryCollection(String envKey, String name)
      Checks whether a query collection is empty.
      Parameters:
      envKey - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing whether the collection is empty.
    • exploreQueryCollection

      public static String exploreQueryCollection(String env, String name)
      Explores a query collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the collection content.
    • existInQueryCollection

      public static String existInQueryCollection(String envKey, String queryName, String queryCollectionName)
      Checks whether a query belongs to a query collection.
      Parameters:
      envKey - the environment name.
      queryName - the query name.
      queryCollectionName - the collection name.
      Returns:
      an EUA string describing whether the query belongs to the collection.
    • deleteQueryCollection

      public static String deleteQueryCollection(String env, String name)
      Deletes a query collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the deletion result.
    • copyQueryCollection

      public static String copyQueryCollection(String env, String name)
      Copies a query collection.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the copied collection.
    • addQuery

      public static String addQuery(String env, String queryCollection, String query)
      Adds a query to a query collection.
      Parameters:
      env - the environment name.
      queryCollection - the collection name.
      query - the query name.
      Returns:
      an EUA string describing the add result.
    • removeQuery

      public static String removeQuery(String env, String qcollection, String query)
      Removes a query from a query collection.
      Parameters:
      env - the environment name.
      qcollection - the collection name.
      query - the query name.
      Returns:
      an EUA string describing the removal result.
    • mergeQueryCollection

      public static String mergeQueryCollection(String env, String base, String other)
      Merges two query collections.
      Parameters:
      env - the environment name.
      base - the target collection name.
      other - the source collection name.
      Returns:
      an EUA string describing the merge result.
    • createAll

      public static String createAll(String env, String fbname, String rbname, String qcname, String dlgp)
      Creates a fact base, a rule base, and a query collection from a single input.
      Parameters:
      env - the environment name.
      fbname - the fact base name.
      rbname - the rule base name.
      qcname - the query collection name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created objects.
    • createAllFromFile

      public static String createAllFromFile(String env, String fbname, String rbname, String qcname, String dlgp)
      Creates a fact base, a rule base, and a query collection from a file.
      Parameters:
      env - the environment name.
      fbname - the fact base name.
      rbname - the rule base name.
      qcname - the query collection name.
      dlgp - the input file path or content identifier.
      Returns:
      an EUA string describing the created objects.
    • evaluate

      public static String evaluate(String env, String fbn, String qn, String an, String params)
      Evaluates a query against a fact base.
      Parameters:
      env - the environment name.
      fbn - the fact base name.
      qn - the query name.
      an - the answer iterator name.
      params - the reasoning parameters.
      Returns:
      an EUA string describing the evaluation result.
    • evaluate

      public static String evaluate(String env, String fbn, String qn, String pre, String an, String params)
      Evaluates a query against a fact base with a preprocessing object.
      Parameters:
      env - the environment name.
      fbn - the fact base name.
      qn - the query name.
      pre - the preprocessing or compilation name.
      an - the answer iterator name.
      params - the reasoning parameters.
      Returns:
      an EUA string describing the evaluation result.
    • nextAnswer

      public static String nextAnswer(String env, String an, String params)
      Retrieves the next answer from an answer iterator.
      Parameters:
      env - the environment name.
      an - the answer iterator name.
      params - the iterator parameters.
      Returns:
      an EUA string describing the next answer.
    • defaultChase

      public static String defaultChase(String env, String fbn, String rbn, String params)
      Executes the default chase.
      Parameters:
      env - the environment name.
      fbn - the fact base name.
      rbn - the rule base name.
      params - the chase parameters.
      Returns:
      an EUA string describing the chase result.
    • createCompilation

      public static String createCompilation(String env, String rbn, String compilationType)
      Creates a compilation for a rule base.
      Parameters:
      env - the environment name.
      rbn - the rule base name.
      compilationType - the compilation type.
      Returns:
      an EUA string describing the created compilation.
    • compiledRewrite

      public static String compiledRewrite(String env, String query, String compilation)
      Rewrites a query using a precomputed compilation.
      Parameters:
      env - the environment name.
      query - the query name or query content.
      compilation - the compilation name.
      Returns:
      an EUA string describing the rewriting result.
    • rewrite

      public static String rewrite(String env, String qn, String rbn)
      Rewrites a query with a rule base.
      Parameters:
      env - the environment name.
      qn - the query name.
      rbn - the rule base name.
      Returns:
      an EUA string describing the rewriting result.
    • rewrite

      public static String rewrite(String env, String query, String rbn, String compilationType)
      Rewrites a query with a rule base and a compilation type.
      Parameters:
      env - the environment name.
      query - the query name or query content.
      rbn - the rule base name.
      compilationType - the compilation type.
      Returns:
      an EUA string describing the rewriting result.
    • createAnalyser

      public static String createAnalyser(String env, String rbn)
      Creates an analyser for a rule base.
      Parameters:
      env - the environment name.
      rbn - the rule base name.
      Returns:
      an EUA string describing the created analyser.
    • createFactBaseOld

      @Deprecated public static String createFactBaseOld(String env, String name, String dlgp)
      Deprecated.
      Creates a fact base using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the fact base name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created fact base.
    • exportFactBaseOld

      @Deprecated public static String exportFactBaseOld(String env, String name)
      Deprecated.
      Exports a fact base using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the fact base name.
      Returns:
      an EUA string describing the exported fact base.
    • createRuleBaseOld

      @Deprecated public static String createRuleBaseOld(String env, String name, String dlgp)
      Deprecated.
      Creates a rule base using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the rule base name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created rule base.
    • exportRuleBaseOld

      @Deprecated public static String exportRuleBaseOld(String env, String name)
      Deprecated.
      Exports a rule base using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the rule base name.
      Returns:
      an EUA string describing the exported rule base.
    • createQueryCollectionOld

      @Deprecated public static String createQueryCollectionOld(String env, String name, String dlgp)
      Deprecated.
      Creates a query collection using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the collection name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created collection.
    • exportQueryCollectionOld

      @Deprecated public static String exportQueryCollectionOld(String env, String name)
      Deprecated.
      Exports a query collection using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the exported collection.
    • exploreQueryCollectionOld

      @Deprecated public static String exploreQueryCollectionOld(String env, String name)
      Deprecated.
      Explores a query collection using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the collection name.
      Returns:
      an EUA string describing the collection content.
    • createQueryOld

      @Deprecated public static String createQueryOld(String env, String name, String dlgp)
      Deprecated.
      Creates a query using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the query name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created query.
    • exportQueryOld

      @Deprecated public static String exportQueryOld(String env, String name)
      Deprecated.
      Exports a query using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the query name.
      Returns:
      an EUA string describing the exported query.
    • extendQueryOld

      @Deprecated public static String extendQueryOld(String env, String base, String other)
      Deprecated.
      Merges queries using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      base - the target query name.
      other - the source query name.
      Returns:
      an EUA string describing the merge result.
    • createRuleOld

      @Deprecated public static String createRuleOld(String env, String name, String dlgp)
      Deprecated.
      Creates a rule using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the rule name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created rule.
    • exportRuleOld

      @Deprecated public static String exportRuleOld(String env, String name)
      Deprecated.
      Exports a rule using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      name - the rule name.
      Returns:
      an EUA string describing the exported rule.
    • createAllOld

      @Deprecated public static String createAllOld(String env, String fbname, String rbname, String qcname, String dlgp)
      Deprecated.
      Creates all main objects using the deprecated DLGP-based API.
      Parameters:
      env - the environment name.
      fbname - the fact base name.
      rbname - the rule base name.
      qcname - the query collection name.
      dlgp - the DLGP content.
      Returns:
      an EUA string describing the created objects.