Introduction

This document is a section of the Programmer's Guide.

The LexEVS APIs fall into three primary categories:

Core Services

The LexBIGService illustrated below provides central entry points for programmatic access to system features and data. Some of the features are:

This graphic shows the LexBIGServices with some of the features listed above.

The following are the components of interest:

Service Extensions

Provides registration and lookup for pluggable system features.

This graphic shows the extensionRegistery interface with a Extendable interface.

The following are the components of interest:

Query Extensions

Query extensions provide the ability to further constrain or manage query results. For details on the LexEVS v5.1 Query Extension, see the document section Query Services Extension.

This graphic shows the Extendable Comparable Sort interface with an Extendable Filter interface.

The following are the components of interest:

Load Extensions

Load extensions are responsible for the validation and import of content to the LexEVS repository. Vocabularies may be imported from a variety of formats including LexGrid canonical XML, NCI Thesaurus (OWL), and NCI MetaThesaurus (UMLS RRF). For details on LexEVS loaders and the Loader Framework, see the Loader Guide. The following graphic shows Loader interface with the LexGridLeader, NCI_MetaThesaurusLoader, UMLS_Loader, Metadata_Loader, OBOHistoryLoader, OBO_Loader, NCIHistoryLoader, OWL_Loader, and the Text_Loader feeding into the Loader interface.

This graphic shows Loader interface as described above.

The following are the components of interest:

Export Extensions

Export extensions are responsible for the export of content from the LexEVS repository to other representative vocabulary formats.

This graphic shows the Exporter interface with the components described below.

The following are the components of interest:

Index Extensions

Index extensions are built to optimize the finding, sorting and matching of query results.

This graphic shows the IndexLoader interface and the Index interface as described below.

The following are the components of interest:

It is the responsibility of the loader to properly interpret each index it services by name, version, and provider.

Generic Extensions

Generic extensions provides a mechanism to register application-specific extensions for reference and reuse.

This graphic shows the GenericExtensions Extendable interface and the components as described below.

The following are the components of interest:

Utilities

Defines helper classes externalized by the LexEVS API.

Iterators

Iterators are used to provide controlled resolution of query results.

This graphic shows the Iterators and the components as described below.

The following are the components of interest:

Search Algorithms

The following are supported LexEVS Search Algorithms.

Search Algorithm

    Name: LuceneQuery
    Version: 1.0
    Description: Search with the Lucene query syntax.  
    See http://lucene.apache.org/java/2_3_2/queryparsersyntax.html)

Search Algorithm

    Name: DoubleMetaphoneLuceneQuery
    Version: 1.0
    Description: Search with the Lucene query syntax, using a 'sounds like' algorithm.  
    A search for 'atack' will get a hit on 'attack'  
    See http://lucene.apache.org/java/2_3_2/queryparsersyntax.html)

Search Algorithm

    Name: StemmedLuceneQuery
    Version: 1.0
    Description: Search with the Lucene query syntax, using stemmed terms.  
    A search for 'trees' will get a hit on 'tree'  
    See http://lucene.apache.org/java/2_3_2/queryparsersyntax.html)

Search Algorithm

    Name: startsWith
    Version: 1.0
    Description: Equivalent to 'term*' (case insensitive)

Search Algorithm

    Name: exactMatch
    Version: 1.0
    Description: Exact match (case insensitive)

Search Algorithm

    Name: contains
    Version: 1.0
    Description: Equivalent to '* term* *' - in other words - a trailing wildcard on a term 
    (but no leading wild card) and the term can appear at any position.

Search Algorithm

    Name: RegExp
    Version: 1.0
    Description: A Regular Expression query.  Searches against the lowercased text, so a 
    regular expression that specifies an uppercase character will never return a match.  
    Additionally, this searches against the entire string as a single token, rather than 
    the tokenized string - so write your regular expression accordingly.  
    Supported syntax is documented here: 
    http://jakarta.apache.org/regexp/apidocs/org/apache/regexp/RE.html

Additional Utility Classes

It is highly recommended that all LexEVS programmers familiarize themselves with the classes contained in the org.LexGrid.LexBIG.Utility package. Many useful features are provided in an effort to increase approachability of the API and assist the programmer in common tasks.

This package currently contains the following classes:

Code Examples

Concept Resolution

Programmers access coded concepts by acquiring first a node set or graph. After specifying optional restrictions, the nodes in this set or graph can be resolved as a list of ConceptReference objects which in turn contain references to one or more Concept objects. The following example provides a simple query of concept codes:

