Creating AQL Modules or Scripts

About this task

The Extraction Tasks and Extraction Plan that are part of the Eclipse Text Analytics Workflow perspective create and manage your extractor. Use the AQL rules and the templates that are automatically generated based on your rule selection to design how to extract information. At a high level, a rule is a requirement that is built by using AQL constructs. For example, BandMember followed within 30 characters by Instrument is a rule that can be built in the AQL extractor.

Procedure

  1. From the Eclipse workbench, right-click a resource in the Package Explorer, and select New > Other.
  2. Depending on what you want to do, complete one of the following set of actions:
    Option Description
    Creating AQL Modules

    In its source form, an AQL module is a collection of AQL script files, dictionary files, or binary UDF JAR files that are grouped under a folder with the same name as the module. In its compiled form, an AQL module is represented by <moduleName>.tam files. The TAM file contains the compiled operator graph, compiled dictionaries (if any), UDF JAR files (if any), and module metadata. AQL modules facilitate modularity and reusability of AQL code. AQL modules help build reusable text extractors that can compose complex Text Analytics applications.

    This feature can be used only for modular projects.
    1. In the Select a wizard window, click BigInsights > AQL Module, then click Next.
    2. In the New AQL module window, select a project, specify a module name, and click Finish. The new module appears in the Text Analytics source directory of the selected project in the Project Explorer and Package Explorer. This action does not create any AQL files inside the new AQL module. To start adding rules to the AQL module, you must create an AQL script file.
    Creating AQL Scripts

    An AQL script is an AQL file that contains AQL statements. An AQL script is often called an AQL file. An extractor can consist of one or more AQL files and associated dictionaries and UDF JAR files. AQL files can only reside in AQL modules.

    To create AQL scripts:
    • In the Select a wizard window, click BigInsights > AQL Script, and click Next.
    • For non-modular projects, in the New AQL Script window, select a folder to contain the new AQL file, specify a file name with an .aql extension, and click Finish. The new AQL file displays in the selected project in the Project Explorer and Package Explorer.
    • For modular projects, in the New AQL Script window, select a project and specify a module name and file name with an .aql extension, and click Finish. If the module that you specify does not exist, this action creates the module. The new AQL file displays in the selected module in the Project Explorer and Package Explorer.

Results

For more information about the AQL editing environment, see the AQL Editor. For more information about writing AQL code, see the AQL Reference.