use of com.b2international.snowowl.snomed.datastore.request.SnomedOWLExpressionConverterResult in project snow-owl by b2ihealthcare.
the class SnomedRefSetMemberDocumentSerializationTest method createClassAxiomMember.
private SnomedRefSetMemberIndexEntry createClassAxiomMember() {
final String referencedComponentId = "245567007";
final String owlExpression = "SubClassOf(:245567007 ObjectIntersectionOf(:245565004 :420479003 :7121006 ObjectSomeValuesFrom(:272741003 :24028007)))";
final SnomedOWLExpressionConverterResult owlRelationships = toSnomedOWLRelationships(referencedComponentId, owlExpression);
return createBaseMember().referencedComponentId(referencedComponentId).refsetId(Concepts.REFSET_OWL_AXIOM).referenceSetType(SnomedRefSetType.OWL_AXIOM).field(Fields.OWL_EXPRESSION, owlExpression).classAxiomRelationships(owlRelationships.getClassAxiomRelationships()).gciAxiomRelationships(owlRelationships.getGciAxiomRelationships()).build();
}
use of com.b2international.snowowl.snomed.datastore.request.SnomedOWLExpressionConverterResult in project snow-owl by b2ihealthcare.
the class SnomedRefSetMemberDocumentSerializationTest method indexOWLAxiomMember_ISA.
@Test
public void indexOWLAxiomMember_ISA() throws Exception {
final String referencedComponentId = "410607006";
final String owlExpression = "SubClassOf(:410607006 :138875005)";
final SnomedOWLExpressionConverterResult owlRelationships = toSnomedOWLRelationships(referencedComponentId, owlExpression);
final SnomedRefSetMemberIndexEntry member = createBaseMember().referencedComponentId(referencedComponentId).refsetId(Concepts.REFSET_OWL_AXIOM).referenceSetType(SnomedRefSetType.OWL_AXIOM).field(Fields.OWL_EXPRESSION, owlExpression).classAxiomRelationships(owlRelationships.getClassAxiomRelationships()).gciAxiomRelationships(owlRelationships.getGciAxiomRelationships()).build();
indexRevision(RevisionBranch.MAIN_PATH, member);
final SnomedRefSetMemberIndexEntry actual = getRevision(RevisionBranch.MAIN_PATH, SnomedRefSetMemberIndexEntry.class, member.getId());
assertEquals(owlExpression, actual.getOwlExpression());
assertEquals(ImmutableList.of(SnomedOWLRelationshipDocument.create(Concepts.IS_A, Concepts.ROOT_CONCEPT, 0)), actual.getClassAxiomRelationships());
assertThat(actual.getGciAxiomRelationships()).isEmpty();
assertDocEquals(member, actual);
}
use of com.b2international.snowowl.snomed.datastore.request.SnomedOWLExpressionConverterResult in project snow-owl by b2ihealthcare.
the class SnomedRepositoryPreCommitHook method collectIds.
private void collectIds(Set<String> sourceIds, Set<String> destinationIds, SnomedRefSetMemberIndexEntry owlMember, SnomedOWLExpressionConverter expressionConverter) {
final String memberId = owlMember.getId();
final String referencedComponentId = owlMember.getReferencedComponentId();
final String owlExpression = owlMember.getOwlExpression();
SnomedOWLExpressionConverterResult result = expressionConverter.toSnomedOWLRelationships(referencedComponentId, owlExpression);
if (!CompareUtils.isEmpty(result.getClassAxiomRelationships())) {
for (SnomedOWLRelationshipDocument owlRelationship : result.getClassAxiomRelationships()) {
if (Concepts.IS_A.equals(owlRelationship.getTypeId())) {
// XXX: IS A relationships are expected to have a destination ID, not a value
checkState(!owlRelationship.hasValue(), "IS A relationship found with value on OWL member: %s", memberId);
sourceIds.add(referencedComponentId);
destinationIds.add(owlRelationship.getDestinationId());
}
}
}
}
Aggregations