Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(snomed.reasoner): Add support for annotation properties in DelegateOntology as well #1291

Merged
merged 4 commits into from
May 8, 2024

Conversation

apeteri
Copy link
Member

@apeteri apeteri commented May 8, 2024

No description provided.

Copy link
Member

@nagyo nagyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@cmark cmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay to me, do we need any additional test cases for this?

@apeteri
Copy link
Member Author

apeteri commented May 8, 2024

@AAAlinaaa added one here:

@Test
public void issue_SO_6106_testSubAnnotationPropertyOfAxiomClassification() throws Exception {
String parentConceptId = createNewConcept(branchPath);
String childConceptId = createNewConcept(branchPath, parentConceptId);
createNewRefSetMember(branchPath, childConceptId, Concepts.REFSET_OWL_AXIOM, Map.of(
SnomedRf2Headers.FIELD_OWL_EXPRESSION, "SubAnnotationPropertyOf(: " + childConceptId + " :" + parentConceptId + ")"));
String classificationId = getClassificationJobId(beginClassification(branchPath));
waitForClassificationJob(branchPath, classificationId)
.statusCode(200)
.body("status", equalTo(ClassificationStatus.COMPLETED.name()));
InputStream inputStream = getRelationshipChanges(branchPath, classificationId)
.statusCode(200)
.extract()
.asInputStream();
Collection<RelationshipChange> changes = MAPPER.readValue(inputStream, RelationshipChanges.class).getItems();
Multimap<String, RelationshipChange> changesBySource = Multimaps.index(changes, c -> c.getRelationship().getSourceId());
Collection<RelationshipChange> parentRelationshipChanges = changesBySource.get(parentConceptId);
Collection<RelationshipChange> childRelationshipChanges = changesBySource.get(childConceptId);
for (RelationshipChange change : parentRelationshipChanges) {
assertEquals(ChangeNature.NEW, change.getChangeNature());
assertEquals(Concepts.IS_A, change.getRelationship().getTypeId());
assertEquals(Concepts.ROOT_CONCEPT, change.getRelationship().getDestinationId());
}
for (RelationshipChange change : childRelationshipChanges) {
assertEquals(ChangeNature.NEW, change.getChangeNature());
assertEquals(Concepts.IS_A, change.getRelationship().getTypeId());
assertEquals(parentConceptId, change.getRelationship().getDestinationId());
}
}

I think the child concept has a stated IS A relationship due to the test helper and this is why it passed earlier. I'll try to break it then see if the change fixes it 🔧

Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 62.68%. Comparing base (4dcc43a) to head (31d524e).
Report is 19 commits behind head on 7.x.

❗ Current head 31d524e differs from pull request most recent head 0acc688. Consider uploading reports for the commit 0acc688 to get more accurate results

Files Patch % Lines
...owl/snomed/reasoner/ontology/DelegateOntology.java 50.00% 16 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                7.x    #1291      +/-   ##
============================================
+ Coverage     62.62%   62.68%   +0.05%     
- Complexity    11506    11524      +18     
============================================
  Files          1612     1612              
  Lines         55173    55223      +50     
  Branches       5443     5451       +8     
============================================
+ Hits          34551    34615      +64     
+ Misses        18423    18404      -19     
- Partials       2199     2204       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@cmark cmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥓

@cmark cmark merged commit 2d5ed54 into 7.x May 8, 2024
0 of 2 checks passed
@cmark cmark deleted the issue/SO-6101-annotation-properties-in-delegateontology branch May 8, 2024 12:25
@apeteri apeteri added port-to-9.x Pull requests that need a complementary PR targeting the 9.x stream and removed port-to-9.x Pull requests that need a complementary PR targeting the 9.x stream labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants