use of nl.knaw.huygens.timbuctoo.core.dto.ReadEntity in project timbuctoo by HuygensING.
the class TripleImporterIntegrationTest method importTripleShouldConnectTheSubjectEntityToTheCollectionNamedByTheObject.
@Test
public void importTripleShouldConnectTheSubjectEntityToTheCollectionNamedByTheObject() throws Exception {
final Triple abadan = createTripleIterator(ABADAN_HAS_TYPE_FEATURE_TRIPLE).next();
instance.importTriple(true, abadan);
rdfImportSession.commit();
rdfImportSession.close();
Optional<ReadEntity> readEntity = getReadEntity(COLLECTION_NAME, ABADAN_URI);
assertThat(readEntity, is(present()));
}
use of nl.knaw.huygens.timbuctoo.core.dto.ReadEntity in project timbuctoo by HuygensING.
the class TripleImporterIntegrationTest method importTripleShouldMapToARelationBetweenTheSubjectAndAnExistingObjectVertex.
@Test
public void importTripleShouldMapToARelationBetweenTheSubjectAndAnExistingObjectVertex() throws Exception {
final Triple abadan = createTripleIterator(ABADAN_POINT_TRIPLE).next();
final Triple iran = createTripleIterator(IRAN_POINT_TRIPLE).next();
final Triple relation = createTripleIterator(ABADAN_IS_PART_OF_IRAN_TRIPLE).next();
instance.importTriple(true, abadan);
instance.importTriple(true, iran);
instance.importTriple(true, relation);
rdfImportSession.commit();
rdfImportSession.close();
Collection collectionMetadata = timbuctooActions.getCollectionMetadata(DEFAULT_COLLECTION_NAME);
DataStream<ReadEntity> result = timbuctooActions.getCollection(collectionMetadata, 0, 10, false, (entity, entityVertex) -> {
}, (traversalSource, vre, target, relationRef) -> {
});
assertThat(result.map(readEntity -> readEntity), hasSize(2));
}
Aggregations