use of com.onespatial.jrc.tns.oml_to_rif.model.rif.ModelRifDocument in project hale by halestudio.
the class TestModelAlignmentToModelRif method testTranslateFilter.
/**
* Tests that it is possible to run a translation using the example 3 CP
* source dataset and a predicate filter on the mapping of source classes to
* the target logical schema.
*
* @throws TranslationException
* if any errors occurred during the translation
*/
@Test
public void testTranslateFilter() throws TranslationException {
ModelRifDocument result = translator.translate(getClass().getClassLoader().getResource(// $NON-NLS-1$
"com/onespatial/jrc/tnstg/proto/oml_to_rif/alignments/example3_cp_filter.goml"));
assertNotNull(result);
assertNotNull(result.getSentences());
assertThat(result.getSentences().size(), is(1));
}
use of com.onespatial.jrc.tns.oml_to_rif.model.rif.ModelRifDocument in project hale by halestudio.
the class ModelRifToRifTranslator method translate.
/**
* @see com.onespatial.jrc.tns.oml_to_rif.api.Translator#translate(Object)
* which this method implements.
* @param source
* {@link ModelRifDocument}
* @return {@link Document}
* @throws TranslationException
* if any exceptions are thrown during translation.
*/
@Override
public Document translate(ModelRifDocument source) throws TranslationException {
final Document document = factory.createDocument();
Payload payload = factory.createPayload();
document.setPayload(payload);
GroupContents group = factory.createGroupContents();
payload.setGroup(group);
for (ModelSentence s : source.getSentences()) {
group.getSentence().add(buildSentence(s));
}
return document;
}
use of com.onespatial.jrc.tns.oml_to_rif.model.rif.ModelRifDocument in project hale by halestudio.
the class TestModelAlignmentToModelRif method testTranslateNegationFilter.
/**
* Tests that it is possible to run a translation using the example 3 CP
* source dataset and a logical negation predicate filter on the mapping of
* source classes to the target logical schema.
*
* @throws TranslationException
* if any errors occurred during the translation
*/
@Test
public void testTranslateNegationFilter() throws TranslationException {
ModelRifDocument result = translator.translate(getClass().getClassLoader().getResource(// $NON-NLS-1$
"com/onespatial/jrc/tnstg/proto/oml_to_rif/alignments/example1_tn_road.goml"));
assertNotNull(result);
assertNotNull(result.getSentences());
// CHECKSTYLE:OFF
assertThat(result.getSentences().size(), is(3));
// CHECKSTYLE:ON
}
Aggregations