Retrieving VIMS keywords for MBARI_Samples Database

VIMS keywords are retrieved from the MBARI knowledge base with routines named UpdateAllSampleKeywords.bat and UpdateSampleKeywords.bat. These routines are run from Windows 95 or NT. The knowledge base is on the Windows NT server Tienhou. The routines require that there be one or more records for a sample in the SeedConcept field of the SeedVIMSConcepts table in the MBARI_Samples database. The records must be spelled exactly as the concepts are spelled in the knowledge base (e.g., chiroteuthis-calyx); the "-1" is not required.

The purpose is to take keywords describing a specimen and "explode" up the inheritance hierarchy of the knowledge base so that specimens may be queried upon by higher level terms and common names. For instance, a specimen of Chiroteuthis calyx could be found with a query using the words ‘squid’ or ‘cephalopoda’, and a specimen of ‘granite’ could be found with a query on ‘igneous-rock’.

To run each routine:

  1. Open DOS window
  2. Go to P: (mapped to \\Tornado\Apps)
  3. cd to P:\Java\Itd\Samples
  4. Type "UpdateAllSampleKeywords.bat" to process all the records in the Sample table with KeywordLookupStatus not equal to 0. (0=Successful lookup, 1=needs lookup, 2=No Keywords found)
  5. Or type "UpdateSampleKeywords.bat 73" (or any other SampleID) to just have it perform on one sample.

  6. Terms from the knowledge base and the appropriate SampleID will be placed in the VIMSkeywords table.

The DOS bat scripts UpdateAllSampleKeywords.bat and UpdateSampleKeywords.bat execute the Java code UpdateAllSampleKeywords and UpdateSampleKeywords that utilizes the following classes, programs and routines:

  1. DbAnywhere (currently running on Rain) to talk to MS SQL
  2. rmi://Tienhou/KnowledgeBaseProxyFactory to talk to the VIMS Knowledge base
  3. Java packages org.mbari.vims.rmi.KnowledgeBaseService, org.mbari.itd.samples, and com.sun.java.util.collections

UpdateAllSampleKeywords does the following:

  1. For samples with KeywordLookupStatus not equal to 0, deletes all current VIMSKeywords entries from the table.
  2. For samples with KeywordLookupStatus not equal to 0, finds each corresponding SeedConcept from the SeedVIMSConcepts table (may be more than one).
  3. Looks in the knowledge base for the seed concept. Retrieves all parent concepts and common names (using the getAncestryAllNames method from the knowledgeBaseProxy class).
  4. Checks for duplicate terms and allows only unique terms for each SampleID.
  5. Populates the VIMSkeywords table with records for each seed concept and all terms above the seed concept in the hierarchy. Each term retrieved and corresponding SampleID populate the KeywordString and SampleID fields.
  6. Changes KeywordLookupStatus to 0 in records for which data was found. Changes to 2 in records for which data was not found.

UpdateSampleKeywords executes the above steps only for the specimen indicated by the SampleID ignoring KeywordLookupStatus.

»Next: Spreadsheet import

Last updated: 01 February 2005 by Jennifer Paduan
Copyright © 1998 MBARI