Search in sources :

Example 11 with VID

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.VID in project webanno by webanno.

the class RelationTest method toJsonTest.

@Test
public void toJsonTest() throws IOException {
    MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter();
    String json = JSONUtil.toPrettyJsonString(jsonConverter, new Relation(new VID(1, 2), "type", asList(new Argument("arg1", 1), new Argument("arg2", 2)), "label", "color"));
    assertEquals("[ \"1.2\", \"type\", [ [ \"arg1\", \"1\" ], [ \"arg2\", \"2\" ] ], \"label\", \"color\" ]", json);
}
Also used : VID(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.VID) MappingJackson2HttpMessageConverter(org.springframework.http.converter.json.MappingJackson2HttpMessageConverter) Relation(de.tudarmstadt.ukp.clarin.webanno.brat.render.model.Relation) Argument(de.tudarmstadt.ukp.clarin.webanno.brat.render.model.Argument) Test(org.junit.Test)

Aggregations

VID (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.VID)11 AnnotationFS (org.apache.uima.cas.text.AnnotationFS)8 AnnotatorState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)7 AnnotationFeature (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature)6 FeatureStructure (org.apache.uima.cas.FeatureStructure)5 JCas (org.apache.uima.jcas.JCas)5 TypeAdapter (de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.TypeAdapter)4 Selection (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.Selection)4 TypeUtil (de.tudarmstadt.ukp.clarin.webanno.api.annotation.util.TypeUtil)4 WebAnnoConst (de.tudarmstadt.ukp.clarin.webanno.api.WebAnnoConst)3 ArcAdapter (de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.ArcAdapter)3 ChainAdapter (de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.ChainAdapter)3 SpanAdapter (de.tudarmstadt.ukp.clarin.webanno.api.annotation.adapter.SpanAdapter)3 FeatureState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.FeatureState)3 LinkWithRoleModel (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.LinkWithRoleModel)3 WebAnnoCasUtil.selectByAddr (de.tudarmstadt.ukp.clarin.webanno.api.annotation.util.WebAnnoCasUtil.selectByAddr)3 AnnotationLayer (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer)3 LinkMode (de.tudarmstadt.ukp.clarin.webanno.model.LinkMode)3 MultiValueMode (de.tudarmstadt.ukp.clarin.webanno.model.MultiValueMode)3 Type (org.apache.uima.cas.Type)3