Package de.julielab.xml
Class XmiSplitUtilities
- java.lang.Object
-
- de.julielab.xml.XmiSplitUtilities
-
public class XmiSplitUtilities extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCAS_NULLstatic StringCAS_SOFAstatic StringCAS_VIEWstatic List<String>primitivesRanges of features that will erroneously (for our purposes) have the status of not being primitive.static StringTYPES_NAMESPACEThe default types namespace that is assumed if not the fully qualified java name is given for an annotation.
-
Constructor Summary
Constructors Constructor Description XmiSplitUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<String>completeTypeNames(String[] annotationsToRetrieve)Complete type names when they are not fully qualified but only the class name itself is given.static StringconvertNSUri(String nameSpace)Extracts the first part of the fully qualified java name from the namespace uri.static org.apache.uima.cas.TypegetFeatureType(org.apache.uima.cas.Type annotationType, String featureName)static StringgetTypeJavaName(StartElement element)Extracts the fully qualified java name for an element.static booleanisAnnotationType(String qualifiedTypename)static booleanisFSArray(org.apache.uima.cas.Type annotationType)TODO: Are there any Feature Structures other than FSArray that link annotations (e.g.static booleanisListTypeName(String typeName)static booleanisMultiValuedFeatureAttribute(org.apache.uima.cas.Type type, String attrName)static booleanisPrimitive(org.apache.uima.cas.Type type)TODO: See class variable primitives...static booleanisPrimitive(org.apache.uima.cas.Type annotationType, String featureName)static booleanisReferenceAttribute(org.apache.uima.cas.Type annotationType, String attributeName, org.apache.uima.cas.TypeSystem ts)static booleanisReferenceFeature(org.apache.uima.cas.Feature f, org.apache.uima.cas.TypeSystem ts)static ByteBufferreadInputStreamIntoBuffer(InputStream is)static ByteArrayOutputStreamreadInputStreamIntoByteArrayOutputStream(InputStream is)static StringresolveListSubtypes(String typeName)
-
-
-
Field Detail
-
CAS_NULL
public static final String CAS_NULL
- See Also:
- Constant Field Values
-
CAS_VIEW
public static final String CAS_VIEW
- See Also:
- Constant Field Values
-
CAS_SOFA
public static final String CAS_SOFA
- See Also:
- Constant Field Values
-
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
-
-
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)
-
readInputStreamIntoBuffer
public static ByteBuffer readInputStreamIntoBuffer(InputStream is) throws IOException
- Throws:
IOException
-
readInputStreamIntoByteArrayOutputStream
public static ByteArrayOutputStream readInputStreamIntoByteArrayOutputStream(InputStream is) throws IOException
- Throws:
IOException
-
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 appendingTYPES_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:
-
-