Class XmiSplitUtilities


  • public class XmiSplitUtilities
    extends Object
    • Field Detail

      • TYPES_NAMESPACE

        public static final String TYPES_NAMESPACE
        The default types namespace that is assumed if not the fully qualified java name is given for an annotation.
        See Also:
        Constant Field Values
      • primitives

        public static final List<String> primitives
        Ranges of features that will erroneously (for our purposes) have the status of not being primitive. TODO: Are there any other ranges that have to be considered (e.g. lists)?
    • Constructor Detail

      • XmiSplitUtilities

        public XmiSplitUtilities()
    • Method Detail

      • convertNSUri

        public static String convertNSUri​(String nameSpace)
        Extracts the first part of the fully qualified java name from the namespace uri.
        Parameters:
        nameSpace - The namespace uri of the element.
        Returns:
      • getTypeJavaName

        public static String getTypeJavaName​(StartElement element)
        Extracts the fully qualified java name for an element.
        Parameters:
        element - The start element.
        Returns:
      • isFSArray

        public static boolean isFSArray​(org.apache.uima.cas.Type annotationType)
        TODO: Are there any Feature Structures other than FSArray that link annotations (e.g. FSList)?
        Parameters:
        annotationType -
        Returns:
      • isPrimitive

        public static boolean isPrimitive​(org.apache.uima.cas.Type annotationType,
                                          String featureName)
      • isPrimitive

        public static boolean isPrimitive​(org.apache.uima.cas.Type type)
        TODO: See class variable primitives... Are there any features other than "sofa" that are complex but should not be stored recursively?
        Parameters:
        type -
        Returns:
      • getFeatureType

        public static org.apache.uima.cas.Type getFeatureType​(org.apache.uima.cas.Type annotationType,
                                                              String featureName)
      • isAnnotationType

        public static boolean isAnnotationType​(String qualifiedTypename)
      • isReferenceAttribute

        public static boolean isReferenceAttribute​(org.apache.uima.cas.Type annotationType,
                                                   String attributeName,
                                                   org.apache.uima.cas.TypeSystem ts)
      • isReferenceFeature

        public static boolean isReferenceFeature​(org.apache.uima.cas.Feature f,
                                                 org.apache.uima.cas.TypeSystem ts)
      • isMultiValuedFeatureAttribute

        public static boolean isMultiValuedFeatureAttribute​(org.apache.uima.cas.Type type,
                                                            String attrName)
      • isListTypeName

        public static boolean isListTypeName​(String typeName)
      • resolveListSubtypes

        public static String resolveListSubtypes​(String typeName)
      • completeTypeNames

        public static Set<String> completeTypeNames​(String[] annotationsToRetrieve)
        Complete type names when they are not fully qualified but only the class name itself is given. Completion is done by appending TYPES_NAMESPACE. This will be wrong of course, when the type was actually from another package. An example of this approach to fail would be when only "Header" is given and "...types.pubmed.Header" was meant instead of "...types.Header".
        Parameters:
        annotationsToRetrieve -
        Returns: