uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diman Karagiozov <di...@tetracom.com>
Subject Re: UIMA XMI File to UIMA CAS
Date Mon, 20 Dec 2010 06:49:58 GMT
Hi there,

This is how I am doing the XMI deserialization:

                 // deserialize the type system
                 final XMLInputSource xmlIn = new XMLInputSource( new 
ByteArrayInputStream( ( byte[] ) someObejct ), null );
                 final TypeSystemDescription tsDesc = 
UIMAFramework.getXMLParser().parseTypeSystemDescription( xmlIn );

                 // deserialize the CAS
                 final CAS cas = CasCreationUtils.createCas( tsDesc, 
null, null );

                 XmiCasDeserializer.deserialize( new 
ByteArrayInputStream( ( byte[] ) someOtherObject ), cas, false );

                 return cas;

It is important to de-serialize the type system as well.

greetings
Diman

On 12/19/2010 10:35 PM, Timur wrote:
> need to convert UIMA XMI File to UIMA CAS. Please point me in
> the right direction.
>
> I am trying to do:
>
> XmiCasDeserializer.deserialize (InputStream, CAS)
>
> The Problem is i can't create an empty CAS that doesn't give me
> a NullPointer Exception.
>


Mime
View raw message