use of com.b2international.snowowl.snomed.reasoner.index.EquivalentConceptSetDocument in project snow-owl by b2ihealthcare.
the class EquivalentConceptSetSerializationTest method indexClassificationTask.
@Test
public void indexClassificationTask() throws Exception {
final String classificationId = randomUUID();
final EquivalentConceptSetDocument expected = EquivalentConceptSetDocument.builder().classificationId(classificationId).conceptIds(PrimitiveLists.newLongArrayList(1L, 2L, 3L)).unsatisfiable(true).build();
indexDocument(expected);
final EquivalentConceptSetDocument actual = rawIndex().read(r -> r.search(Query.select(EquivalentConceptSetDocument.class).where(Expressions.matchAll()).build()).first());
assertDocEquals(expected, actual);
}
use of com.b2international.snowowl.snomed.reasoner.index.EquivalentConceptSetDocument in project snow-owl by b2ihealthcare.
the class ClassificationTracker method indexUnsatisfiableConcepts.
private void indexUnsatisfiableConcepts(final Writer writer, final String classificationId, final IInternalSctIdSet unsatisfiableConcepts) throws IOException {
if (!unsatisfiableConcepts.isEmpty()) {
final EquivalentConceptSetDocument equivalentDoc = EquivalentConceptSetDocument.builder().classificationId(classificationId).conceptIds(unsatisfiableConcepts.toLongList()).unsatisfiable(true).build();
writer.put(equivalentDoc);
}
}
use of com.b2international.snowowl.snomed.reasoner.index.EquivalentConceptSetDocument in project snow-owl by b2ihealthcare.
the class ClassificationTracker method indexEquivalentConcepts.
private void indexEquivalentConcepts(final Writer writer, final String classificationId, final IInternalSctIdMultimap equivalentConcepts) throws IOException {
for (final LongIterator itr = equivalentConcepts.keySet().iterator(); itr.hasNext(); ) /*empty*/
{
final long representativeConcept = itr.next();
final LongSet equivalents = equivalentConcepts.get(representativeConcept);
final LongList orderedConcepts = PrimitiveLists.newLongArrayListWithExpectedSize(equivalents.size() + 1);
orderedConcepts.add(representativeConcept);
orderedConcepts.addAll(equivalents);
final EquivalentConceptSetDocument equivalentDoc = EquivalentConceptSetDocument.builder().classificationId(classificationId).conceptIds(orderedConcepts).unsatisfiable(false).build();
writer.put(equivalentDoc);
}
}
Aggregations