Inquisitor Template and Metafile Production

The first stage of the extraction process of Washability table data from the Mincom style database is performed using the Inquisitor utility (the Maptek relational query tool). This utility extracts data for a give size range etc. into a metafile. The metafile structure is a tabulated and annotated ASCII file which can be examined and edited if required.

Although editing of the metafile is not recommended. Leaving items out of the metafile, adding items to the metafile can cause the reading of the data to fail either catastrophically (i.e. being unable to be read) or subtly (i.e. items being read into incorrect variables).

Also, if the original data is not correct, it is far better to fix that up - which will stop future problems occurring - than to modify the abstracted form. The metafile are created as "temporary" files in the project directory and have the following structure:

Example: Metafile Structure

The fist three lines define the seam/ply and size range criteria that will be used to make the extraction. These are the:

  • SEAM_MATCH
  • PLY_MATCH
  • SIZE_RANGE

The following nested structure is repeated for all drillhole groups down the file.

Variable Description
HOLE_REC

Defines the start of a drillhole. This variable contains the following information:

  • Hole name.
  • Easting and Northing.
  • Collar RL.
  • Total depth.
SEAM_REC

Defines a name horizon in the drillhole. This variable contains the following information:

  • Seam name.
  • Ply name (if ply sub-divisions are used).
INTERCEPT

Defines an intercept in the horizon. The intercept refers to a depth based sample, taken from the horizon, which may or may not correspond to a lithological intercept.

This variable contains the following information:

  • Top and bottom depths of the intercept.
  • Sample number.
  • Coal type.
SIZE_FRAC

Defines a size fraction of the sample. This variable contains the following information:

  • The upper sieve size of the size fraction (it will not be larger than the upper value on the SIZE_RANGE record).
  • The lower sieve size of the size fraction (it will not be smaller than the lower value on the SIZE_RANGE record).
  • The yield of the sample represented by this size fraction (percent of total sample mass).
  • The raw RD of this size fraction (often not supplied with Mincom data).
Washability tables

Each table defines a washability analysis of that sample"s size fraction of the sample. There can be different tables because of duplicate analysis or if different density gradient structures were used.

The tables are defined by three record types:

  • A WASH_START record at the beginning of the table defining the first float fraction.
  • WASH_LINE records in the body of the table defining intermediate float fractions.
  • A WASH_END record at the end of the table defining either the last float fraction used or the sinks fraction.

The WASH_START, WASH_LINE and WASH_END records have the same structure with minor differences:

  • Lower RD value of the fraction (not present on WASH_START).
  • Upper RD value of the fraction (not present on WASH_END).
  • Mass yield of the fraction (% of the size fraction in this float fraction).
  • Four variable values determined from the material in this float fraction. If less than four variables were asked for, then the last variables values are repeated in the next columns.
  • On the WASH_START there may be a flag character "+" at the end of the line indicating that this is a cumulative washability table; that is the first stage of mathematical analysis has been performed in the lab and the values (yield and qualities) on each table line are cumulates up to and including the fraction, rather than just for the fraction in question.
EOF Indicates the real end of data.

From this raw data, the system composites one washability table for the size range wanted in "standard" washability fractions (refer to the Conversion Setup option) for each intercept in a horizon. These are then written to the Maptek Washability database.

If for any reason the supplied Inquisitor query script does not perform the required data extraction; for example a slightly different Mincom data structure, or different standard codes t specifying raw coal, etc., then you will have to supply another script template to perform the preferred extraction. However, the table extracted MUST match the structure of the standard metafile, as described above.

In order to produce this script, you will have to understand how to write an Inquisitor script and be able to use the meta-names that will be replaced by actual values on-the-fly as the extraction is performed. The default script is found in $VULCAN_FLIB and is called inquis_template.doc . It is a good idea NOT to modify this file, but to copy it to your project directory and make a modified copy there. Use this copy specified explicitly in your extraction (see Conversion Setup).

The default template script is shown here:-

