-
Notifications
You must be signed in to change notification settings - Fork 4
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
44 validation cannot handle asserted relations with inferred assets #56
44 validation cannot handle asserted relations with inferred assets #56
Conversation
…irectly encoded links are not overwritten. Addresses #44.
…irectly encoded links are not overwritten. Addresses #52.
…erred-assets' of github.com:SPYDERISK/system-modeller into 44-validation-cannot-handle-asserted-relations-with-inferred-assets
…a bug in JenaQuerier.fixCardinalityConstraintURI() whereby CC URIs involving inferred assets were corrupted by revalidation.
…'t crash if the asset does not yet exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes seem reasonable, although I'm struggling to understand much of it.
I did some testing. Firstly just to say I couldn't find v6a3-1-2-beta1, although I did get hold of v6a3-1-2. Not sure if this is a problem?
Using this, I tested first on dev and did get an Exception where expected. I then tried this branch, which gave no errors. As far as I can tell, it produces inferred assets that you mentioned, although was I supposed to see those listed in #52? I don't see OutputPool for example.
If the above can be clarified, then I could approve the merge I think, as long as you are pretty sure that it behaves as you expect. I'll also run the unit tests manually, to be sure.
@kenmeacham : thanks for taking a look. Here are some clarifications on the test case. The version number on the domain model should be OK. The last domain model fix is not yet merged, so I tried to give it the tag 'v6a3-1-2-beta1', but I think I screwed that up and ended up making it 'v6a3-1-2'. The list of assets from issue #52 is what you should see before the Sensor-stores-[Data:Sensor] link was added. The issue there was that some of the links were not stored properly. So the point at which that should be checked is before you add the asserted link. Once the asserted link has been added, we should get a total of 11 assets:
The relationships are obviously a little different as well. Before issue #52 was addressed, only outgoing relationships from the Sensor device would have been stored. Now we should get 23 inferred relationship plus the 1 asserted relationship we added. |
Thanks for the clarification. I see the assets that you described, after initial validation, then adding the relation, etc. What doesn't yet match is the relations. This is what I currently see to/from the Sensor: |
@kenmeacham : there was a slight glitch in my previous comment. The number of assets is indeed 11, but I was using domain-network v6a3-1-1 which gets the inferred relationships slightly wrong. With v6a3-1-2, we should get 27 not 23 inferred relationships. I have now checked the validated model as downloaded from your test system. You are getting the expected results: 11 assets, 28 relationships, 117 threats (plus 4 modelling error threats), 53 active control types related to the 11 assets, and 45 visible consequences, etc. |
Great. On that basis it seems that the fix is working, so I'll OK the pull request :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to merge, based on the latest tests and validation of results, etc.
There is now an update to the domain-network KB addressing issue Spyderisk/domain-network#23, which is tagged as v6a3-1-2-beta1 in the Spyderisk domain-network repository.
With this in place, it is possible to run a simple test of the system-modeller fix on branch 44 using the attached system model, which contains a single IoT Sensor. The test sequence is as follows:
Before the fix, the first validation failed to insert the correct relationship between the Process and Data, due to issue #52. The revalidation would then crash due to issue #44 (a separate problem not due to issue #52).
The fix consists of changes to the implementation of caching and especially cache synchronisation which were the cause of issue #52, and changes to the method for retrieving assets from the triple store which caused issue #44.
Closes #52, #44.
Issue 44 Test - Asserted - Before.nq.gz