Skip to content

Commit

Permalink
MAINT-2452 Use current OWL Expression if axiom inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcgihtsdo committed Jul 17, 2024
1 parent d84f7d7 commit d462f4f
Showing 1 changed file with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,25 @@ public void populateAxiomMembers(Collection<Concept> concepts, String branchPath
AxiomRelationshipConversionService conversionService = setupConversionService(branchPath);
for (Concept concept : concepts) {
for (Axiom axiom : concept.getClassAxioms()) {
String owlExpression = conversionService.convertRelationshipsToAxiom(mapFromInternalRelationshipType(concept.getConceptId(), axiom.getDefinitionStatusId(), axiom.getRelationships(), true));
String owlExpression;
ReferenceSetMember referenceSetMember = getReferenceSetMember(axiom, branchPath);
if (!axiom.isActive() && referenceSetMember != null) {
owlExpression = referenceSetMember.getAdditionalField(ReferenceSetMember.OwlExpressionFields.OWL_EXPRESSION);
} else {
owlExpression = conversionService.convertRelationshipsToAxiom(mapFromInternalRelationshipType(concept.getConceptId(), axiom.getDefinitionStatusId(), axiom.getRelationships(), true));
}

axiom.setReferenceSetMember(createMember(concept, axiom, owlExpression));
}
for (Axiom gciAxiom : concept.getGciAxioms()) {
String owlExpression = conversionService.convertRelationshipsToAxiom(mapFromInternalRelationshipType(concept.getConceptId(), gciAxiom.getDefinitionStatusId(), gciAxiom.getRelationships(), false));
String owlExpression;
ReferenceSetMember referenceSetMember = getReferenceSetMember(gciAxiom, branchPath);
if (!gciAxiom.isActive() && referenceSetMember != null) {
owlExpression = referenceSetMember.getAdditionalField(ReferenceSetMember.OwlExpressionFields.OWL_EXPRESSION);
} else {
owlExpression = conversionService.convertRelationshipsToAxiom(mapFromInternalRelationshipType(concept.getConceptId(), gciAxiom.getDefinitionStatusId(), gciAxiom.getRelationships(), false));
}

gciAxiom.setReferenceSetMember(createMember(concept, gciAxiom, owlExpression));
}
}
Expand Down Expand Up @@ -167,4 +181,13 @@ private AxiomRepresentation mapFromInternalRelationshipType(String conceptId, St
}
return axiomRepresentation;
}

private ReferenceSetMember getReferenceSetMember(Axiom axiom, String branchPath) {
ReferenceSetMember referenceSetMember = axiom.getReferenceSetMember();
if (referenceSetMember == null && axiom.getId() != null) {
return memberService.findMember(branchPath, axiom.getId());
}

return referenceSetMember;
}
}

0 comments on commit d462f4f

Please sign in to comment.