wiki:GritsTutorial_OntologyGritsSampleEditor

Sample Ontology

General Information

GRITS has a sample entry. This entry contains information related to samples. This entry is contributed and managed by Sample Plugin. The Sample plugin defines the properties of sample entry and other related information. This plugin also adds an editor for sample entry to display or modify sample information. An object that is used to represent a sample is stored in a .xml file. Read this to learn more about this Sample object. This object has a predefined model that is stored in the ontologies.

Currently there are two ontologies for Sample

  • Standard ontology
    • stores information related to samples that is to be used by the sample plugin
  • Local ontology
    • an additional ontology that has the same structure as the Standard ontology and has no additional information when GRITS is installed initially. When GRITS is used on a system, the information that is generated and saved is saved locally in this ontology.

Note:Classes that manage ontologies in Sample plugin are first supposed to look into the Standard ontology for any information and if some information is missing or additional information is required then it should look into the Local ontology.

Ontology Structure

Each of the ontology (Standard and Local ontology) have the structure as shown below:



Sample Ontology

For more details also look into the owl files in the sample plugin.

Classes in Sample plugin for Ontology management

Sample plugin can read information from the two ontologies. For writing it can only create templates in the local ontology. Reading and template creation is managed by the following classes that are in the ontologymanager package :

  • ISampleOntologyApi
    • interface that defines the public APIs to be provided by SampleOntologyApi class
  • SampleOntologyApi
    • implements the public methods defined in ISampleOntologyApi
    • calls methods from SampleOntologyManager class to read/write information in ontologies
  • SampleOntologyManager
    • uses Jena Ontology API to read/write information in ontologies
    • only protected and private methods
    • used by upper layer classes in the same package

Read Javadocs to learn more about specific methods

Sample plugin is not allowed to modify ontologies (except for creating templates in the local ontology) but there is another Sample Manager Plugin that can be used for editing information stored in the ontologies.

Sample Manager Plugin

The Sample Manager plugin is an additional plugin that can be used to edit information stored in ontologies. This plugin can modify both standard and local ontologies. It has two modes of operation :

  • User Mode
    • it displays both Standard and Local ontology
    • in this mode only Local ontology can be modified
  • Admin Mode
    • it only displays Standard ontology information
    • in this mode only Standard ontology can be modified

Updating ontologies

One can directly modify the ontologies that are there in the ontology folder of the org.grits.toolbox.entry.sample plugin. After updating an ontology submit it to the svn.

OR

One can also use the Sample Manager plugin to modify the ontologies. For modifying using the Sample Manager, follow the steps described below :

  • Clean the GRITS Sample config folder (.grits-toolbox/org.grits.toolbox.entry.sample folder in the home directory)
    • this would ensure that there are no previous local changes prior to modifying the ontology
  • Start a GRITS product that has the Sample Manager plugin
    • currently "Grits.all.dev.product" product file has the Sample Manager plugin while the main "Grits.all.product" product file for deployment does not include this plugin
  • After GRITS is started
    • use menu Manager->User Mode to modify the Local ontology
    • use menu Manager->Admin Mode to modify the Standard ontology
  • Save the changes in the editor
    • changes would be saved in the ontologies of GRITS Sample config folder (.grits-toolbox/org.grits.toolbox.entry.sample folder in the home directory)
      • when GRITS is started and it does not find the ontologies in the GRITS Sample config folder then it copies the two ontologies from sample plugin to GRITS Sample config folder
  • Copy back the ontologies from GRITS Sample config folder (.grits-toolbox/org.grits.toolbox.entry.sample folder in the home directory) to ontology folder of the "org.grits.toolbox.entry.sample" plugin
  • Update the files to svn
Last modified 5 years ago Last modified on 03/27/2017 11:00:32 PM

Attachments (2)

Download all attachments as: .zip