Skip to main content
Previous section   

Generating Secondary Cubes for Use with iKnow

This appendix assumes that you have added an iKnow measure to a DeepSee cube (and created iKnow dimensions that use that measure), as described in the chapter “Using Unstructured Data in Cubes (iKnow).” This appendix describes how to generate secondary cubes that analyze entity occurrences and dictionary matching results. Always build the main cube before building these cubes.

The approach in this appendix is an alternative to using iKnow plugins as described in “Adding Measures to Quantify Entity Occurrences” and “Adding Measures to Quantify Matching Results,” in the chapter “Using Unstructured Data in Cubes (iKnow).” Plugins are a better approach, because the secondary cubes must be rebuilt manually whenever the main cube is rebuilt or synchronized.

Entity Occurrence Cube

To generate a cube that represents entity occurrences, use the following command in the Terminal:

 d ##class(%iKnow.DeepSee.CubeUtils).CreateEOCube(cubename,measurename)
Copy code to clipboard

Where cubename is the name of the cube that contains an iKnow measure, and measurename is the name of the iKnow measure.

This method generates a read-only class that provides access to the iKnow entity occurrence data, for benefit of the cube class. The entity occurrence class is named BaseCubeClass.measurename.EntityOccurrence, where BaseCubeClass is the class name of the base cube class and measurename is the name of the iKnow measure.

The method also generates the cube class: BaseCubeClass.measurename.EOCube. The new cube definition is as follows:

  • The logical name of the cube is BaseCubemeasurenameEO where BaseCube is the logical name of the base cube and measurename is the name of the iKnow measure.

  • This cube represents entity occurrences. That is, the fact table for this cube contains one row for each unique entity occurrence.

  • The cube defines the Count measure, which counts entity occurrences.

  • The cube defines the Entity Value dimension, which groups entity occurrences by entity value.

    This is a custom computed dimension; for general information on computed dimensions, see the chapter “Using Advanced Features of Cubes and Subject Areas.”

    For this cube, a fact represents an entity occurrence. Note that in this cube, there is a one-to-one relationship between facts and entity values. In contrast, in the main cube, there is a one-to-many relationship between facts and entity values.

  • The cube defines the Roles dimension, which has the members concept and relation. These members group the entity occurrences into iKnow concepts and iKnow relations. For information on these terms, see “Logical Text Units Identified by iKnow” in Using iKnow.

  • The cube includes a relationship to the base cube. This relationship is called Main cube.

The following shows an example pivot table that uses the entity occurrence cube for the Aviation demo:

images/d2modadv_iknow_eo_pivot.png

This pivot table is defined as follows:

  • The measure is Count (count of entity occurrences.)

  • The rows display members of the Entity Value dimension. Each member of this dimension represents an entity occurrence. For example, the pilot member represents each occurrence of the entity pilot in the sources.

  • The columns display members of the Category level of the Aircraft dimension in the main cube. Each member of this dimension represents the source documents associated with a given aircraft category.

This pivot table indicates, for example, that the entity airplane occurred 4980 times in the reports for events in the Airplane category.

Matching Results Cube

To generate a cube that represents matching results, use the following command in the Terminal:

 d ##class(%iKnow.DeepSee.CubeUtils).CreateMRCube(cubename,measurename)
Copy code to clipboard

Where cubename is the name of the cube that contains an iKnow measure, and measurename is the name of the iKnow measure.

This method generates a read-only class that provides access to the iKnow matching results data, for benefit of the cube class. The matching results class is named BaseCubeClass.measurename.MatchingResults, where BaseCubeClass is the class name of the base cube class and measurename is the name of the iKnow measure.

This method also generates the cube class: BaseCubeClass.measurename.MRCube. The new cube definition is as follows:

  • The logical name of the cube is BaseCubemeasurenameMR where BaseCube is the logical name of the base cube and measurename is the name of the iKnow measure.

  • This cube represents dictionary matches. That is, the fact table for this cube contains one row for each unique dictionary match.

  • The cube defines the Count measure, which counts dictionary matches.

  • The cube defines the Score measure, which shows the score of the dictionary matches.

  • The cube defines the Dictionary dimension. The Dictionary level groups matches by dictionary, and the Dictionary Item level groups matches by dictionary item.

    For this cube, a fact represents a matching result. Note that in this cube, there is a one-to-one relationship between facts and dictionary items. In contrast, in the main cube, there is a one-to-many relationship between facts and dictionary items.

  • The cube defines the Type dimension, which has the members entity, CRC, path, and sentence. These members group the matches into iKnow entities, CRCs, paths, and sentences. For information on these terms, see “Logical Text Units Identified by iKnow” in Using iKnow.

    For this demo, the Type dimension only has the members entity and CRC.

  • The cube includes a relationship to the base cube. This relationship is called Main cube.

The following shows an example pivot table that uses the matching results cube for the Aviation demo:

images/d2modadv_iknow_mr_pivot.png

This pivot table is defined as follows:

  • The measures are Count (count of matching results) and Score (cumulative score of the dictionary matches).

  • The rows display members of the Injuries dictionary. Each member of this dimension represents an entity that matches a specific item in this dictionary. For example, the minor member represents each entity in the sources that matches the dictionary item minor.

  • The columns display members of the Type dimension in the main cube. Each member of this dimension represents the source documents associated with a given report type, either Accident or Incident.

This pivot table indicates, for example, that the sources of type Incident contain zero matches for the dictionary item fatal. In contrast, the sources of type Accident contain 106 matches for this dictionary item.