I see, thanks Gandhi. Would you also be able to point me to some source file examples of *reading* from XMIs (like how the ctakesCVD does to populate the "Analysis Results" pane)? I tried tracing down from the org.apache.uima.tools.cvd.CVD package, but could not find where these things are happening.
For those also interested, the relevant snippet of code for generating XMIs from JCASs is: // assuming we already have a jcas object with extracted information > ByteArrayOutputStream output = new ByteArrayOutputStream(); > XmiCasSerializer.serialize(jcas.getCas(), output); > String outputStr = output.toString(); > Files.write(Paths.get("Result.xml"), outputStr.getBytes()); On Mon, Apr 9, 2018 at 11:48 PM, Gandhi Rajan Natarajan < gandhi.natara...@arisglobal.com> wrote: > Hi Reed, > > > > Just check the PipelineRunner class in the link - https://github.com/ > GoTeamEpsilon/ctakes-rest-service/blob/master/ctakes- > web-rest/src/main/java/org/apache/ctakes/rest/service/ > CtakesRestController.java and see if it helps. > > > > *Regards,* > > *Gandhi* > > > > *From:* Reed Villanueva [mailto:villanuevar...@gmail.com] > *Sent:* Tuesday, April 10, 2018 1:15 PM > *To:* email@example.com > *Subject:* How to get XMI output fie from java jcas? > > > > How can I get the output of a pipeline built in java as an XMI file > similar to how piper files output extracted annotation information in form > of XMI files? Eg. I have the code > > > > AggregateBuilder builder = *new *AggregateBuilder(); > > builder.add( ClinicalPipelineFactory.*getDefaultPipeline*() ); > > SimplePipeline.*runPipeline*( jcas, builder.createAggregateDescription() > ); > > > > But how do I get all of the annotation info in XMI form from the jcas > after this (like what gets generated in outputDirectory when doing > > bin/*runClinicalPipeline * -i *inputDirectory* --xmiOut *outputDirectory* > --user *umlsUsername* --pass *umlsPassword* > > )? Also, what class can be used to read existing XMI output files? > > Thank you. > This email and any files transmitted with it are confidential and intended > solely for the use of the individual or entity to whom they are addressed. > If you are not the named addressee you should not disseminate, distribute > or copy this e-mail. Please notify the sender or system manager by email > immediately if you have received this e-mail by mistake and delete this > e-mail from your system. If you are not the intended recipient you are > notified that disclosing, copying, distributing or taking any action in > reliance on the contents of this information is strictly prohibited and > against the law. >