return ciFactory.createContentItem(new UriRef(id), new StringSource(text));
}
@Test
public void tesetBioText() throws EngineException, IOException {
ContentItem ci = wrapAsContentItem(BIO_DOMAIN_TEXT);
try {
zemantaEngine.computeEnhancements(ci);
} catch (EngineException e) {
RemoteServiceHelper.checkServiceUnavailable(e);
return;
}
JenaSerializerProvider serializer = new JenaSerializerProvider();
serializer.serialize(System.out, ci.getMetadata(), TURTLE);
Map<UriRef,Resource> expectedValues = new HashMap<UriRef,Resource>();
expectedValues.put(Properties.ENHANCER_EXTRACTED_FROM, ci.getUri());
expectedValues.put(Properties.DC_CREATOR, LiteralFactory.getInstance().createTypedLiteral(
zemantaEngine.getClass().getName()));
//deactivate require fise:confidence values for fise:TextAnnotations, because
//the one used to group the TopicAnnotations does not have a confidence value
int textAnnoNum = validateAllTextAnnotations(ci.getMetadata(), BIO_DOMAIN_TEXT, expectedValues);
log.info(textAnnoNum + " TextAnnotations found ...");
//adding null as expected for confidence makes it a required property
expectedValues.put(Properties.ENHANCER_CONFIDENCE, null);
int entityAnnoNum = EnhancementStructureHelper.validateAllEntityAnnotations(ci.getMetadata(),expectedValues);
log.info(entityAnnoNum + " EntityAnnotations found ...");
int topicAnnoNum = EnhancementStructureHelper.validateAllTopicAnnotations(ci.getMetadata(),expectedValues);
log.info(topicAnnoNum + " TopicAnnotations found ...");
}