org.xces.graf.uima
Class UimaUtils

java.lang.Object
  extended by org.xces.graf.uima.UimaUtils

public class UimaUtils
extends Object

Utility functions for converting GrAF graphs into the data structures needed by UIMA. The UimaUtils class simply provides static wrappers for the factory classes.

Version:
1.0
Author:
Keith Suderman

Field Summary
static String DEFAULT_GRAF_NAMESPACE
           
static String GRAF_ANNOTATION_TYPE
           
static String GRAF_EDGE_TYPE
           
static String GRAF_LIST_TYPE
           
static String GRAF_NODE_TYPE
           
static String UIMA_ANNOTATION_TYPE
           
static String UIMA_BOOLEAN_TYPE
           
static String UIMA_STRING_TYPE
           
 
Constructor Summary
UimaUtils()
           
 
Method Summary
static org.apache.uima.cas.CAS createCAS(org.xces.graf.api.IGraph graph, org.apache.uima.resource.metadata.TypeSystemDescription description, org.apache.uima.resource.metadata.TypePriorities priorities, org.apache.uima.resource.metadata.FsIndexDescription[] index, org.xces.graf.util.NameMap map)
           
static org.xces.graf.api.IGraph createGraph(org.apache.uima.cas.CAS cas)
           
static org.apache.uima.resource.metadata.TypePriorities createTypePriorities(org.xces.graf.util.IAnnotationOrder order)
          Returns type priorities based upon a user-defined ordering
static org.apache.uima.resource.metadata.TypePriorities createTypePriorities(org.xces.graf.api.IGraph graph, org.xces.graf.util.NameMap map)
           
static org.apache.uima.resource.metadata.TypePriorities createTypePriorities(org.xces.graf.api.IGraph graph, String namespace, org.xces.graf.util.NameMap map)
           
static org.apache.uima.resource.metadata.FsIndexDescription[] getIndices(org.xces.graf.api.IGraph graph, org.xces.graf.util.NameMap map)
           
static org.apache.uima.resource.metadata.FsIndexDescription[] getIndices(org.xces.graf.api.IGraph graph, String namespace, org.xces.graf.util.NameMap map)
           
static org.apache.uima.cas.TypeSystem getTypeSystem(org.xces.graf.api.IGraph graph, org.xces.graf.util.NameMap map)
           
static org.apache.uima.cas.TypeSystem getTypeSystem(org.xces.graf.api.IGraph graph, String namespace, org.xces.graf.util.NameMap map)
           
static org.apache.uima.resource.metadata.TypeSystemDescription getTypeSystemDescription(org.apache.uima.cas.TypeSystem system)
           
static org.apache.uima.cas.CAS loadCasFromXmi(File inputCasFile, File inputTypeSystemFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_GRAF_NAMESPACE

public static final String DEFAULT_GRAF_NAMESPACE
See Also:
Constant Field Values

GRAF_NODE_TYPE

public static final String GRAF_NODE_TYPE
See Also:
Constant Field Values

GRAF_EDGE_TYPE

public static final String GRAF_EDGE_TYPE
See Also:
Constant Field Values

GRAF_ANNOTATION_TYPE

public static final String GRAF_ANNOTATION_TYPE
See Also:
Constant Field Values

GRAF_LIST_TYPE

public static final String GRAF_LIST_TYPE
See Also:
Constant Field Values

UIMA_ANNOTATION_TYPE

public static final String UIMA_ANNOTATION_TYPE
See Also:
Constant Field Values

UIMA_STRING_TYPE

public static final String UIMA_STRING_TYPE
See Also:
Constant Field Values

UIMA_BOOLEAN_TYPE

public static final String UIMA_BOOLEAN_TYPE
See Also:
Constant Field Values
Constructor Detail

UimaUtils

public UimaUtils()
Method Detail

createTypePriorities

public static org.apache.uima.resource.metadata.TypePriorities createTypePriorities(org.xces.graf.api.IGraph graph,
                                                                                    org.xces.graf.util.NameMap map)
                                                                             throws TypeSystemException
Parameters:
graph -
map -
Returns:
Throws:
TypeSystemException

createTypePriorities

public static org.apache.uima.resource.metadata.TypePriorities createTypePriorities(org.xces.graf.util.IAnnotationOrder order)
Returns type priorities based upon a user-defined ordering

Parameters:
order - Must be an exhaustive ordering on the annotations
Returns:

createTypePriorities

public static org.apache.uima.resource.metadata.TypePriorities createTypePriorities(org.xces.graf.api.IGraph graph,
                                                                                    String namespace,
                                                                                    org.xces.graf.util.NameMap map)
                                                                             throws TypeSystemException
Throws:
TypeSystemException

getTypeSystem

public static org.apache.uima.cas.TypeSystem getTypeSystem(org.xces.graf.api.IGraph graph,
                                                           org.xces.graf.util.NameMap map)
                                                    throws TypeSystemException
Throws:
TypeSystemException

getTypeSystem

public static org.apache.uima.cas.TypeSystem getTypeSystem(org.xces.graf.api.IGraph graph,
                                                           String namespace,
                                                           org.xces.graf.util.NameMap map)
                                                    throws TypeSystemException
Throws:
TypeSystemException

getIndices

public static org.apache.uima.resource.metadata.FsIndexDescription[] getIndices(org.xces.graf.api.IGraph graph,
                                                                                org.xces.graf.util.NameMap map)
                                                                         throws TypeSystemException
Throws:
TypeSystemException

getIndices

public static org.apache.uima.resource.metadata.FsIndexDescription[] getIndices(org.xces.graf.api.IGraph graph,
                                                                                String namespace,
                                                                                org.xces.graf.util.NameMap map)
                                                                         throws TypeSystemException
Throws:
TypeSystemException

getTypeSystemDescription

public static org.apache.uima.resource.metadata.TypeSystemDescription getTypeSystemDescription(org.apache.uima.cas.TypeSystem system)

createCAS

public static org.apache.uima.cas.CAS createCAS(org.xces.graf.api.IGraph graph,
                                                org.apache.uima.resource.metadata.TypeSystemDescription description,
                                                org.apache.uima.resource.metadata.TypePriorities priorities,
                                                org.apache.uima.resource.metadata.FsIndexDescription[] index,
                                                org.xces.graf.util.NameMap map)
                                         throws org.apache.uima.resource.ResourceInitializationException,
                                                IOException,
                                                SAXException,
                                                org.apache.uima.cas.CASException,
                                                org.xces.graf.api.GrafException
Throws:
org.apache.uima.resource.ResourceInitializationException
IOException
SAXException
org.apache.uima.cas.CASException
org.xces.graf.api.GrafException

createGraph

public static org.xces.graf.api.IGraph createGraph(org.apache.uima.cas.CAS cas)
                                            throws org.xces.graf.api.GrafException
Throws:
org.xces.graf.api.GrafException

loadCasFromXmi

public static org.apache.uima.cas.CAS loadCasFromXmi(File inputCasFile,
                                                     File inputTypeSystemFile)
                                              throws org.apache.uima.resource.ResourceProcessException,
                                                     org.apache.uima.resource.ResourceInitializationException,
                                                     IOException,
                                                     ParserConfigurationException,
                                                     SAXException
Throws:
org.apache.uima.resource.ResourceProcessException
org.apache.uima.resource.ResourceInitializationException
IOException
ParserConfigurationException
SAXException


Copyright © 2012 American National Corpus. All Rights Reserved.