001    /*
002     * The contents of this file are subject to the Mozilla Public
003     * License Version 1.1 (the "License"); you may not use this file
004     * except in compliance with the License. You may obtain a copy of
005     * the License at http://www.mozilla.org/MPL/
006     *
007     * Software distributed under the License is distributed on an "AS
008     * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
009     * implied. See the License for the specific language governing
010     * rights and limitations under the License.
011     *
012     * The Original Code is Knowtator.
013     *
014     * The Initial Developer of the Original Code is University of Colorado.  
015     * Copyright (C) 2005 - 2008.  All Rights Reserved.
016     *
017     * Knowtator was developed by the Center for Computational Pharmacology
018     * (http://compbio.uchcs.edu) at the University of Colorado Health 
019     *  Sciences Center School of Medicine with support from the National 
020     *  Library of Medicine.  
021     *
022     * Current information about Knowtator can be obtained at 
023     * http://knowtator.sourceforge.net/
024     *
025     * Contributor(s):
026     *   Philip V. Ogren <philip@ogren.info> (Original Author)
027     */
028    
029    package edu.uchsc.ccp.knowtator;
030    
031    import java.awt.Component;
032    import java.io.File;
033    import java.io.IOException;
034    import java.util.Arrays;
035    import java.util.Collection;
036    import java.util.HashSet;
037    import java.util.Iterator;
038    import java.util.Set;
039    
040    import javax.swing.JOptionPane;
041    
042    import org.apache.log4j.Logger;
043    
044    import edu.stanford.smi.protege.model.BrowserSlotPattern;
045    import edu.stanford.smi.protege.model.Cls;
046    import edu.stanford.smi.protege.model.Instance;
047    import edu.stanford.smi.protege.model.KnowledgeBase;
048    import edu.stanford.smi.protege.model.Project;
049    import edu.stanford.smi.protege.model.SimpleInstance;
050    import edu.stanford.smi.protege.model.Slot;
051    import edu.stanford.smi.protege.plugin.PluginUtilities;
052    import edu.stanford.smi.protege.ui.ProjectView;
053    import edu.stanford.smi.protege.util.CollectionUtilities;
054    import edu.stanford.smi.protege.util.ComponentUtilities;
055    import edu.uchsc.ccp.knowtator.util.ProjectUtil;
056    
057    public class KnowtatorProjectUtil {
058            public static final String KNOWTATOR_SUPPORT_CLS_NAME = "knowtator support class";
059    
060            public static final String KNOWTATOR_VERSION_CLS_NAME = "knowtator version";
061    
062            public static final String ANNOTATION_CLS_NAME = "knowtator annotation";
063    
064            public static final String ANNOTATED_MENTION_SLOT_NAME = "knowtator_annotated_mention";
065    
066            public static final String ANNOTATION_ANNOTATOR_SLOT_NAME = "knowtator_annotation_annotator";
067    
068            public static final String ANNOTATION_COMMENT_SLOT_NAME = "knowtator_annotation_comment";
069    
070            public static final String ANNOTATION_CREATION_DATE_SLOT_NAME = "knowtator_annotation_creation_date";
071    
072            public static final String ANNOTATION_SPAN_SLOT_NAME = "knowtator_annotation_span";
073    
074            public static final String ANNOTATION_TEXT_SLOT_NAME = "knowtator_annotation_text";
075    
076            public static final String ANNOTATION_TEXT_SOURCE_SLOT_NAME = "knowtator_annotation_text_source";
077    
078            public static final String SET_SLOT_NAME = "knowtator_set";
079    
080            public static final String MENTION_CLS_NAME = "knowtator mention";
081    
082            public static final String MENTION_ANNOTATION_SLOT_NAME = "knowtator_mention_annotation";
083    
084            public static final String CLASS_MENTION_CLS_NAME = "knowtator class mention";
085    
086            public static final String MENTION_CLASS_SLOT_NAME = "knowtator_mention_class";
087    
088            public static final String SLOT_MENTION_SLOT_NAME = "knowtator_slot_mention";
089    
090            public static final String INSTANCE_MENTION_CLS_NAME = "knowtator instance mention";
091    
092            public static final String MENTION_INSTANCE_SLOT_NAME = "knowtator_mention_instance";
093    
094            public static final String SLOT_MENTION_CLS_NAME = "knowtator slot mention";
095    
096            public static final String MENTION_SLOT_SLOT_NAME = "knowtator_mention_slot";
097    
098            public static final String MENTION_SLOT_VALUE_SLOT_NAME = "knowtator_mention_slot_value";
099    
100            public static final String MENTIONED_IN_SLOT_NAME = "knowtator_mentioned_in";
101    
102            public static final String COMPLEX_SLOT_MENTION_CLS_NAME = "knowtator complex slot mention";
103    
104            public static final String BOOLEAN_SLOT_MENTION_CLS_NAME = "knowtator boolean slot mention";
105    
106            public static final String FLOAT_SLOT_MENTION_CLS_NAME = "knowtator float slot mention";
107    
108            public static final String INTEGER_SLOT_MENTION_CLS_NAME = "knowtator integer slot mention";
109    
110            public static final String STRING_SLOT_MENTION_CLS_NAME = "knowtator string slot mention";
111    
112            public static final String TEXT_SOURCE_CLS_NAME = "knowtator text source";
113    
114            public static final String ANNOTATOR_CLS_NAME = "knowtator annotator";
115    
116            public static final String ANNOTATOR_ID_SLOT_NAME = "knowtator_annotator_id";
117    
118            public static final String HUMAN_ANNOTATOR_CLS_NAME = "knowtator human annotator";
119    
120            public static final String ANNOTATOR_AFFILIATION_SLOT_NAME = "knowtator_annotation_annotator_affiliation";
121    
122            public static final String ANNOTATOR_FIRST_NAME_SLOT_NAME = "knowtator_annotation_annotator_firstname";
123    
124            public static final String ANNOTATOR_LAST_NAME_SLOT_NAME = "knowtator_annotation_annotator_lastname";
125    
126            public static final String ANNOTATOR_TEAM_CLS_NAME = "knowtator annotator team";
127    
128            public static final String ANNOTATOR_TEAM_NAME_SLOT_NAME = "knowtator_annotator_team_name";
129    
130            public static final String ANNOTATOR_TEAM_MEMBERS_SLOT_NAME = "knowtator_annotator_team_members";
131    
132            public static final String DISPLAY_COLOR_CLS_NAME = "knowtator display color";
133    
134            public static final String DISPLAY_COLOR_B_SLOT_NAME = "knowtator_display_color_B";
135    
136            public static final String DISPLAY_COLOR_G_SLOT_NAME = "knowtator_display_color_G";
137    
138            public static final String DISPLAY_COLOR_NAME_SLOT_NAME = "knowtator_display_color_name";
139    
140            public static final String DISPLAY_COLOR_R_SLOT_NAME = "knowtator_display_color_R";
141    
142            public static final String SET_CLS_NAME = "knowtator set";
143    
144            public static final String SET_DESCRIPTION_SLOT_NAME = "knowtator_set_description";
145    
146            public static final String SET_NAME_SLOT_NAME = "knowtator_set_name";
147    
148            public static final String CONSENSUS_SET_CLS_NAME = "knowtator consensus set";
149    
150            public static final String CONSENSUS_SET_INDIVIDUAL_FILTER_SLOT_NAME = "knowtator_individual_filter";
151    
152            public static final String CONSENSUS_SET_CONSENSUS_FILTER_SLOT_NAME = "knowtator_consensus_filter";
153    
154            public static final String CONSENSUS_SET_TEAM_ANNOTATOR_SLOT_NAME = "knowtator_team_annotator";
155    
156            public static final String FILTER_CLS_NAME = "knowtator filter";
157    
158            public static final String FILTER_ANNOTATOR_SLOT_NAME = "knowtator_filter_annotator";
159    
160            public static final String FILTER_NAME_SLOT_NAME = "knowtator_filter_name";
161    
162            public static final String FILTER_SET_SLOT_NAME = "knowtator_filter_set";
163    
164            public static final String FILTER_TYPE_SLOT_NAME = "knowtator_filter_type";
165    
166            public static final String CONSENSUS_FILTER_CLS_NAME = "knowtator consensus filter";
167    
168            public static final String FILTER_TYPES_NOT_SELECTABLE_FROM_TEXT_VIEWER = "knowtator_types_not_selectable_from_text_viewer";
169    
170            public static final String COLOR_ASSIGNMENT_CLS_NAME = "knowtator color assignment";
171    
172            public static final String COLOR_CLASS_SLOT_NAME = "knowtator_color_class";
173    
174            public static final String DISPLAY_COLOR_SLOT_NAME = "knowtator_display_color";
175    
176            public static final String TSC_IMPLEMENTATIONS_CLS_NAME = "knowtator text source collection implementations";
177    
178            public static final String TSC_IMPLEMENTATION_SLOT_NAME = "knowtator_tsc_implementation";
179    
180            public static final String SELECTED_FILTERS_CLS_NAME = "knowtator selected filters";
181    
182            public static final String SELECTED_FILTERS_SLOT_NAME = "knowtator_selected_filters";
183    
184            public static final String SLOT_MATCHER_CONFIG_CLS_NAME = "knowtator slot matcher config";
185    
186            public static final String COMPLEX_SLOT_MATCH_CRITERIA_CLS_NAME = "knowtator complex slot match criteria";
187    
188            public static final String SIMPLE_SLOT_MATCH_CRITERIA_CLS_NAME = "knowtator simple slot match criteria";
189    
190            public static final String CLASS_MATCH_CRITERIA_SLOT_NAME = "knowtator_class_match_criteria";
191    
192            public static final String SLOT_MATCH_CRITERIA_SLOT_NAME = "knowtator_slot_match_criteria";
193    
194            public static final String SPAN_MATCH_CRITERIA_SLOT_NAME = "knowtator_span_match_criteria";
195    
196            public static final String SLOT_MATCHER_SLOT_SLOT_NAME = "knowtator_slot_matcher_slot";
197    
198            public static final String SLOT_MATCHER_SIMPLE_SLOTS_SLOT_NAME = "knowtator_slot_matcher_simple_slots";
199    
200            public static final String PROPOGATE_TRIVIAL_MATCH_SLOT_NAME = "knowtator_propogate_trivial_match";
201    
202            Cls knowtatorSupportCls;
203    
204            Cls annotationCls;
205    
206            Slot annotatedMentionSlot;
207    
208            Slot annotationAnnotatorSlot;
209    
210            Slot annotationCommentSlot;
211    
212            Slot annotationCreationDateSlot;
213    
214            Slot annotationSpanSlot;
215    
216            Slot annotationTextSlot;
217    
218            Slot annotationTextSourceSlot;
219    
220            Slot setSlot;
221    
222            Cls mentionCls;
223    
224            Slot mentionAnnotationSlot;
225    
226            Cls classMentionCls;
227    
228            Slot mentionClassSlot;
229    
230            Slot slotMentionSlot;
231    
232            Cls instanceMentionCls;
233    
234            Slot mentionInstanceSlot;
235    
236            Cls slotMentionCls;
237    
238            Slot mentionSlotSlot;
239    
240            Slot mentionSlotValueSlot;
241    
242            Slot mentionedInSlot;
243    
244            Cls complexSlotMentionCls;
245    
246            Cls booleanSlotMentionCls;
247    
248            Cls floatSlotMentionCls;
249    
250            Cls integerSlotMentionCls;
251    
252            Cls stringSlotMentionCls;
253    
254            Cls textSourceCls;
255    
256            Cls annotatorCls;
257    
258            Slot annotatorIDSlot;
259    
260            Cls humanAnnotatorCls;
261    
262            Slot annotatorAffiliationSlot;
263    
264            Slot annotatorFirstNameSlot;
265    
266            Slot annotatorLastNameSlot;
267    
268            Cls teamAnnotatorCls;
269    
270            Slot annotatorTeamNameSlot;
271    
272            Slot annotatorTeamMembersSlot;
273    
274            Cls displayColorCls;
275    
276            Slot displayColorBSlot;
277    
278            Slot displayColorGSlot;
279    
280            Slot displayColorNameSlot;
281    
282            Slot displayColorRSlot;
283    
284            Cls setCls;
285    
286            Slot setDescriptionSlot;
287    
288            Slot setNameSlot;
289    
290            Cls consensusSetCls;
291    
292            Slot consensusSetIndividualFilterSlot;
293    
294            Slot consensusSetConsensusFilterSlot;
295    
296            Slot consensusSetTeamAnnotatorSlot;
297    
298            Cls filterCls;
299    
300            Slot filterAnnotatorSlot;
301    
302            Slot filterNameSlot;
303    
304            Slot filterSetSlot;
305    
306            Slot filterTypeSlot;
307    
308            Slot filterTypesNotSelectableFromTextViewerSlot;
309    
310            Cls consensusFilterCls;
311    
312            Cls colorAssignmentCls;
313    
314            Slot colorClassSlot;
315    
316            Slot displayColorSlot;
317    
318            Cls tscImplementationsCls;
319    
320            Slot tscImplementationsSlot;
321    
322            Cls selectedFiltersCls;
323    
324            Slot selectedFiltersSlot;
325    
326            Cls complexSlotMatchCriteriaCls;
327    
328            Slot classMatchCriteriaSlot;
329    
330            Slot propogateTrivialMatchSlot;
331    
332            Slot slotMatcherSimpleSlotsSlot;
333    
334            Slot slotMatcherSlotSlot;
335    
336            Slot spanMatchCriteriaSlot;
337    
338            Cls simpleSlotMatchCriteriaCls;
339    
340            Cls slotMatcherConfigCls;
341    
342            Slot slotMatchCriteriaSlot;
343    
344            public static final String CONFIGURATION_CLS_NAME = "knowtator configuration";
345    
346            public static final String ACTIVE_FILTERS_SLOT_NAME = "knowtator_active_filters";
347    
348            public static final String COLOR_ASSIGNMENTS_SLOT_NAME = "knowtator_color_assignments";
349    
350            public static final String ROOT_CLSES_SLOT_NAME = "knowtator_root_clses";
351    
352            public static final String SELECTED_ANNOTATION_SET_SLOT_NAME = "knowtator_selected_annotation_set";
353    
354            public static final String SELECTED_ANNOTATOR_SLOT_NAME = "knowtator_selected_annotator";
355    
356            public static final String SELECTED_FILTER_SLOT_NAME = "knowtator_selected_filter";
357    
358            public static final String TOKEN_REGEX_SLOT_NAME = "knowtator_token_regex";
359    
360            public static final String FADE_UNSELECTED_ANNOTATIONS = "knowtator_fade_unselected_annotations";
361    
362            public static final String SUBTEXT_SLOT_SLOT_NAME = "knowtator_subtext_slot";
363    
364            Cls configurationCls;
365    
366            Slot activeFiltersSlot;
367    
368            Slot colorAssignmentsSlot;
369    
370            Slot rootClsesSlot;
371    
372            Slot selectedAnnotationSetSlot;
373    
374            Slot selectedAnnotatorSlot;
375    
376            Slot selectedFilterSlot;
377    
378            Slot tokenRegexSlot;
379    
380            Slot fadeUnselectedAnnotationsSlot;
381    
382            Slot subtextSlotSlot;
383    
384            public static final String KNOWTATOR_SUPPORT_CLASSES_VERSION = "KNOWTATOR_SUPPORT_CLASSES_VERSION";
385    
386            public static final String UNVERSIONED = "UNVERSIONED";
387    
388            public static final String V001 = "V001";
389    
390            public static final String V002 = "V002";
391    
392            public static final String V003 = "V003";
393    
394            public static final String V004 = "V004";
395    
396            public static final String V005 = "V005";
397    
398            public static final String V006 = "V006";
399    
400            public static final String V007 = "V007";
401    
402            public static final String CURRENT_VERSION = V007;
403    
404            public static final String VERSION_BEING_UPDATED = "VERSION_BEING_UPDATED";
405    
406            private static final Set<String> VALID_VERSIONS = new HashSet<String>();
407            static {
408                    for (String version : new String[] { V001, V002, V003, V004, V005, V006, V007 })
409                            VALID_VERSIONS.add(version);
410            }
411    
412            KnowledgeBase kb;
413    
414            String version = null;
415    
416            Logger logger = Logger.getLogger(KnowtatorProjectUtil.class);
417    
418            public KnowtatorProjectUtil(KnowledgeBase kb) {
419                    this(kb, null);
420            }
421    
422            public KnowledgeBase getKnowledgeBase() {
423                    return kb;
424            }
425    
426            /** Creates a new instance of KnowtatorKBUtil */
427            public KnowtatorProjectUtil(KnowledgeBase kb, Component parent) {
428                    this.kb = kb;
429                    version = getKnowtatorSupportClassesVersion();
430                    if (!isKnowtatorSupportClassesCurrent()) {
431                            logger.info("knowtator.pprj version is out of date: expected = " + CURRENT_VERSION + ", actual = "
432                                            + getKnowtatorSupportClassesVersion());
433                    } else { 
434                            logger.info("knowtator.pprj version is up-to-date: " + getKnowtatorSupportClassesVersion());
435                    }
436                    initKnowtatorFrames();
437                    initConfiguration();
438            }
439    
440            private void initConfiguration() {
441                    logger.debug("");
442                    SimpleInstance configuration = ProjectSettings.getActiveConfiguration(kb.getProject());
443                    if (configuration == null) {
444                            configuration = (SimpleInstance) kb.createInstance(null, configurationCls);
445                            ProjectSettings.setActiveConfiguration(kb.getProject(), configuration);
446                            JOptionPane.showMessageDialog(null, "The configuration information for Knowtator has been reset.\n"
447                                            + "To create color assignments, set the default annotator, or \n"
448                                            + "specify root classes please select Menu->Knowtator->Configure.\n"
449                                            + "For additional help please consult the online documentation at:\n"
450                                            + "http://knowtator.sourceforge.net//configure.shtml", "Configuration Reset",
451                                            JOptionPane.INFORMATION_MESSAGE);
452                            ProjectUtil.saveProject(kb.getProject());
453                            logger.debug("added new configuration and saved project");
454                    } else {
455                            logger.debug("annotation project has an active configuration: " + configuration.getName());
456                    }
457            }
458    
459            public String getKnowtatorSupportClassesVersion() {
460                    logger.debug("");
461                    if (version != null)
462                            return version;
463                    else
464                            return getKnowtatorSupportClassesVersion(kb);
465            }
466            
467            public static String getKnowtatorSupportClassesVersion(KnowledgeBase kb) {
468                    Instance versionInstance = kb.getInstance("knowtator_Instance_20002");
469                    if (versionInstance == null) {
470                            Cls knowtatorVersionCls = kb.getCls(KNOWTATOR_VERSION_CLS_NAME);
471                            if (knowtatorVersionCls != null) {
472                                    Collection versionInstances = kb.getInstances();
473                                    if (versionInstances != null && versionInstances.size() > 0) {
474                                            versionInstance = (SimpleInstance) CollectionUtilities.getFirstItem(versionInstances);
475                                    }
476                            }
477                    }
478                    if (versionInstance != null) {
479                            String version = (String) versionInstance.getDirectOwnSlotValue(kb.getSlot("version"));
480                            if (VALID_VERSIONS.contains(version)) {
481                                    return version;
482                            }
483                    }
484                    return UNVERSIONED;
485            }
486            
487            
488            public boolean isKnowtatorSupportClassesCurrent() {
489                    String version = getKnowtatorSupportClassesVersion();
490                    return version.equals(CURRENT_VERSION);
491            }
492            
493            public static boolean isKnowtatorSupportClassesCurrent(KnowledgeBase kb) {
494                    String version = getKnowtatorSupportClassesVersion(kb);
495                    return version.equals(CURRENT_VERSION);
496            }
497    
498            public static void updateKnowtatorProject(Project project) throws IOException {
499                    KnowledgeBase kb = project.getKnowledgeBase();
500                    String oldVersion = getKnowtatorSupportClassesVersion(kb);
501    
502                    // this code is needed to get from V002 to V003 of knowtator.pprj
503                    // is safe to keep in here for any upgrade
504                    Cls knowtatorSelectedFilters = kb.getCls("knowtator selected filters");
505                    if (knowtatorSelectedFilters != null) {
506                            Collection selectedFiltersInstances = kb.getInstances(knowtatorSelectedFilters);
507                            for (Iterator it = selectedFiltersInstances.iterator(); it.hasNext();) {
508                                    Instance instance = (Instance) it.next();
509                                    kb.deleteInstance(instance);
510                            }
511                    }
512    
513                    Slot knowtatorTextSourceAnnotationSlot = kb.getSlot("knowtator_text_source_annotation");
514                    if (knowtatorTextSourceAnnotationSlot != null) {
515                            kb.deleteSlot(knowtatorTextSourceAnnotationSlot);
516                    }
517    
518                    // this code is needed to remove any color assignments created with
519                    // colors that have been removed in
520                    // version V003 (and replaced with 141 new colors)
521                    if (oldVersion.equals(V003) || oldVersion.equals(V002) || oldVersion.equals(V001) || oldVersion.equals(V001)
522                                    || oldVersion.equals(UNVERSIONED)) {
523                            Cls colorAssignmentCls = kb.getCls("knowtator color assignment");
524                            if (colorAssignmentCls != null) {
525                                    Collection colorAssignments = kb.getInstances(colorAssignmentCls);
526                                    for (Iterator it = colorAssignments.iterator(); it.hasNext();) {
527                                            Instance instance = (Instance) it.next();
528                                            kb.deleteInstance(instance);
529                                    }
530                            }
531                    }
532                    ProjectUtil.saveProjectAs(kb.getProject(), new File(kb.getProject().getProjectURI()));
533                    
534            }
535    
536            public void displayAnnotationAuthor() {
537                    Cls annotationCls = getAnnotationCls();
538                    BrowserSlotPattern pattern = new BrowserSlotPattern(Arrays.asList(new Object[] { getAnnotationTextSlot(), " [",
539                                    getAnnotationAnnotatorSlot(), " : ", getSetSlot(), "]" }));
540                    annotationCls.setDirectBrowserSlotPattern(pattern);
541            }
542    
543            public SimpleInstance getShowAllFilter() {
544                    SimpleInstance showAllFilter = kb.getSimpleInstance("knowtator_Instance_0");
545                    return showAllFilter;
546            }
547    
548            public SimpleInstance getShowNoneFilter() {
549                    SimpleInstance showAllFilter = kb.getSimpleInstance("knowtator_Instance_20000");
550                    return showAllFilter;
551            }
552    
553            private void initKnowtatorFrames() {
554                    annotationCls = kb.getCls(ANNOTATION_CLS_NAME);
555                    annotatedMentionSlot = kb.getSlot(ANNOTATED_MENTION_SLOT_NAME);
556                    annotationAnnotatorSlot = kb.getSlot(ANNOTATION_ANNOTATOR_SLOT_NAME);
557                    annotationCommentSlot = kb.getSlot(ANNOTATION_COMMENT_SLOT_NAME);
558                    annotationCreationDateSlot = kb.getSlot(ANNOTATION_CREATION_DATE_SLOT_NAME);
559                    annotationSpanSlot = kb.getSlot(ANNOTATION_SPAN_SLOT_NAME);
560                    annotationTextSlot = kb.getSlot(ANNOTATION_TEXT_SLOT_NAME);
561                    annotationTextSourceSlot = kb.getSlot(ANNOTATION_TEXT_SOURCE_SLOT_NAME);
562                    setSlot = kb.getSlot(SET_SLOT_NAME);
563    
564                    mentionCls = kb.getCls(MENTION_CLS_NAME);
565                    mentionAnnotationSlot = kb.getSlot(MENTION_ANNOTATION_SLOT_NAME);
566                    classMentionCls = kb.getCls(CLASS_MENTION_CLS_NAME);
567                    mentionClassSlot = kb.getSlot(MENTION_CLASS_SLOT_NAME);
568                    slotMentionSlot = kb.getSlot(SLOT_MENTION_SLOT_NAME);
569                    instanceMentionCls = kb.getCls(INSTANCE_MENTION_CLS_NAME);
570                    mentionInstanceSlot = kb.getSlot(MENTION_INSTANCE_SLOT_NAME);
571                    slotMentionCls = kb.getCls(SLOT_MENTION_CLS_NAME);
572                    mentionSlotSlot = kb.getSlot(MENTION_SLOT_SLOT_NAME);
573                    mentionSlotValueSlot = kb.getSlot(MENTION_SLOT_VALUE_SLOT_NAME);
574                    mentionedInSlot = kb.getSlot(MENTIONED_IN_SLOT_NAME);
575                    complexSlotMentionCls = kb.getCls(COMPLEX_SLOT_MENTION_CLS_NAME);
576                    booleanSlotMentionCls = kb.getCls(BOOLEAN_SLOT_MENTION_CLS_NAME);
577                    floatSlotMentionCls = kb.getCls(FLOAT_SLOT_MENTION_CLS_NAME);
578                    integerSlotMentionCls = kb.getCls(INTEGER_SLOT_MENTION_CLS_NAME);
579                    stringSlotMentionCls = kb.getCls(STRING_SLOT_MENTION_CLS_NAME);
580    
581                    textSourceCls = kb.getCls(TEXT_SOURCE_CLS_NAME);
582    
583                    annotatorCls = kb.getCls(ANNOTATOR_CLS_NAME);
584                    annotatorIDSlot = kb.getSlot(ANNOTATOR_ID_SLOT_NAME);
585                    humanAnnotatorCls = kb.getCls(HUMAN_ANNOTATOR_CLS_NAME);
586                    annotatorAffiliationSlot = kb.getSlot(ANNOTATOR_AFFILIATION_SLOT_NAME);
587                    annotatorFirstNameSlot = kb.getSlot(ANNOTATOR_FIRST_NAME_SLOT_NAME);
588                    annotatorLastNameSlot = kb.getSlot(ANNOTATOR_LAST_NAME_SLOT_NAME);
589                    teamAnnotatorCls = kb.getCls(ANNOTATOR_TEAM_CLS_NAME);
590                    annotatorTeamNameSlot = kb.getSlot(ANNOTATOR_TEAM_NAME_SLOT_NAME);
591                    annotatorTeamMembersSlot = kb.getSlot(ANNOTATOR_TEAM_MEMBERS_SLOT_NAME);
592    
593                    displayColorCls = kb.getCls(DISPLAY_COLOR_CLS_NAME);
594                    displayColorBSlot = kb.getSlot(DISPLAY_COLOR_B_SLOT_NAME);
595                    displayColorGSlot = kb.getSlot(DISPLAY_COLOR_G_SLOT_NAME);
596                    displayColorNameSlot = kb.getSlot(DISPLAY_COLOR_NAME_SLOT_NAME);
597                    displayColorRSlot = kb.getSlot(DISPLAY_COLOR_R_SLOT_NAME);
598    
599                    setCls = kb.getCls(SET_CLS_NAME);
600                    setDescriptionSlot = kb.getSlot(SET_DESCRIPTION_SLOT_NAME);
601                    setNameSlot = kb.getSlot(SET_NAME_SLOT_NAME);
602                    consensusSetCls = kb.getCls(CONSENSUS_SET_CLS_NAME);
603                    consensusSetIndividualFilterSlot = kb.getSlot(CONSENSUS_SET_INDIVIDUAL_FILTER_SLOT_NAME);
604                    consensusSetConsensusFilterSlot = kb.getSlot(CONSENSUS_SET_CONSENSUS_FILTER_SLOT_NAME);
605                    consensusSetTeamAnnotatorSlot = kb.getSlot(CONSENSUS_SET_TEAM_ANNOTATOR_SLOT_NAME);
606    
607                    filterCls = kb.getCls(FILTER_CLS_NAME);
608                    filterAnnotatorSlot = kb.getSlot(FILTER_ANNOTATOR_SLOT_NAME);
609                    filterNameSlot = kb.getSlot(FILTER_NAME_SLOT_NAME);
610                    filterSetSlot = kb.getSlot(FILTER_SET_SLOT_NAME);
611                    filterTypeSlot = kb.getSlot(FILTER_TYPE_SLOT_NAME);
612                    filterTypesNotSelectableFromTextViewerSlot = kb.getSlot(FILTER_TYPES_NOT_SELECTABLE_FROM_TEXT_VIEWER);
613                    consensusFilterCls = kb.getCls(CONSENSUS_FILTER_CLS_NAME);
614    
615                    colorAssignmentCls = kb.getCls(COLOR_ASSIGNMENT_CLS_NAME);
616                    colorClassSlot = kb.getSlot(COLOR_CLASS_SLOT_NAME);
617                    displayColorSlot = kb.getSlot(DISPLAY_COLOR_SLOT_NAME);
618    
619                    tscImplementationsCls = kb.getCls(TSC_IMPLEMENTATIONS_CLS_NAME);
620                    tscImplementationsSlot = kb.getSlot(TSC_IMPLEMENTATION_SLOT_NAME);
621    
622                    selectedFiltersCls = kb.getCls(SELECTED_FILTERS_CLS_NAME);
623                    selectedFiltersSlot = kb.getSlot(SELECTED_FILTERS_SLOT_NAME);
624    
625                    complexSlotMatchCriteriaCls = kb.getCls(COMPLEX_SLOT_MATCH_CRITERIA_CLS_NAME);
626                    classMatchCriteriaSlot = kb.getSlot(CLASS_MATCH_CRITERIA_SLOT_NAME);
627                    propogateTrivialMatchSlot = kb.getSlot(PROPOGATE_TRIVIAL_MATCH_SLOT_NAME);
628                    slotMatcherSimpleSlotsSlot = kb.getSlot(SLOT_MATCHER_SIMPLE_SLOTS_SLOT_NAME);
629                    slotMatcherSlotSlot = kb.getSlot(SLOT_MATCHER_SLOT_SLOT_NAME);
630                    spanMatchCriteriaSlot = kb.getSlot(SPAN_MATCH_CRITERIA_SLOT_NAME);
631                    simpleSlotMatchCriteriaCls = kb.getCls(SIMPLE_SLOT_MATCH_CRITERIA_CLS_NAME);
632                    slotMatcherConfigCls = kb.getCls(SLOT_MATCHER_CONFIG_CLS_NAME);
633                    slotMatchCriteriaSlot = kb.getSlot(SLOT_MATCH_CRITERIA_SLOT_NAME);
634    
635                    configurationCls = kb.getCls(CONFIGURATION_CLS_NAME);
636                    activeFiltersSlot = kb.getSlot(ACTIVE_FILTERS_SLOT_NAME);
637                    colorAssignmentsSlot = kb.getSlot(COLOR_ASSIGNMENTS_SLOT_NAME);
638                    rootClsesSlot = kb.getSlot(ROOT_CLSES_SLOT_NAME);
639                    selectedAnnotationSetSlot = kb.getSlot(SELECTED_ANNOTATION_SET_SLOT_NAME);
640                    selectedAnnotatorSlot = kb.getSlot(SELECTED_ANNOTATOR_SLOT_NAME);
641                    selectedFilterSlot = kb.getSlot(SELECTED_FILTER_SLOT_NAME);
642                    tokenRegexSlot = kb.getSlot(TOKEN_REGEX_SLOT_NAME);
643                    fadeUnselectedAnnotationsSlot = kb.getSlot(FADE_UNSELECTED_ANNOTATIONS);
644                    subtextSlotSlot = kb.getSlot(SUBTEXT_SLOT_SLOT_NAME);
645            }
646    
647            public Cls getAnnotationCls() {
648                    return this.annotationCls;
649            }
650    
651            public Slot getAnnotatedMentionSlot() {
652                    return this.annotatedMentionSlot;
653            }
654    
655            public Slot getAnnotationAnnotatorSlot() {
656                    return this.annotationAnnotatorSlot;
657            }
658    
659            public Slot getAnnotationCommentSlot() {
660                    return this.annotationCommentSlot;
661            }
662    
663            public Slot getAnnotationCreationDateSlot() {
664                    return this.annotationCreationDateSlot;
665            }
666    
667            public Slot getAnnotationSpanSlot() {
668                    return this.annotationSpanSlot;
669            }
670    
671            public Slot getAnnotationTextSlot() {
672                    return this.annotationTextSlot;
673            }
674    
675            public Slot getAnnotationTextSourceSlot() {
676                    return this.annotationTextSourceSlot;
677            }
678    
679            public Slot getSetSlot() {
680                    return this.setSlot;
681            }
682    
683            public Cls getMentionCls() {
684                    return this.mentionCls;
685            }
686    
687            public Slot getMentionAnnotationSlot() {
688                    return this.mentionAnnotationSlot;
689            }
690    
691            public Cls getClassMentionCls() {
692                    return this.classMentionCls;
693            }
694    
695            public Slot getMentionClassSlot() {
696                    return this.mentionClassSlot;
697            }
698    
699            public Slot getSlotMentionSlot() {
700                    return this.slotMentionSlot;
701            }
702    
703            public Cls getInstanceMentionCls() {
704                    return this.instanceMentionCls;
705            }
706    
707            public Slot getMentionInstanceSlot() {
708                    return this.mentionInstanceSlot;
709            }
710    
711            public Cls getSlotMentionCls() {
712                    return this.slotMentionCls;
713            }
714    
715            public Slot getMentionSlotSlot() {
716                    return this.mentionSlotSlot;
717            }
718    
719            public Slot getMentionSlotValueSlot() {
720                    return this.mentionSlotValueSlot;
721            }
722    
723            public Slot getMentionedInSlot() {
724                    return this.mentionedInSlot;
725            }
726    
727            public Cls getComplexSlotMentionCls() {
728                    return this.complexSlotMentionCls;
729            }
730    
731            public Cls getBooleanSlotMentionCls() {
732                    return this.booleanSlotMentionCls;
733            }
734    
735            public Cls getFloatSlotMentionCls() {
736                    return this.floatSlotMentionCls;
737            }
738    
739            public Cls getIntegerSlotMentionCls() {
740                    return this.integerSlotMentionCls;
741            }
742    
743            public Cls getStringSlotMentionCls() {
744                    return this.stringSlotMentionCls;
745            }
746    
747            public Cls getTextSourceCls() {
748                    return this.textSourceCls;
749            }
750    
751            public Cls getAnnotatorCls() {
752                    return this.annotatorCls;
753            }
754    
755            public Cls getHumanAnnotatorCls() {
756                    return humanAnnotatorCls;
757            }
758    
759            public Cls getTeamAnnotatorCls() {
760                    return teamAnnotatorCls;
761            }
762    
763            public Slot getAnnotatorTeamMembersSlot() {
764                    return annotatorTeamMembersSlot;
765            }
766    
767            public Slot getAnnotatorTeamNameSlot() {
768                    return annotatorTeamNameSlot;
769            }
770    
771            public Cls getDisplayColorCls() {
772                    return this.displayColorCls;
773            }
774    
775            public Slot getDisplayColorBSlot() {
776                    return this.displayColorBSlot;
777            }
778    
779            public Slot getDisplayColorGSlot() {
780                    return this.displayColorGSlot;
781            }
782    
783            public Slot getDisplayColorNameSlot() {
784                    return this.displayColorNameSlot;
785            }
786    
787            public Slot getDisplayColorRSlot() {
788                    return this.displayColorRSlot;
789            }
790    
791            public Cls getSetCls() {
792                    return this.setCls;
793            }
794    
795            public Slot getSetDescriptionSlot() {
796                    return this.setDescriptionSlot;
797            }
798    
799            public Slot getSetNameSlot() {
800                    return this.setNameSlot;
801            }
802    
803            public Cls getConsensusSetCls() {
804                    return this.consensusSetCls;
805            }
806    
807            public Slot getConsensusSetConsensusFilterSlot() {
808                    return this.consensusSetConsensusFilterSlot;
809            }
810    
811            public Slot getConsensusSetIndividualFilterSlot() {
812                    return this.consensusSetIndividualFilterSlot;
813            }
814    
815            public Slot getConsensusSetTeamAnnotatorSlot() {
816                    return this.consensusSetTeamAnnotatorSlot;
817            }
818    
819            public Cls getFilterCls() {
820                    return this.filterCls;
821            }
822    
823            public Slot getFilterAnnotatorSlot() {
824                    return this.filterAnnotatorSlot;
825            }
826    
827            public Slot getFilterNameSlot() {
828                    return this.filterNameSlot;
829            }
830    
831            public Slot getFilterSetSlot() {
832                    return this.filterSetSlot;
833            }
834    
835            public Slot getFilterTypeSlot() {
836                    return this.filterTypeSlot;
837            }
838    
839            public Cls getConsensusFilterCls() {
840                    return this.consensusFilterCls;
841            }
842    
843            public Cls getColorAssignmentCls() {
844                    return this.colorAssignmentCls;
845            }
846    
847            public Slot getColorClassSlot() {
848                    return this.colorClassSlot;
849            }
850    
851            public Slot getDisplayColorSlot() {
852                    return this.displayColorSlot;
853            }
854    
855            public Slot getClassMatchCriteriaSlot() {
856                    return classMatchCriteriaSlot;
857            }
858    
859            public Cls getComplexSlotMatchCriteriaCls() {
860                    return complexSlotMatchCriteriaCls;
861            }
862    
863            public Slot getPropogateTrivialMatchSlot() {
864                    return propogateTrivialMatchSlot;
865            }
866    
867            public Cls getSimpleSlotMatchCriteriaCls() {
868                    return simpleSlotMatchCriteriaCls;
869            }
870    
871            public Slot getSlotMatchCriteriaSlot() {
872                    return slotMatchCriteriaSlot;
873            }
874    
875            public Cls getSlotMatcherConfigCls() {
876                    return slotMatcherConfigCls;
877            }
878    
879            public Slot getSlotMatcherSimpleSlotsSlot() {
880                    return slotMatcherSimpleSlotsSlot;
881            }
882    
883            public Slot getSlotMatcherSlotSlot() {
884                    return slotMatcherSlotSlot;
885            }
886    
887            public Slot getSpanMatchCriteriaSlot() {
888                    return spanMatchCriteriaSlot;
889            }
890    
891            public Slot getActiveFiltersSlot() {
892                    return activeFiltersSlot;
893            }
894    
895            public Slot getAnnotatorAffiliationSlot() {
896                    return annotatorAffiliationSlot;
897            }
898    
899            public Slot getAnnotatorFirstNameSlot() {
900                    return annotatorFirstNameSlot;
901            }
902    
903            public Slot getAnnotatorIDSlot() {
904                    return annotatorIDSlot;
905            }
906    
907            public Slot getAnnotatorLastNameSlot() {
908                    return annotatorLastNameSlot;
909            }
910    
911            public Slot getColorAssignmentsSlot() {
912                    return colorAssignmentsSlot;
913            }
914    
915            public Cls getConfigurationCls() {
916                    return configurationCls;
917            }
918    
919            public Cls getKnowtatorSupportCls() {
920                    return knowtatorSupportCls;
921            }
922    
923            public Slot getRootClsesSlot() {
924                    return rootClsesSlot;
925            }
926    
927            public Slot getSelectedAnnotationSetSlot() {
928                    return selectedAnnotationSetSlot;
929            }
930    
931            public Slot getSelectedAnnotatorSlot() {
932                    return selectedAnnotatorSlot;
933            }
934    
935            public Cls getSelectedFiltersCls() {
936                    return selectedFiltersCls;
937            }
938    
939            public Slot getSelectedFilterSlot() {
940                    return selectedFilterSlot;
941            }
942    
943            public Slot getSelectedFiltersSlot() {
944                    return selectedFiltersSlot;
945            }
946    
947            public Slot getTokenRegexSlot() {
948                    return tokenRegexSlot;
949            }
950    
951            public Cls getTscImplementationsCls() {
952                    return tscImplementationsCls;
953            }
954    
955            public Slot getTscImplementationsSlot() {
956                    return tscImplementationsSlot;
957            }
958    
959            public Slot getFilterTypesNotSelectableFromTextViewerSlot() {
960                    return filterTypesNotSelectableFromTextViewerSlot;
961            }
962    
963            public Slot getFadeUnselectedAnnotationsSlot() {
964                    return fadeUnselectedAnnotationsSlot;
965            }
966    
967            public Slot getSubtextSlotSlot() {
968                    return subtextSlotSlot;
969            }
970    
971    }