Service Metadata Retrieval

The LexEVS system maintains service metadata which can provide client programs with information about code system content and assigned copyright/licensing information. Below is an brief example showing how to access and print some of this metadata:

Combinatorial Queries

One of the most powerful features of the LexEVS architecture is the ability to define multiple search and sort criteria without intermediate retrieval of data from the LexEVS service. Consider the following code snippet:

This example shows a simple yet powerful query to search a code system based on a 'sounds like' match algorithm (the list of all available match algorithms can be listed using the 'ListExtensions -m' admin script).

Additional Resources

Reserved for links to Code Snippets and Overview of the Software.

LexEVS GUI

The LexEVS Graphical User Interface, or GUI, is an optional component of the LexEVS install which will be in the /gui folder of the base LexEVS installation (see file breakdown in Overview of the Software). The GUI is meant to provide a simple tool to test LexEVS API methods and quickly view the results; almost all public methods defined by the LexEVS API are supported. This guide provides a brief overview of how the GUI can aid programmers in writing code to the LexEVS API.

The LexEVS GUI supports both administrative and test functions. Please refer to the LexEVS Administrator's Guide for instructions on using the GUI as an administration tool.

Launching the GUI

Depending on the operating systems that you selected at installation time, you should have one or more of the following programs in the /gui folder:

Linux_64-lbGUI.sh		Linux-lbGUI.sh	
OSX-lbGUI.command		Windows-lbGUI.bat

Launch the GUI by executing the appropriate script for your platform. You will be presented with an application that looks like this:

Overview

The upper section of the GUI shows all of the code systems currently loaded, along with corresponding metadata. The lower section of the GUI is used to combine, restrict and resolve Code Sets and Code Graphs.

The lower left section is where you can perform Boolean logic on Code Sets and Code Graphs. The lower right section is where you can introduce restrictions on Code Sets and Code Graphs and browse results.

The menu options are used primarily for administrative functions and are covered in detail by the LexEVS 5.x Administration Guide. In addition, all of the disabled buttons in the top half of the application are used for administrative functions, and are also described in the Administration Guide.

Creating New Queries

There are four buttons on the top half that are of interest for creating queries.

Customizing Queries

After selecting a code system and clicking on Get Code Set or Get Code Graph, a row will be added to the lower left section of the GUI for each click. There are seven buttons in the lower left section that allow combinatorial logic between the code sets in the lower left.

The lower right section of the GUI is used to apply restrictions to Code Sets or Code Graphs, and set the variables that need to be passed into the resolve method.

Working with Code Sets

If a Code Set is selected in the lower left Select CodedNodeSets and CodedNodeGraphs, then the lower right section will look like this:

This screenshow shows the CodedNodeSets and CodedNodeGraphics panel with the O(CS) Automobiles 1.0 selected.

In the lower right section, there are two halves - the top half and the bottom half. The top half is used to apply restrictions. The bottom half provides query options and resolution.

Working with Code Graphs

If you select a Coded Node Graph in the lower left section of the LexEVS GUI, the lower right section, Restrictions, will look like this:

This screenshot shows 1(CG) Automobiles 1.0 selected and and the Relation Container in the Restrictions highlighted.

Again, there are two halves to the lower right section. The top half allows restrictions to be applied to the selected Code Graph, and it works the same as it does for a Coded Node Set. Please see the section above on applying restrictions to a Coded Node Set.

The lower half provides additional variables applicable when resolving a Coded Node Graph. For further explanation of these options, refer to the LexEVS API documentation.

Viewing Query Results

Clicking on the Resolve buttons for either a Coded Node Set or a Coded Node Graph will bring up the Result Browser window:

The left side shows a list of all the concept codes returned. When a concept code is selected on the left, the upper right will show a full description of the selected code. The lower right will show a graph view of the neighboring concepts.

When a Coded Node Graph is resolved, the result viewing window will look like this (this is the same Code System as above):

The left side still has a list of all of the concepts in the graph. The upper right will give a description of the selected concept. The lower right shows the entire graph.

The lower right section is adjustable, and dynamic. It responds to mouse clicks, dragging, and numerous key combinations. Beyond a depth of 3, the graph may "collapse" and not show all of the nodes until you click on a node. Clicking on a node will cause it to expand out and display its children. Here are a list of key combinations recognized by the graph viewer:

Value Domain Services

For details about LexEVS Value Domain Services, see LexEVS Value Domain Services

Pick List Services

For details about LexEVS Pick List Services, see LexEVS Pick List Services