use of nl.knaw.huygens.timbuctoo.rdf.Collection in project timbuctoo by HuygensING.
the class ArchetypeTripleProcessor method processAssertion.
@Override
protected void processAssertion(String vreName, String subject, String predicate, String object) {
Collection collection = database.findOrCreateCollection(vreName, subject, getLocalName(subject));
// collection must have an archetype
Collection previousArchetype = collection.getArchetype().get();
Optional<Collection> archetypeCollectionOptional = database.findArchetypeCollection(getLocalName(object));
if (!archetypeCollectionOptional.isPresent()) {
return;
}
Collection archetypeCollection = archetypeCollectionOptional.get();
collection.setArchetype(archetypeCollection, object);
Set<Entity> entities = database.findEntitiesByCollection(collection);
entities.forEach(entity -> entity.moveToOtherArchetype(previousArchetype, archetypeCollection));
}
Aggregations