developerguide

  Previous: Using U-Compare Components within Index: Developer Guide Next: U-Compare Type System

Sections:


Making Your Tools into U-Compare Compatible

Please refer to Section of Using U-Compare Workflow, about how to wrap your original tools to a UIMA component and run it in U-Compare. This is the prerequisite of this section. In this section we assume that you already have your UIMA components running in U-Compare or you know how to make UIMA components which can be run in U-Compare.

Common Requirements

U-Compare Type System Compatible

U-Compare compatible simply means that a component can be used in a workflow together with other U-Compare components. U-Compare compatible component should be a UIMA component and should use the U-Compare type system, or extended types of the U-Compare type system, for the component I/O capability, not just in the component descriptor setting but in the actual annotation instances.

Type System Converter

Because UIMA provides Aggregate Analysis Engine which holds nested child components, only the outermost component is required this type system compatiblity which is visible to the users. In cases there already have UIMA components with another type system implemented, creating a type system coverter component would be the straightforward way because there are no need to modify the original component. Then create a new aggregate analysis engine component with proper I/O capabilities of U-Compare type system compatible types, put three components in this order: the type system converter (another type system to U-Compare type system), the original component, and the type system converter (U-Compare to another). If the type system converter properly converts annotation instances, the newly created aggregate analysis component is now a U-Compare compatible component.

Collection Reader cannot be inside Aggregate Component

CollectionReader, which is another type of UIMA component like AnalysisEngine, normally reads corpus and generate CASes. Because CollectionReader cannot be in the aggregate component, type conversion should be processed inside CollectionReader if any. If you already have your own CollectionReader of another type system, some modification would be required.

U-Compare Type System

Please refer to the section of U-Compare type system for details of our type system.

U-Compare Distributable Component

The components shown in the component library of the U-Compare startup window are U-Compare distributable component. U-Compare distributable component is required to have a somewhat higher level of the interoperability than the U-Compare compatible components, to allow users to use that component by a simple drag-and-drop mouse motion. If your component has this level of interoperability, we can share and distribute your component via U-Compare. This subsection describes how to achieve such a level of the interoperability.

Another option is to provide your resource in the U-Compare importable package style. Please refer to the U-Compare import/export subsection, in the Using Third Party UIMA Component section above.

UIMA SOAP Web Service

Apache UIMA provides an easy way to deploy any UIMA analysis engine as a SOAP web service. If your implementation includes non-Java codes, please make use of this web service architecture. A collection reader cannot be deployed as a SOAP web service. Please read the following sections about the local service implementation, in case of the collection reader.

Assuming that your component is already U-Compare compatible, first deploy your component as a SOAP UIMA web service, then you should have your UIMA soap service descriptor file. Please create an aggregate component which simply contains the web service descriptor only, with proper I/O capabilities using the U-Compare type system. This is because the soap service descriptor cannot have any information other than the service URI.

The last thing to do is making and sending us a jar file, which contains all of the required descriptors in their proper classpath location. After confirming and deciding to add your component in our component library, we will add your jar file to the U-Compare pre-defined resources and library.

Pure Java Component as Local Service

A pure java component is the most preferred way in U-Compare. We can automatically distribute your component via U-Compare, running in the users' local environment. The requirement is the classpath based access to the resources. Please read the next subsection for details. Current system environment is Java 6 and Apache UIMA 2.2.2. For the other libraries included in the system, please refer to [your.home.directory]/.U-Compare/jars folder after running UCLoader at least once. Please do not include the same classes/jars which are already inluded in the library above.

When you created your component, put all of the required resources into your jar files with proper classpath locations. Your can create any number of jar files, but create a jar files of descriptors only, isolated from other resources. This is because the Java Web Start destribution is on demand, but the descriptors are always loaded when starting U-Compare. We can avoid unnecessary downloads by this isolation.

Loading Resources via Classpath

Because the whole U-Compare system is provided in the Java Web Start technology based manner, all of the resources should be in *.jar files which are on the classpath. This means that all of the resources should be accessed via the Java ClassLoader, i.e. accessed only by classpath based locations. Using the classloader directly would be the normal way in Java, but in the UIMA's case we have UIMA ResourceManager. You should first set <externalResource> field, which has a key-url pair, in your component descriptor. Then in your Java code,

  UIMAContext uimaContext = getUimaContext();
  URI uri = uimaContext.getResourceURI("KeyToYourResource");
  InputStream in = uri.toUrl().openStream();
  ...

If you need to extract the entire jar file information,

  UIMAContext uimaContext = getUimaContext();
  URI uri = uimaContext.getResourceURI("KeyToYourResource");
  JarFile jarFile = ((JarURLConnection)uri.toUrl().openConnection()).getJarFile();
  ...

In other words, if there is any use of java.io.File, then your component will not work in the Java Web Start based system, i.e. not U-Compare distributable.

Verifying Your Component

After creating your U-Compare distributable component, please verify your component as follows. First start U-Compare. Add your jar files to the classpath list of U-Compare from the Register Component submenu in the Library menu. Then search for your descriptors and add them to the library. Now you are ready to test your components as in the same environment as the predefined U-Compare components.

Contibuting Your Component Packages

Before sending your packages, please make verification as above, and set the name and description field in your descriptor files with a user comprehensive expression. Then please send us all of the *.jar, together with a brief tool description which we can use in the tool list of our website. In your *.jar files, do not include classes and resources which are already provided by the U-Compare system as described above. Please refer to the Pure Java Component as Local Service section above for details.

Previous: Using U-Compare Components within Index: Developer Guide Next: U-Compare Type System