ProgramaticLuceneQueryAccess

From Protege Wiki
Revision as of 13:30, January 2, 2008 by Tredmond (talk | contribs) (New page: This note will describe how to programatically * generate lucene indicies for an ontology * make a phonetic query that uses the lucene indicies and * save the project to include the lucen...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This note will describe how to programatically

  • generate lucene indicies for an ontology
  • make a phonetic query that uses the lucene indicies and
  • save the project to include the lucene query tab.

The test code I used had the following structure:

    @SuppressWarnings("unchecked")
    public static void main(String args[]) {
        List errors = new ArrayList();
        Project project = new Project(PROJECT_FILE, errors);
        displayErrors(errors);
        OWLModel om = (OWLModel) project.getKnowledgeBase();

        indexOntology(om);
        testQuery(om);
        addTab(project);
    }

The first few lines just illustrate one of the standard ways of opening an ontology in Protege. The last three lines show the code that we will explain here.