uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marshall Schor <...@schor.com>
Subject Re: Use of CASes with sofaURI?
Date Fri, 25 Oct 2019 15:50:52 GMT
hi, not my area of expertise, but the docs say


that if you're using a URI, then you use the cas.getSofaDataURI(), which returns
a string representation of the URI.

To get the data, the docs say you need to set up some standard Java I/O.

There's also a special cas method, getSofaDataStream, which returns an input
stream, and works with both local and remote data.


On 10/24/2019 6:11 PM, Richard Eckart de Castilho wrote:
> Hi there,
> does somebody have an example of how to work with CASes that where the sofa data is not
set using setDocumentText() but rather using setSofaDataURI(...)?         
> It looks like the CAS text is then not accessible via the usual means:
> 	CAS cas = CasCreationUtils.createCas((TypeSystemDescription) null, null, null);
>         cas.setSofaDataURI("https://www.apache.org/licenses/LICENSE-2.0.txt", "text/plain");
>         CasIOUtils.save(cas, System.out, SerialFormat.XMI);
>         System.out.println(cas.getDocumentText()); // -> prints "null"
>         System.out.println(cas.getSofaDataString()); // -> prints "null"
> Apparently, one needs to call getSofaDataStream() - but even after calling that, getDocumentAnnotation().getCoveredText()
returns null.
> So how is one expected to work with CASes that are using this data URI concept?
> Cheers,
> -- Richard

View raw message