-
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
616 domain knowledge facts rules should be loadable via the rest api #624
base: master
Are you sure you want to change the base?
616 domain knowledge facts rules should be loadable via the rest api #624
Conversation
Next: - Add test for converter.
Also: - created simple unit test for creating the rule.
The function collects all fact rules into a single data rule.
In progress.
Additionally: - unit test for REST API - OpenAPI specification update - Improve Jena Rules.
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.
Two additional comments:
-
I'd recommend adding some tests for edge cases:
a) try to load an empty string/file
b) try and load a file with erroneous syntax
c) try and load a file with valid syntax but that contains something that we don't support (if that's even a thing, if so we should mention it in the docs) -
Do we support all syntax from Apache Jena's rule syntax? I saw something about the language tag somewhere. If not, we should include what syntax is supported in the documentation
reasoner/src/main/java/eu/knowledge/engine/reasoner/util/JenaRules.java
Outdated
Show resolved
Hide resolved
Thanks for the review @Sophietje! A lot of good comments. Regarding the above comments: 1a) Added this case to |
::: | ||
|
||
Loading the above domain knowledge into a smart connector will allow its reasoner to derive that every `saref:Sensor` in the network is also a `saref:Device` and whenever a device is requested using the graph pattern `?d rdf:type saref:Device` it will also return data from KIs with the `?s rdf:type saref:Sensor` graph pattern. The default domain knowledge for every smart connector created in a KE Runtime can be configured using the `ke.domain.knowledge.path` configuration property. See [configuration](https://github.com/TNO/knowledge-engine?tab=readme-ov-file#configuration) section for more info. | ||
|
||
:::tip |
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.
Maybe make this a warning? (see: https://docusaurus.io/docs/next/markdown-features/admonitions for the options that are available)
if (stringRows.size() > 0) { | ||
if (stringRows.size() > 0) | ||
|
||
{ |
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.
Maybe but this bracket on the same line (l.182) as the if-statement, as we do that for the other if-statements as well
// deal with parse exceptions. | ||
var response = new ResponseMessage(); | ||
response.setMessageType("error"); | ||
response.setMessage("The provided doman knowledge should parse correctly: " + pe.getMessage()); | ||
response.setMessage("The provided doman knowledge should parse correctly: " + e.getMessage()); |
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.
Typo: "doman" -> "domain"
No description provided.