Page History
Scrollbar | ||
---|---|---|
|
Page info | ||||
---|---|---|---|---|
|
This document is intended for developers looking for more information regarding the LexEVS API.
Panel | ||||
---|---|---|---|---|
| ||||
|
Software Requirements
Information regarding the software requirements LexEVS can be found in the WIP Format LexEVS 5.x Installation Guide.
Setting up your Environment
Information regarding the installation and configuration of the LexEVS environment can be found in the WIP Format LexEVS 5.x Installation Guide.
LexEVS API
Programming interfaces for the system fall into three primary categories:
- Core Services - Includes the LexBIGService, LexBIGServiceManager, CodedNodeSet and CodedNodeGraph classes, which provide the initial entry points for programmatic access to all system features and data.
- Service Extensions - The extension mechanism provides for pluggable system features. Current extension points allow for the introduction of custom load and indexing mechanisms, unique query sort and filter mechanisms, and generic functional extensions which can be advertised for availability to client programs.
- Utilities - Utility classes, such as those implementing iterator support, are provided by the system to provide convenience and optimize the handling of resources accessed through the runtime.
Core Services
Provides central entry points for programmatic access to system features and data.
...
- CodedNodeGraph - A virtual graph where the edges represent associations and the nodes represent concept codes. A CodedNodeGraph describes a graph that can be combined with other graphs, queried or resolved into an actual graph rendering.
- CodedNodeSet - A coded node set represents a flat list of coded entries.
- LexBIGService - This interface represents the core interface to a LexEVS service.
- LexBIGServiceManager - The service manager provides a single write and update access point for all of a service's content. The service manager allows new coding schemes to be validated and loaded, existing coding schemes to be retired and removed and the status of various coding schemes to be updated and changed.
- LexBIGServiceMetadata - Interface to perform system-wide query over optionally loaded metadata for loaded code systems and providers.
Service Extensions
Provides registration and lookup for pluggable system features.
...
- ExtensionRegistry - Allows registration and lookup of implementers for extensible pieces of the LexEVS architecture.
- Extendable - Marks a class as an extension to the LexEVS application programming interface. This allows for centralized registration, lookup, and access to defined functions.
Query Extensions
Query extensions provide the ability to further constrain or manage query results.
...
- Filter - Allows for additional filtering of query results.
- Sort - Allows for unique sorting of query results. This interface provides a comparator to evaluate order of any two given items from the result set.
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).
...
- Loader - The loader interface validates and/or loads content for a service.
- LexGrid_Loader - Validates and/or loads content provided in the LexGrid canonical XML format.
- NCI_MetaThesaurusLoader - Validates and/or loads the complete NCI MetaThesaurus. Content is supplied in RRF format. Note: To load individual coding schemes, consider using the UMLS_Loader as an alternative.
- OBO_Loader - Validates and/or loads content provided in Open Biomedical Ontologies (OBO) text format.
- OWL_Loader - Validates and/or loads content provided in Web Ontology Language (OWL) XML format. Note that for LexEVS phase 1 this loader is designed to specifically handle the NCI Thesaurus as provided in OWL format.
- Text_Loader - A loader for delimited text type files. Text files come in one of two formats: indented code/designation pair or indented code/designation/description triples.
- UMLS_Loader - Load one or more coding schemes from UMLS RRF format stored in a SQL database.
- MetaData_Loader - Validates and/or loads content provided in metadata xml format. The only requirement of the xml file is that it be a valid xml file.
- NCIHistoryLoader - A loader that takes the delimited NCI history file and applies it to a coding scheme.
- OBOHistoryLoader - Load an OBO change history file.
Export Extensions
Export extensions are responsible for the export of content from the LexEVS repository to other representative vocabulary formats.
...
- Exporter - Defines a class of object used to export content from the underlying LexGrid repository to another repository or file format.
- LexGrid_Exporter - Exports content to LexGrid canonical XML format.
- OBO_Exporter - Exports content to OBO text format.
- OWL_Exporter - Exports content to OWL XML format.
Index Extensions
Index extensions are built to optimize the finding, sorting and matching of query results.
...
- Index - Identifies expected behavior and an associated loader to build and maintain a named index. Note that a single loader may be used to maintain multiple named indexes.
- IndexLoader - Manages registered index extensions. A single loader may be used to create and maintain multiple indexes over one or more coding schemes. 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.
...
- GenericExtension - The generic extension class. Classes that implement this class are accessible via the LexBIGService interface.
- LexBIGServiceConvenienceMethods - Convenience methods to be implemented as a generic extension of the LexEVS API.
Utilities
Defines helper classes externalized by the LexEVS API.
Iterators
Iterators are used to provide controlled resolution of query results.
...
- EntityListIterator - Generic interface for flexible resolution of LexEVS objects.
- ResolvedConceptReferencesIterator - An iterator for retrieving resolved coding scheme references.
Search Algorithms
Supported LexEVS Search Algorithms
...
Code Block |
---|
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:
- Constructors - Helper class to ease creating common objects.
- ConvenienceMethods - One-stop shopping for convenience methods that have been implemented against the LexEVS API.
- LBConstants - Provides constants for use in the LexEVS API.
- ObjectToString - Provides centralized formatting of LexEVS Objects to String representations.
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:
Include Page | ||||
---|---|---|---|---|
|
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:
Include Page | ||||
---|---|---|---|---|
|
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).
Declaring the Target Concept Space
The coded node set (variable 'cns') is initially declared to query the NCI Thesaurus vocabulary. At this point the concept space included by the set can be thought of as unrestricted, addressing every defined coded entry (the 'false' value on the declaration indicates to also include inactive concepts). However, it important to note that no search is performed by the LexEVS service at this time.
Applying Filter Criteria
Similarly, no computation is performed (to realize query results) during invocation of the restrictToMatchingDesignations()
and restrictToMatchingProperties()
methods. However, these calls effectively narrow the target space even further, indicating that filters should be applied to the information returned by the LexEVS query service.
Using the Lucene Query Syntax and Other Text Matching Functions
The text criteria applied in methods such as restrictToMatchingDesignations()
uses one of a number of powerful text processing applications to provide the user with broad capability for text based searches. Text matches can be simple applications of exactMatch, startsWith or contains algorithms as well as powerful regular expressions and Lucene Query syntax (used in the LuceneQuery function.) As shown above these options are passed into the restrictToMatchingDesignations()
Method as parameters.
...
Likewise you should not expect to see a Lucene Query narrow down search results as you progressively enter a longer substring more closely matching your term of interest. Instead use the contains method.
Applying Sorting Criteria
Multiple sort algorithms can be applied to control the order of items returned. In this case, we indicate that results are to be sorted based on primary and secondary criteria. The "matchToQuery" algorithm indicates to sort the result according to best match as determined by the search engine. The "code" item indicates to perform a secondary sort based on concept code.
Info | ||
---|---|---|
| ||
The list of all available sort algorithms can be listed using the 'ListExtensions -s' admin script. |
Restricting the Information Returned for Matching Items
The LexEVS API also allows the programmer to restrict the values returned for each matching concept. In this example, we chose to return only the UMLS CUI and assigned text presentations.
Retrieving the Result
A query is finally performed during the 'resolve' step, with results returned to the declared list. It is at this point that the LexEVS service does the heavy lifting. By declaring the full extent of the request up front (namespace, match criteria, sort criteria, and returned values), the service then has the opportunity to optimize the query path. In addition, in this example we restrict the number of items returned to a maximum of 6. This combined approach has the benefit of reducing server-side processing while minimizing the volume and frequency of traffic between the client program and the LexEVS service.
Info | ||
---|---|---|
| ||
While this section provides one example of combining criteria, this same pattern can be applied to many of the CodedNodeSet and CodedNodeGraph operations. It is strongly recommended that programmers familiarize themselves with this programming model and its application. |
Additional Resources
The examples and automated test programs provided by the LexEVS installation (see the file breakdown in the section, Overview of the Software) are available as additional reference materials.
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 the section, 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.
Info | ||
---|---|---|
| ||
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:
...
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.
...
Info | ||
---|---|---|
| ||
The menu options are used primarily for administrative functions, and are covered in detail by the LexEVS Administrator's 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 LexEVS Administrator's Guide. |
Creating New Queries
There are four buttons on the top half that are of interest for creating queries.
- Refresh - This button causes the LexEVS GUI to reread the available terminologies and their respective metadata. This can be useful when using the GUI to view a LexEVS environment that is being modified by another process.
- Get History - If a terminology with available history data is selected, this button opens a history browser to view it via the NCI history API. This option is currently only applicable when working with the NCI Thesaurus terminology.
- Get Code Set - This button causes the selected terminology to be added to the lower left section of the GUI as a code set - which is noted by a 'CS' prefix.
- Get Code Graph - This button causes the selected terminology to be added to the lower left section of the GUI as a code graph - which is noted by a 'CG' prefix.
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, then the lower right section will look like this:
...
- Add - This button introduces a new restriction to the Coded Node Set. Clicking it will bring up the following dialog box for creating restrictions:
The top drop down list indicates the type of restriction to add. The rest of the dialog box will change depending on the type of restriction selected. All required parameters for the selected restriction type will be presented. - Edit - This button is enabled when a restriction is selected. Clicking it allows revision of an existing restriction.
- Remove -This button is enabled when a restriction is selected. Clicking it removes the selected restriction.
- Only Include Active Codes - This check box indicates whether or not to include inactive codes when resolving the selected code set.
- Set Sort Options - This button will bring up a dialog box to choose the desired sort order of the results.
- Resolve Code Set - This button will bring up a result window where the Code Set will be resolved and displayed.
Working with Code Graphs
If you select a Coded Node Graph in the lower left section of the LexEVS GUI, the lower right section will look like the following figure, which is described in the text after the graphic:
...
- Relation Container (Optional) - Indicates the CodingScheme Relations container to query. The drop down list is populated with allowable selections.
- Focus Code (Optional) - Provides the code used as a starting point when resolving graph relations. This value is required for some queries, depending on the nature of requested associations.
- Focus Code System (Optional) - Indicates the code system containing the Focus Code. The drop down list is populated with allowable selections.
- Max Resolve Depth - How many levels deep should the graph be resolved? -1 is the default, which does not limit the depth.
- Resolve Forward - Populate codes downstream from the focus node (based on directionality defined by each association).
- Resolve Backward - Populate codes upstream from the focus node (based on directionality defined by each association).
- Set Sort Options - This button will bring up a dialog box to choose the desired sort order of the results.
- Resolve As Set - Resolves and displays the graph results as a coded node set.
- Resolve As Graph -Resolves and displays the graph results.
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:
...
- Left Click + Mouse Movement - Drags the view.
- Right Click + Mouse Movement Up Or Down - Zooms in or out.
- Right Click (on white space) - Zooms the view to fit.
- Ctrl + '+' - Expands the graph connection lines
- Ctrl + '-' - Contracts the graph connection lines
- Ctrl + '1' (or '2' or '3' or '4') - Changes the orientation of the graph.
LexEVS caCORE Data Services API
Interacting with caCORE LexEVS
This chapter describes the components of the caCORE LexEVS and the service interface layer provided by the EVS API architecture. It gives examples of how to use the EVS APIs. It also describes the Distributed LexEVS API and the Distributed LexEVS APIAdapter.
caCORE LexEVS Components
The caCORE LexEVS API is a public domain, open source wrapper that provides full access to the LexEVS Terminology Server. LexEVS hosts the NCI Thesaurus, the NCI Metathesaurus, and several other vocabularies. Java clients accessing the NCI Thesaurus and Metathesaurus vocabularies communicate their requests via the open source caCORE LexEVS APIs, as shown in the following figure.
...
Info | ||
---|---|---|
| ||
The DLB Adapter is not intended to represent a complete set of convenience methods. As part of the caCORE LexEVS 5.x release, the intention is that users will work with the DLB API and suggest useful methods of convenience to the EVS Development Team. |
LexEVS Data Sources
The LexEVS data source is the open source LexEVS terminology server. EVS clients interface with the LexEVS API to retrieve desired vocabulary data. The EVS provides the NCI with services and resources for controlled biomedical vocabularies, including the NCI Thesaurus and the NCI Metathesaurus.
NCI Thesaurus
The NCI Thesaurus is composed of over 27,000 concepts represented by about 78,000 terms. The Thesaurus is organized into 18 hierarchical trees covering areas such as Neoplasms, Drugs, Anatomy, Genes, Proteins, and Techniques. These terms are deployed by the NCI in its automated systems for uses such as key wording and database coding.
NCI Metathesaurus
The NCI Metathesaurus maps terms from one standard vocabulary to another, facilitating collaboration, data sharing, and data pooling for clinical trials and scientific databases. The Metathesaurus is based on the Unified Medical Language System (UMLS) developed by the National Library of Medicine (NLM). It is composed of over 70 biomedical vocabularies.
Interfaces
Main interfaces included in the LexEVSAPI package.
LexEVSDistributed
The Distributed LexEVS Portion of LexEVSAPI. This interface is a framework for calling LexEVS API methods remotely, along with enforcing security measures. JavaDoc
LexEVSDataService
The caCORE-SDK Data Service Portion of LexEVSAPI. This extends on the caCORE ApplicationService to provide additional Query Options. JavaDoc
LexEVSService
The Main LexEVSAPI Interface. This includes support for caCORE-SDK Data Service calls as well as remote LexBIG API calls. JavaDoc
Search Paradigm
The caCORE LexEVS architecture includes a service layer that provides a single, common access paradigm to clients that use any of the provided interfaces. As an object-oriented middleware layer designed for flexible data access, caCORE LexEVS relies heavily on strongly typed objects and an object-in/object-out mechanism.
...
The sequence diagram that follows illustrates the caCORE LexEVS API search mechanism implemented to access the NCI EVS vocabularies.
Querying the System
LexEVS conforms to the caCORE SDK API - for more information see caCORE SDK 4.1 Programmer's Guide
QueryOptions
QueryOptions are designed to give the user extra control over the query before it is sent to the system. QueryOptions may be used to modify a query in these ways:
- 'CodingScheme' - Restricts the query to the specified Coding Scheme, instead of querying every available Coding Scheme.
- CodingSchemeVersionOrTag' - Restricts the query to the specified Version of the Coding Scheme. Note that:
- This may NOT be specified without also specifying the 'CodingScheme' attribute.
- If left unset, it will default to the version of the Coding Scheme tagged as "PRODUCTION" in the system.
- 'SecurityTokens' - Security Tokens to use with the specified query. These Security Tokens are scoped to the current query ONLY. An subsequent queries will also need to specify the necessary Query Options.
- 'LazyLoad' - Some high use-case model Objects have bee 'lazy-load' enabled. This means that some attributes and associations of a model Object may not be fully populated when returned to the user. This allows for faster query times. This defaults to false, meaning that all attributes and associations will be eagerly fetched by the server and model Objects will always be fully populated. To enable this on applicable Objects, set to true.
Info title Note Lazy Loading may only be used in conjunction with specifying a Coding Scheme and Version with the 'CodingScheme' and 'CodingSchemeVersionOrTag' attributes above.
- 'ResultPageSize' - the page size of results to return. The higher the number, the more results the system will return to the user at once. The client will request the next group of query results transparenly. This parameter is useful for performance tuning. For example, if a query returns a result of10,000 Objects, a 'ResultPageSize' of '1000' would make 10 calls to the server returning a page of 1000 results each time. If left unset, this value will default to the default set Page Size
Examples of Use
Example 4.1: Query By Example with No Query Options
...
Line Number | Explanation |
---|---|
4 | Creates an instance of a class that implements the LexEVSApplicationService interface. This interface defines the service methods used to access data objects. |
7 | Construct the QueryOptions Object. |
8 | Populate the QueryOptions with the desired Coding Scheme. |
9 | Construct a CodingSchemeVersionOrTag Object. |
10 | Populate the CodingSchemeVersionOrTag Object with the desired Version. |
11 | Populate the QueryOptions with the above CodingSchemeVersionOrTag Object. |
12 | Construct the Query By Example Object and populate it with the desired search critieria. For this example, seach for any 'Entity' with an 'entityCode' attribute equaling 'C1234'. |
14 | Calls the search method of the LexEVSApplicationService object, along with the QueryOptions. This method returns a List Collection. This list will contain all of the 'Entity' Objects that match the search critieria, while being further modified by the QueryOptions. It this case, it will return all 'Entity' Objects with an 'entityCode' of "C1234" belonging to the CodingScheme "NCI Thesaurus" Version "09.10d". |
Web Services API
The caCORE LexEVS Web Services API enables access to caCORE LexEVS data and vocabulary data from development environments where the Java API cannot be used, or where use of XML Web services is more desirable. This includes non-Java platforms and languages such as Perl, C/C++, .NET framework (C#, VB.Net), and Python.
...
On the server side, Apache Axis is used to provide SOAP-based, inter-application communication. Axis provides the appropriate serialization and deserialization methods for the JavaBeans to achieve an application-independent interface. For more information about Axis, visit http://ws.apache.org/axis/.
Configuration
The caCORE/LexEVS WSDL file is located at http://lexevsapi.nci.nih.gov/lexevsapi50/services/lexevsapi50Service?wsdl. In addition to describing the protocols, ports, and operations exposed by the caCORE LexEVS Web service, this file can be used by a number of IDEs and tools to generate stubs for caCORE LexEVS objects. This enables code on different platforms to instantiate native objects for use as parameters and return values for the Web service methods. For more information on how to use the WSDL file to generate class stubs, consult the specific documentation for your platform.
The caCORE LexEVS Web services interface has a single end point called <tt>lexevsapi50Service</tt>, which is located at http://lexevsapi.nci.nih.gov/lexevsapi50/services/lexevsapi50Service. Client applications should use this URL to invoke Web service methods.
Building a Java SOAP Client
LexEVSAPI provides a tool to create a Java SOAP client capable of connecting to a LexEVSAPI SOAP service.
...
To build the client, use the command 'ant all' from the ./webServiceSoapClient directory.
XML-HTTP API
The caCORE LexEVS XML-HTTP API, based on the REST (Representational State Transfer) architectural style, provides a simple interface using the HTTP protocol. In addition to its ability to be invoked from most Internet browsers, developers can use this interface to build applications that do not require any programming overhead other than an HTTP client. This is particularly useful for developing Web applications using AJAX (Asynchronous JavaScript and XML).
Service Location and Syntax
The CORE EVS XML-HTTP interface uses the following URL syntax:
...
Parameter | Meaning | Example |
---|---|---|
| The name of a class. | |
| The name of an attribute of the return class or an associated class | |
| The value of an attribute. | |
Examples of Use
The example in the table below demonstrates the usage of the XML-HTTP interface. In actual usage, these queries would either be submitted by a block of code or entered in the address bar of a Web browser.
...
Query |
| ||
---|---|---|---|
Semantic Meaning | Find all objects of type Entity that contain an 'entityCode' matching the pattern 'C123*'. |
Working with Result Sets
Because HTTP is a stateless protocol, the caCORE LexEVS server cannot detect the context of any incoming request. Consequently, each invocation of GetXML or GetHTML must contain all of the information necessary to retrieve the request, regardless of previous requests. Developers should consider this when working with the XML-HTTP interface.
...
Info | ||
---|---|---|
| ||
|
Distributed LexEVS API
Overview
In place of the existing EVS 3.2 object model, caCORE LexEVS is making a gradual transition toward a pure LexEVS back-end terminology server and exposure of the LexEVS Service object model. caCORE 3.2 and earlier required a custom API layer between external users of the system and the proprietary Apelon Terminology Server APIs. With the transition to LexEVS, caCORE LexEVS can publicly expose the open source terminology service API without requiring a custom API layer.
Architecture
The LexEVS API is exposed by the LexEVS caCORE System for remote, distributed access. The caCORE System's LexEVSApplicationService class implements the LexBIGService interface, effectively exposing LexEVS via caCORE.
...
The DLB environment will be configured on the caCORE LexEVS Server (http://lexevsapi.nci.nic.gov/lexevsapi50). This will give the server access to the LexEVS database and other resources. The client must therefore go through the caCORE LexEVS server to access any LexEVS data.
LexEVS Annotations
To address LexEVS DAOs, the LexEVS API integration incorporated the addition of (1) Java annotation marking methods that can be safely executed on the client side; and (2) classes that can be passed to the client without being wrapped by a proxy. The annotation is named @lgClientSideSafe
. Every method in the LexEVS API that is accessible to the caCORE LexEVS user had to be considered and annotated if necessary.
Aspect Oriented Programming Proxies
LexEVS integration with caCORE LexEVS was accomplished using Spring Aspect Oriented Programming (AOP) to proxy the LexEVS classes and intercept calls to their methods. The caCORE LexEVS client wraps every object returned by the <tt>LexBIGService</tt> inside an AOP Proxy with advice from a LexBIGMethodInterceptor ("the interceptor").
...
Figure 4.6 - Sequence diagram showing method interception
LexEVS API Documentation
The Mayo Clinic wrote the LexEVS 5.0 API. Documentation describing the LexEVS Service Model is available on the LexGRID Vocabulary Services for caBIG GForge site at https://gforge.nci.nih.gov/frs/?group_id=14.
LexEVS Installation and Configuration
The DLB API is strictly a Java interface and requires Internet access for remote connectivity to the caCORE LexEVS server. Access to the DLB API requires access to the lexevsapi-client.jar file, available for download on the NCICB Web site. The lexevsapi-client.jar file needs to be available in the classpath. For more information, see Installing and Configuring the LexEVS 5.0 Java API.
Example of Use
Example 4.6: Using the DLB API
...
Include Page | ||||
---|---|---|---|---|
|
LexEVS Analytical Grid Service API
The following tables summarize the operations available through the LexEVS Analytical Grid Service. Each of the operations is also defined in detail below. The grid analytical service and related operations are viewable via the caGrid Portal (http://cagrid-portal.nci.nih.gov).
Using the API
There are two (2) different interfaces for accessing the LexEVS Grid Services:
...
Include Page | ||||
---|---|---|---|---|
|
Method Descriptions
getCodingSchemeConcepts
getCodingSchemeConcepts(CodingSchemeIdentification, CodingSchemeVersionOrTag)
Description: | Returns the set of all (or all active) concepts in the specified coding scheme. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification | ||||||||
Output: | org.LexGrid.LexBIG.cagrid.LexBIGCaGridServices.CodedNodeSet.stubs.types.CodedNodeSetReference | ||||||||
Exception: | RemoteException | ||||||||
Implementation Details: | Implementation:
|
getFilter
getFilter(ExtensionIdentification)
Description: | Returns an instance of the filter extension registered with the given name. | ||||||
---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.ExtensionIdentification | ||||||
Output: | org.LexGrid.LexBIG.cagrid.LexBIGCaGridServices.Filter.stubs.types.FilterReference | ||||||
Exception: | RemoteException | ||||||
Implementation Details: | Implementation:
|
getSortAlgorithm
getSortAlgorithm(ExtensionIdentification)
Description: | Returns an instance of the sort extension registered with the given name. | ||||||
---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.ExtensionIdentification | ||||||
Output: | org.LexGrid.LexBIG.cagrid.LexBIGCaGridServices.Sort.stubs.types.SortReference | ||||||
Exception: | RemoteException | ||||||
Implementation Details: | Implementation:
|
getFilterExtensions
getFilterExtensions()
Description: | Returns a description of all registered extensions used to provide additional filtering of query results. | ||||
---|---|---|---|---|---|
Input: | none | ||||
Output | org.LexGrid.LexBIG.DataModel.Collections.ExtensionDescriptionList | ||||
Exception: | RemoteException | ||||
Implementation Details: | Implementation:
|
getServiceMetadata
getServiceMetadata()
Description: | Return an interface to perform system-wide query over metadata for loaded code systems and providers. | ||||
---|---|---|---|---|---|
Input: | none | ||||
Output: | org.LexGrid.LexBIG.cagrid.LexBIGCaGridServices.LexBIGServiceMetadata.stubs.types.LexBIGServiceMetadataReference | ||||
Exception: | RemoteException | ||||
Implementation Details: | Implementation:
|
getSupportedCodingSchemes
getSupportedCodingSchemes()
Description: | Return a list of coding schemes and versions that are supported by this service, along with their status. | ||||
---|---|---|---|---|---|
Input: | none | ||||
Output: | org.LexGrid.LexBIG.DataModel.Collections.CodingSchemeRenderingList | ||||
Exception: | RemoteException | ||||
Implementation Details: | Implementation:
|
getLastUpdateTime
getLastUpdateTime()
Description: | Return the last time that the content of this service was changed; null if no changes have occurred. Tag assignments do not count as service changes for this purpose. | ||||
---|---|---|---|---|---|
Input: | none | ||||
Output: | java.util.Date | ||||
Exception: | RemoteException | ||||
Implementation Details: | Implementation:
|
resolveCodingScheme
resolveCodingScheme(CodingSchemeIdentification, CodingSchemeVersionOrTag)
Description: | Return detailed coding scheme information given a specific tag or version identifier. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification, org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag | ||||||||
Output: | org.LexGrid.codingSchemes.CodingScheme | ||||||||
Exception: | RemoteException | ||||||||
Implementation Details: | Implementation:
|
getNodeGraph
getNodeGraph(CodingSchemeIdentification, CodingSchemeVersionOrTag, RelationContainerIdentification)
Description: | Returns the node graph as represented in the particular relationship set in the coding scheme. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification | ||||||||||
Output: | org.LexGrid.LexBIG.cagrid.LexBIGCaGridServices. | ||||||||||
Exception: | RemoteException | ||||||||||
Implementation Details: | Implementation:
|
getMatchAlgorithms
getMatchAlgorithms()
Description: | Returns the node graph as represented in the particular relationship set in the coding scheme. | ||||
---|---|---|---|---|---|
Input: | none | ||||
Output: | org.LexGrid.LexBIG.DataModel.Collections.ModuleDescriptionList | ||||
Exception: | RemoteException | ||||
Implementation Details: | Implementation:
|
getGenericExtensions
getGenericExtensions()
Description: | Returns a description of all registered extensions used to implement application-specific behavior that is centrally accessible from a LexBIGService.
| |||||
---|---|---|---|---|---|---|
Input: | none | |||||
Output: | org.LexGrid.LexBIG.DataModel.Collections.ExtensionDescriptionList | |||||
Exception: | RemoteException | |||||
Implementation Details: | Implementation:
|
getGenericExtension
getGenericExtensions(ExtensionIdentification)
Description: | Returns an instance of the application-specific extension registered with the given name. | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.ExtensionIdentification | |||||||||||
Output: | org.LexGrid.LexBIG.DataModel.Collections.SortDescriptionList | |||||||||||
Exception: | RemoteException | |||||||||||
Implementation Details: | Implementation:
|
getHistoryService
getHistoryService(CodingSchemeIdentification)
Description: | Resolve a reference to the history api servicing the given coding scheme. | ||||||
---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification | ||||||
Output: | org.LexGrid.LexBIG.cagrid.LexBIGCaGridServices.HistoryService.stubs.types.HistoryServiceReference | ||||||
Exception: | RemoteException | ||||||
Implementation Details: | Implementation:
|
getSortAlgorithms
getSortAlgorithms(SortContext)
Description: | Returns a description of all registered extensions used to provide additional filtering of query results. | ||||
---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.InterfaceElements.types.SortContext | ||||
Output: | org.LexGrid.LexBIG.DataModel.Collections.SortDescriptionList | ||||
Exception: | RemoteException | ||||
Implementation Details: | Implementation:
|
resolveCodingSchemeCopyright
resolveCodingSchemeCopyright
Description: | Return coding scheme copyright given a specific tag or version identifier. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification | ||||||||
Output: | org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeCopyRight | ||||||||
Exception: | RemoteException | ||||||||
Implementation Details: | Implementation:
|
setSecurityToken
setSecurityToken(CodingSchemeIdentification, SecurityToken)
Description: | Sets the Security Token for the given Coding Scheme. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Input: | org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification, gov.nih.nci.evs.security.SecurityToken | ||||||||
Output: | org.LexGrid.LexBIG.cagrid.LexEVSGridService.stubs.types.LexEVSGridServiceReference.LexEVSGridServiceReference | ||||||||
Exception: | RemoteException | ||||||||
Implementation Details: | Implementation:
|
Usage Instructions
Service URL
The LexEVS Grid Service 4.2 URL is: http://lexevsapi.nci.nih.gov/wsrf/services/cagrid/LexEVSGridService.
The service is also accessible via the caGRID Portal.
Required Libraries
The libraries required for programmatic access to the LexEVS Grid Service are listed in the tables below.
...
Library | Associated JARs |
---|---|
caGrid Software Libraries | caGrid-ServiceSecurityProvider-client-1.2.jar |
EVS API Libaries | evsapi42-beans.jar |
LexEVS Grid Service Client Library | LexEVSGridService-client.jar |
LexEVS Grid Service Stubs | LexEVSGridService-stubs.jar |
LexEVS Grid Service Common | LexEVSGridService-common.jar |
LexEVS Grid Service Service | LexEVSGridService-service.jar |
LexEVS Grid Service Tests | LexEVSGridService-tests.jar |
caCORE SDK Library | sdk-client-framework.jar |
LexEVS API | lexbig.jar |
Custom Castor Serializer | castor-bean-serializer.jar |
Downloads
For your convenience, the required libraries are available for download here:
...
To programmatically access the LexEVS API Grid Service, these libraries need to be added to your local classpath.
Code Examples
Example Client and Service Calls and SOAP Messages
See http://gforge.nci.nih.gov/docman/view.php/491/14252/TestClient.zip
Example API usage
Example 1: Searching for concepts in NCI Thesaurus containing the string "Gene"
Include Page | ||||
---|---|---|---|---|
|
Error Handling
Error Connecting to LexEVS Grid Service
When connecting through the Java Client, java.net.ConnectException
, an org.apache.axis.types.URI.MalformedURIException
may be thrown upon an unsuccessful attempt to connect.
...
This example shows a typical connection to the LexEVS Grid Service, with the two potential Exceptions being caught and handled as necessary.
LexEVS Errors
LexEVS errors will be forwarded through the Distributed LexEVS layer and then on to the Grid layer. Input parameters, along with any other LexEVS (or Distributed LexEVS) errors will be detected on the server, not the client, and forwarded. All Generic LexEVS (or Distributed LexEVS) errors will be forwarded via a RemoteException, with the cause of the error and underlying LexEVS error message included.
Invalid Service Context Access
Service Context Services are not meant to be called directly. If the client attempts to do so, an org.LexGrid.LexBIG.cagrid.LexEVSGridService.CodedNodeSet.stubs.types.InvalidServiceContextAccess
Exception will be thrown. This indicates a call was made to a Service Context without obtaining a Service Context Reference via the Main Service (see the above section Service Contexts and State for more information).
Security Issues
LexEVS Grid Service Security
Certain vocabulary content accessible through the LexEVS Grid Service may require extra authorization to access. Each client is required to supply its own access credentials via Security Tokens. These Security Tokens are implemented by a SecurityToken object:
Code Block |
---|
Name: SecurityToken Namespace: gme://caCORE.caCORE/3.2/gov.nih.nci.evs.security Package: gov.nih.nci.evs.security |
Accessing Secure Content
A client establishes access to a secured vocabulary via the following Grid Service Calls:
...
Info | ||
---|---|---|
| ||
It is important to note that the Grid Service |
Implementation
Each call to "setSecurityToken" sets up a secured connection to Distributed LexEVS with the access privileges included in the SecurityToken parameter. The LexEVSGridServiceReference that is returned to the client contains a unique key identifier to the secure connection that has been created on the server. All subsequent calls the client makes through this LexEVSGridServiceReference will be made securely. If additional SecurityTokens are passed in through the "setSecurityToken" Grid Service, the additional security will be added and maintained.
...
Info | ||
---|---|---|
| ||
All non-secured information accessed by the LexEVS Grid Service is publicly available from NCICB and users are expected to follow the licensing requirements currently in place for accessing and using NCI EVS information. |
LexEVS Data Grid Service API
The LexEVS Data Grid Service
The LexEVS Data Grid Service is a standard caGrid Data service based on the LexEVS 2009 Model
caGrid Data Service Documentation
For complete documentation on caGrid Data Services, see caGrid Data Service Documentation
Querying the System
To query the LexEVS Data Grid Service, use the standard caGrid CQL query method to compose queries. See caGrid Data Service API Documentation for more information.
Example LexEVS queries follow.
Query for a Concept with a Specific Code
Example: Concept: C12345
Include Page | ||||
---|---|---|---|---|
|
Query for a Concept with Specific Presentation Text
Example: A concept with a namespace 'SNOMED Clinical Terms' that contains a Presentation equal to 'Heart'
Include Page | ||||
---|---|---|---|---|
|
Restrict Results to Specific Attributes
Example: Retrieve all of the 'localIds' of any 'SupportedAssociation' in the system.
...