NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The caCORE LexEVS API is a public domain, open source wrapper that provides full access to the LexBIG Terminology Server. LexBIG 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 Overview of the caCORE LexEVS 4.0 release components.

Diagram showing an overview of the caCORE LexEVS 4.0 release componentsImage Modified

The open source interfaces provided as part of caCORE LexEVS 5.x include Java APIs, a SOAP interface, and an HTTP REST interface. The Java APIs are based on the EVS 3.2 object model and the LexBIG Service object model.

...

The extraction includes the directories and files listed in Extracted below. This table shows the extracted directories and files in caCORE LexEVS client package.

Directory

Files

Description

Component

./build

build.xml

Ant build file

Build file

./conf

application-config-client.xml

 

 

 

xml-mapping.xml

 

 

log4j.properties.xml

Logging utilities configuration properties

 

 

 

*.xsd

 

 

./lib

{{spring.jar }}

Spring framework

HTTP remoting

...

 

acegi-security-1.0.4.jar

Spring Security

...

 

 

asm.jar

...

 

 

 

antlr-2.7.6.jar

Apache Ant

 

...

 

log4j-1.2.14.jar

Logging utilities

Logging

...

 

commons-*.jar

Various Apache Commons utilities

Utilities

...

 

lexevsapi50-beans.jar

Holder for Generated Beans (other than the Castor-generated LexBIG/LexGrid beans). Currently empty.

...

 

 

lexevsapi50-framework.jar

caCORE LexEVS framework

 

...

 

lexbig.jar

LexBIG classes. Contains the Castor-generated LexBIG/LexGrid domain Objects.

 

...

 

lucene*.jar

Index search

LexBIG

...

 

 

castor-1.0.2.jar

Castor serializer/deserializer

XML conversion

...

 

 

xercesImpl.jar

Apache Xerces XML parser

...

 

 

sdk*.jar

Base caCORE SDK functionality

...

 

The following files are required to use the Java API:

...

When building applications, include these files in the Java classpath. The included build.xml file demonstrates how to do this when using Ant for command-line builds. If you are using an integrated development environment (IDE) such as Eclipse, refer to the tool's documentation for information on how to set the classpath.

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.

...

caCORE LexEVS systems use four native application programming interfaces (APIs). Each interface uses the same paradigm to provide access to the caCORE LexEVS domain model, with minor changes specific to the syntax and structure of the clients. The following sections describe each API, identify installation and configuration requirements, and provide code examples.

The sequence diagram in Sequence diagram - that follows shows the caCORE 4.0 LexEVS API search mechanism illustrates the caCORE LexEVS API search mechanism implemented to access the NCI EVS vocabularies.

Sequence diagram showing the caCORE 4.0 LexEVS API search mechanismImage Modified

Figure 4.4 - Sequence diagram - caCORE 4.0 LexEVS API search mechanism

Querying the System

LexEVS conforms to the caCORE SDK API - for more information see : (Link to caCORE SDK doc)

QueryOptions

QueryOptions (link to javadoc) 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
        titleNote

        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 *(LINK CACORE SDK GUIDE page 65)

      Examples of Use

      Example 4.1: Query By Example with No Query Options

      Code Block
      1  public static void main(String[] args)
      2  {
      3      try {
      4          LexEVSApplicationService appService =
      5            (LexEVSApplicationService)ApplicationServiceProvider.
      6             getApplicationService("EvsServiceInfo");
      7          Entity entity = new Entity()
      8          entity.setEntityCode("C1234");
      9          List<Entity> list = appService.search(Entity.class, entity);
      10     } catch(ApplicationException ex){
      11     }
      12  }
      

      Explanation of statements in The following table explains specific statements in the code by line number.

      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 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'.

      9

      Calls the search method of the LexEVSApplicationService object.

      ...

      This method returns a List Collection. This list will contain all of the 'Entity' Objects that match the search critieria. It this case, it will return all 'Entity' Objects with an 'entityCode' of "C1234".

      ...

      _Table 4.6 - Explanation of statements in : _

      *Example 4.2: Query By Example with Query Options*

      Code Block
      1  public static void main(String[] args)
      2  {
      3     try {
      4        LexEVSApplicationService appService =
      5           (LexEVSApplicationService)ApplicationServiceProvider.
      6           getApplicationService("EvsServiceInfo");
      7           QueryOptions queryOptions = new QueryOptions();
      8           queryOptions.setCodingScheme("NCI Thesaurus");
      9           CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
      10          csvt.setVersion("09.10d");
      11          queryOptions.setCodingSchemeVersionOrTag(csvt);
      12        Entity entity = new Entity()
      13        entity.setEntityCode("C1234");
      14        List<Entity> list = appService.search(Entity.class, entity, queryOptions);
      15      } catch(ApplicationException ex){
      16      }
      17  }
      

      ...