QL_INITIALIZATION: 
// 
// Retrieves data from an Isis version of the MINCOM washability data 
// 
// Can set the seam, ply, and fraction size range wanted 
// 
#SEAM_MATCH:=("{seam_match}") 
#PLY_MATCH:=("{ply_match}") 
#SIZE_MINUS:=({size_minus})    
#SIZE_PLUS:=({size_plus}) 
PRINT "SEAM_MATCH:"%-12s #SEAM_MATCH%-12s 
PRINT "PLY_MATCH:"%-12s    #PLY_MATCH%-12s 
PRINT "SIZE_RANGE:"%-12s #SIZE_MINUS%9.2f #SIZE_PLUS%9.2f 
QL_QUERY:    
// 
// Any hole - selection handled by selection files 
// 
$HOLE:={header_record}:    ({holeid_field} == "*") 
#NEW_HOLE := (.TRUE.) 
// 
// Do required seam(s) 
// 
#LAST_SEAM:=("@@@@@@@@")    
#LAST_PLY:=("@@@@@@@@") 
// these two settings are not nec. but a just in case step 
#LAST_FROM := (-999.99) 
#LAST_TO := (-999.99) 
#LAST_SAMPLE := ("@@@@@@@@")    
$SAMPLE:= {sample_record}: ((((((({seam_field} == #SEAM_MATCH) && ({ply_field}    == #PLY_MATCH)) && 
        (({sam_coalty_field} == " ") || ({sam_coalty_field} == "+")))    && 
        ({sam_minus_field} == 0.0)) && ({sam_plus_field} == 0.0)) && 
        ({sam_sink_field}    == 0.0)) && 
        ({sam_float_field} == 0.0)) 
// Only an acceptable sample if the following criteria are set (see pp B22-B25) 
//      ((SEAM == #SEAM_MATCH) && (PLY    == #PLY_MATCH)) 
//      ((COALTY == " ") OR (COALTY == "+")) 
//      (MINUS == 0.0) 
//      (PLUS == 0.0) 
//      (SINK == 0.0) 
//      (FLOAT == 0.0) 
// 
IF ((#NEW_HOLE) || ((${sample_record}:{seam_field}    != #LAST_SEAM) || (${sample_record}:{ply_field} != 
#LAST_PLY))) THEN 
// we have found a new seam for this hole 
        #NEW_SEAM := (.TRUE.) 
        #LAST_SEAM := (${sample_record}:{seam_field})
        #LAST_PLY := (${sample_record}:{ply_field}) 
// therefore we must have a new intercept 
        #NEW_INTERCEPT := (.TRUE.) 
        #LAST_FROM := (${sample_record}:{from_field})
        #LAST_TO := (${sample_record}:{to_field})
        #LAST_SAMPLE := (${sample_record}:{sam_sampno_field})
ELSE 
        IF ((${sample_record}:{from_field} != #LAST_FROM) || (${sample_record}:{to_field} != #LAST_TO)) THEN 
          #NEW_INTERCEPT := (.TRUE.)
          #LAST_FROM := (${sample_record}:{from_field})
          #LAST_TO := (${sample_record}:{to_field})
          #LAST_SAMPLE := (${sample_record}:{sam_sampno_field})    
        ELSE 
// It is sensible to assume that one sample number ONLY codes for one 
// depth range!! But BHP are not always sensible!! When we get here, it should   
// be that we have only the COALTY different i.e. the same sample number. But,    
// we have found data that does not follow this logic - and need to cope with it 
// hence:- 
        IF (${sample_record}:{sam_sampno_field} != #LAST_SAMPLE) THEN    
          #NEW_INTERCEPT := (.TRUE.) 
          #LAST_SAMPLE := (${sample_record}:{sam_sampno_field})    
// last depths are already set 
  ENDIF 
 ENDIF 
ENDIF 
// 
// If there is a washability analysis available 
// 
$WASH:= {wash_record}: ((((({wsh_sampno_field} == ${sample_record}:{sam_sampno_field})    && 
        ({wsh_coalty_field} == ${sample_record}:{sam_coalty_field})) && 
        ({fsflag_field}    == "{fltsnkflag_value}")) && 
        ({status_field} == " ")) && 
        (({wsh_minus_field}    <= #SIZE_MINUS) && ({wsh_plus_field} >= #SIZE_PLUS))) 
// Only an acceptable wash if the following criteria are set (see pp B26-B28) 
// (SAMPLE == $SAMPLE:SAMPLE)    
// (COALTY == $SAMPLE:COALTY) 
// (FLFLAG == "F") 
// (STATUS == " ") 
// ((MINUS    <= #SIZE_MINUS) && (PLUS >= #SIZE_PLUS)) 
// We could use our matching KEY field (SAMPLE/COALTY) but this is better 
// in that it uses standard MINCOM (BHP) data (SAMPLE and COALTY separate) 
// 
IF (#NEW_SEAM || #NEW_INTERCEPT) THEN 
//    We must have a new size interval 
 #NEW_SIZE := (.TRUE.) 
 #LAST_MINUS := (${wash_record}:{wsh_minus_field})
 #LAST_PLUS := (${wash_record}:{wsh_plus_field}) 
ELSE
 IF ((${wash_record}:{wsh_minus_field} != #LAST_MINUS) || (${wash_record}:{wsh_plus_field} != 
#LAST_PLUS)) THEN 
   #NEW_SIZE    := (.TRUE.) 
   #LAST_MINUS := (${wash_record}:{wsh_minus_field}) 
   #LAST_PLUS :=    (${wash_record}:{wsh_plus_field}) 
 ENDIF 
ENDIF 
// 
// The output settings 
// 
// Need these lines as have to set variables outside of execute section 
#PRINT_HOLE    := (#NEW_HOLE) 
#NEW_HOLE := (.FALSE.) 
#PRINT_SEAM := (#NEW_SEAM) 
#NEW_SEAM :=    (.FALSE.) 
#PRINT_INTERCEPT := (#NEW_INTERCEPT) 
#NEW_INTERCEPT := (.FALSE.) #PRINT_SIZE    := (#NEW_SIZE) 
#NEW_SIZE := (.FALSE.) 
// 
// The output 
// 
E_IF (#PRINT_HOLE) THEN 
// A new hole 
  PRINT "HOLE_REC:"%-12s 
         $HOLE:{holeid_field}%-17s 
         $HOLE:{east_field}%12.3f    
         $HOLE:{north_field}%12.3f 
         $HOLE:{rl_field}%9.2f 
         $HOLE:{totdep_field}%9.2f 
ENDIF    
E_IF (#PRINT_SEAM) THEN 
// A new seam 
  PRINT "SEAM:"%-12s 
         #LAST_SEAM%-12s 
         #LAST_PLY%-12s    
ENDIF 
E_IF (#PRINT_INTERCEPT) THEN 
// A new intercept depth range for this seam (therefore a new sample) 
  PRINT "INTERCEPT:"%-12s 
         #LAST_FROM%9.2f 
         #LAST_TO%9.2f    " "%s 
         $WASH:{wsh_sampno_field}%-10s 
         $WASH:{wsh_coalty_field}%-2s 
ENDIF 
E_IF (#PRINT_SIZE) THEN 
// A new size fraction of this sample 
  PRINT "SIZE_FRAC:"%-12s    
         $WASH:{wsh_minus_field}%9.2f 
         $WASH:{wsh_plus_field}%9.2f 
         $WASH:{sampyld_field}%9.2f    
         $WASH:{rawrd_field}%9.2f 
ENDIF 
E_IF ($WASH:{wsh_sink_field} == 0.0) THEN 
// Start of a wash table 
  PRINT "WASH_START:"%-12s " "%9s 
         $WASH:{wsh_float_field}%9.2f    
         $WASH:{yield_field}%9.2f 
         $WASH:{var1_field}%9.2f 
         $WASH:{var2_field}%9.2f 
         $WASH:{var3_field}%9.2f    
         $WASH:{var4_field}%9.2f " "%s 
         $WASH:{wsh_coalty_field}%-2s 
ELSE 
 E_IF ($WASH:{wsh_float_field} == 0.0) THEN 
// End of a wash table 
  PRINT "WASH_END:"%-12s 
         $WASH:{wsh_sink_field}%9.2f " "%9s 
         $WASH:{yield_field}%9.2f 
         $WASH:{var1_field}%9.2f 
         $WASH:{var2_field}%9.2f    
         $WASH:{var3_field}%9.2f 
         $WASH:{var4_field}%9.2f 
ELSE // Just an entry in a table    
  PRINT "WASH_LINE:"%-12s 
         $WASH:{wsh_sink_field}%9.2f 
         $WASH:{wsh_float_field}%9.2f    
         $WASH:{yield_field}%9.2f 
         $WASH:{var1_field}%9.2f 
         $WASH:{var2_field}%9.2f 
         $WASH:{var3_field}%9.2f    
         $WASH:{var4_field}%9.2f 
 ENDIF 
ENDIF 
QL_FINALIZATION: 
PRINT "EOF:"%-12s 
EOF 

Note the differences from a standard Inquisitor script. There are meta-variables defined between left and right brace characters ("{] and "}"). These characters do not form part of the Inquisitor syntax, but are used in the template to enclose the meta-name of a variable that will be replaced (along with the braces) at run time. The names of the meta variables are used to define values you entered from the set up which are specific to your data.

There are:

  • Record names, field names, and field contents values set up as part of the Source DB Setup option.
  • Horizon match names and Size match names from Data Selection Criteria as part of the Conversion Setup option.
  • Field names set up as part of the Conversion Setup in Variable Selection Table set up.

The valid meta-names are shown in the table below:

Meta-Name Variable Which Replaces it at Run Time (from panel where it was entered)
seam_match Seam match on Data Selection Criteria
ply_match Ply match on Data Selection Criteria
size_minus Minus size match on Data Selection Criteria
size_plus Plus size match on Data Selection Criteria
header_record Drill hole header record on Source DB Setup
holeid_field Hole name field on Source DB Setup
east_field Easting field on Source DB Setup
north_field Northing field on Source DB Setup
rl_field Collar RL field on Source DB Setup
totdep_field Total depth field on Source DB Setup
sample_record Sample advice record on Source DB Setup
sam_sampno_field Sample number field under sample record on Source DB Setup
sam_coalty_field Coal type field under sample record on Source DB Setup
from_field Top depth field on Source DB Setup
to_field Bottom depth field on Source DB Setup
seam_field Seam field on Source DB Setup
ply_field Ply field on Source DB Setup
sam_minus_field Minus size field under sample record on Source DB Setup
sam_plus_field Plus size field under sample record on Source DB Setup
sam_sink_field Sink SG field under sample record on Source DB Setup
sam_float_field Float SG field under sample record on Source DB Setup
wash_record Washability data record on Source DB Setup
wsh_sampno_field Sample number field under washability record on Source DB Setup
wsh_coalty_field Coal type field under washability record on Source DB Setup
fsflag_field Gravity separation flag field on Source DB Setup
fltsnkflag_field Value indicating gravity separation on Source DB Setup
rawrd_field Raw rd field on Source DB Setup
status_field Status field on Source DB Setup
wsh_minus_field Minus size field under washability record on Source DB Setup
wsh_plus_field Plus size field under washability record on Source DB Setup
sampyld_field Size fraction mass yield field on Source DB Setup
wsh_sink_field Sink SG field under washability record on Source DB Setup
wsh_float_field Float SG field under washability record on Source DB Setup
yield_field Wash fraction mass yield field on Source DB Setup
var1_field Quality variable 1 Field name given on Variables Required table
var2_field Quality variable 2 Field name given on Variables Required table
var3_field Quality variable 3 Field name given on Variables Required table
var4_field Quality variable 4 Field name given on Variables Required table

The template file is read and copied to a file called .inquis in the project directory with the meta-names translated as defined above. This file is temporary and will be overwritten each time these specifications are used. However, if you modify or create your own template, then it is useful to be able to examine this script to ensure that the template and translation has occurred correctly.

When the Inquisitor run is performed it will produce a error file ( .inq_err ) which contains details of all of the errors encountered during the run. This file should be empty normally.

If errors are encountered, then the system should normally show you the contents of this file automatically. However, if you have written your own script, which does not appear to be working, check the contents of this file in case the system is omitting to show it to you.