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

SO-1922 proximal primitive algorithm fixes #70

Merged
merged 2 commits into from
Apr 4, 2016

Conversation

cmark
Copy link
Member

@cmark cmark commented Apr 1, 2016

Fix, move and improve getProximalPrimitiveParents algorithm.

Fix, move and improve getProximalPrimitiveParents algorithm.
// if the current candidate is a subtype of any already visited nodes, then replace those nodes
if (isSubTypeOf(primitiveAncestorId, id)) {
proximalPrimitiveParentIds.remove(id);
proximalPrimitiveParentIds.add(primitiveAncestorId);
Copy link
Member

Choose a reason for hiding this comment

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

Can the following scenario happen:

  • primitiveAncestorId wins over 1..n existing ids in the set, removing them;
  • one of the remaining ids (let's call it winningId) wins over primitiveAncestorId?

In this case, it is good that we figured out that winningId should have removed the 1-n ids before, but we should not add primitiveAncestorId either.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added a couple more test cases to verify the algorithm, it seems to work properly. If you manage to come up with a counterexample, please let me know. 😄

Copy link
Member

Choose a reason for hiding this comment

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

Concerns were alleviated after careful consideration. 😸

@bulrich
Copy link
Member

bulrich commented Apr 4, 2016

This performance improvement would also be useful to the IHTSDO. Their SCA tooling doesn't allow creating children or siblings as in Snow Owl, but they build a graphical authoring form that requires the proximate primitive parent.

@cmark cmark merged commit c6db68a into develop Apr 4, 2016
@cmark cmark deleted the issue_SO-1922-proximal-primitive-fixes branch June 19, 2017 10:40
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.

None yet

3 participants