use of nl.knaw.huygens.timbuctoo.rml.rmldata.RmlMappingDocument in project timbuctoo by HuygensING.
the class RmlMapperTest method canHandleMappingsInTheWrongOrder.
@Test
public void canHandleMappingsInTheWrongOrder() {
final String theNamePredicate = "http://example.org/vocab#name";
final String theWrittenByPredicate = "http://example.org/vocab#writtenBy";
RmlMappingDocument rmlMappingDocument = rmlMappingDocument().withTripleMap("http://example.org/documentsMap", makeDocumentMap(theWrittenByPredicate)).withTripleMap("http://example.org/personsMap", makePersonMap(theNamePredicate)).build(makePersonDocumentSourceFactory());
List<Quad> result = rmlMappingDocument.execute(new ThrowingErrorHandler()).collect(toList());
assertThat(result, contains(likeTriple(uri("http://www.example.org/persons/1"), uri(theNamePredicate), literal("Bill")), likeTriple(uri("http://www.example.org/documents/1"), uri(theWrittenByPredicate), uri("http://www.example.org/persons/1"))));
}
Aggregations