You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restructuring documentation to enable website generation (#509)
* Add initial version of docs for website
* Enabled plugin for (local) search functionality
* Cleaned up settings & added Tabs & Syntax Highlighting for Code Blocks
* Minor textual improvements & using Tabs for Reasoning page
* Create Github Action for deployment of documentation website
Welcome to the source code repository of the Knowledge Engine.
10
10
This README should help you understand what the Knowledge Engine is, and how to use it.
@@ -181,7 +181,7 @@ This section gives more detailed information about the project's structure, and
181
181
182
182
The Knowledge Engine project consists of the following Maven modules:
183
183
-`smart-connector`
184
-
- This is the implementation of the smart connector, with the Java developer API. For instructions on how to use it, refer to [the documentation](./docs/03_java_developer_api.md).
184
+
- This is the implementation of the smart connector, with the Java developer API. For instructions on how to use it, refer to [the documentation](./docs/docs/java_developer_api.md).
185
185
-`smart-connector-api`
186
186
- This module contains interfaces for the smart connector and other classes. It is made as a separate module so that it is easy to use different implementations of the interfaces.
### Starting the Knowledge Engine in distributed mode
259
-
The Knowledge Engine can also start in distributed mode, where it connects with a remote knowledge directory and where different instances of the Knowledge Engine (each instance hosting one or more smart connectors) can communicate with each other. More information about starting the Knowledge Engine in distributed mode can be found in the [documentation](docs/04_distributed_mode.md).
259
+
The Knowledge Engine can also start in distributed mode, where it connects with a remote knowledge directory and where different instances of the Knowledge Engine (each instance hosting one or more smart connectors) can communicate with each other. More information about starting the Knowledge Engine in distributed mode can be found in the [documentation](docs/docs/distributed_mode.md).
This directory contains the documentation for the Knowledge Engine as well as the required settings that are used to generate the documentation website.
4
+
The documentation can be found in the `docs/` directory.
5
+
6
+
7
+
## Generating the website
8
+
9
+
Required:
10
+
-[Node.js](https://nodejs.org/en/download/) version 18.0 or above:
11
+
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
12
+
13
+
### Generate website files
14
+
To statically generate the website, within this directory (`knowledge-engine/docs/`), run:
15
+
```bash
16
+
npm run build
17
+
```
18
+
This will generate a `build/` directory containing all files for the website.
19
+
20
+
Be careful when editing code blocks with tabs.
21
+
Currently, it requires you to leave empty lines around the Markdown syntax
22
+
23
+
24
+
25
+
### Test the site locally
26
+
27
+
If you're working on the documentation, you can locally run a serve so you can easily see what your changes look like.
28
+
To run the development server, within this directory (`knowledge-engine/docs/`), execute:
29
+
```bash
30
+
npm run start
31
+
```
32
+
33
+
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
34
+
The site will **automatically reload** and display your changes.
Copy file name to clipboardExpand all lines: docs/docs/conceptual_framework.md
+15-38
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
---
2
+
sidebar_position: 2
3
+
---
4
+
1
5
# Conceptual Framework
2
6
3
7
This section explains the ideas behind the Knowledge Engine.
@@ -18,7 +22,7 @@ However, much power lies in *combining* several of these knowledge bases (explai
18
22
19
23
An important assumption that we make is that a knowledge base can be sufficiently described in terms of the knowledge that it processes.
20
24
This means that we can describe what kind of knowledge can be extracted from this base and what kind of knowledge this base is interested in, and that we capture this well enough to provide synergy to the network.
21
-
In other words, we assume that we can make a description of the knowledge base that captures its knowledge input and output ([knowledge Interaction](#knowledge-interaction)): What knowledge does it provide? What knowledge does it require?
25
+
In other words, we assume that we can make a description of the knowledge base that captures its knowledge input and output ([Knowledge Interaction](#knowledge-interaction)): What knowledge does it provide? What knowledge does it require?
22
26
Furthermore, we assume that we capture the knowledge interactions of a knowledge base well enough that it can be exploited or satisfied by *other* knowledge bases.
23
27
24
28
It is important to note that knowledge bases aren't limited to being *just* producers or consumers of information; they could trigger **side effects**, and thus play a role in control systems such as heating systems or artificial cardiac pacemakers.
@@ -48,11 +52,11 @@ To their surprise, it is now necessary to install another app!
48
52
In the example above, there were three physical devices: The phone and the two light bulbs.
49
53
However, the phone contained two 'knowledge bases' and the knowledge for both light bulb systems was completely siloed:
50
54
51
-

55
+

52
56
53
57
It would be convenient if the silos exchanged information, or better, if there was a single generic app that can communicate with both bulbs:
54
58
55
-

59
+

56
60
57
61
Because of these obvious advantages, combining knowledge bases like this is becoming increasingly common.
58
62
Currently, these combinations are often hand-made, and it would be convenient to make this easier.
@@ -68,7 +72,7 @@ This is solved by smart connectors.
68
72
A smart connector is an entity (currently in the form of a Java object) that allows a knowledge base to register with the knowledge network, and exchange knowledge with it.
69
73
It represents the knowledge base within the knowledge network, and acts on its behalf.
70
74
71
-
In the registration phase, the knowledge base has to specify how it wants to exchange what knowledge (the [knowledge Interaction](#knowledge-interaction)):
75
+
In the registration phase, the knowledge base has to specify how it wants to exchange what knowledge (the [Knowledge Interaction](#knowledge-interaction)):
72
76
73
77
- What knowledge can be requested from me?
74
78
- What knowledge will I publish to the network?
@@ -85,11 +89,11 @@ In the exchange phase, knowledge is consumed, produced, or published by the know
85
89
A requirement for being able to use smart connectors in a domain is that all knowledge bases need to agree on a common language to exchange their knowledge in.
86
90
This language is different for every domain.
87
91
(In the thermostat example above, this language should include concepts like measurements, temperature, and preferences.)
88
-
In the knowledge engine, this language can be expressed in the form of an ontology or knowledge model, which is explained further in [a following section](#knowledge-model).
92
+
In the Knowledge Engine, this language can be expressed in the form of an ontology or knowledge model, which is explained further in [a following section](#knowledge-model).
89
93
90
94
The domain's knowledge model is written in RDF/OWL, which allows us to take advantage of the reasoning capabilities that are available for these models.
91
95
92
-
Since the knowledge engine internally knows about the supply and demand of knowledge in the network, it can use reasoning to orchestrate of knowledge supply on-demand.
96
+
Since the Knowledge Engine internally knows about the supply and demand of knowledge in the network, it can use reasoning to orchestrate of knowledge supply on-demand.
93
97
94
98
Critically, this means that, given a specification of knowledge that is requested, a smart connector **can figure out for you where to get it**!
95
99
The developer of a knowledge base doesn't have to know or care about the specifics of all other knowledge bases.
@@ -101,11 +105,11 @@ The main advantages of using smart connectors are:
101
105
- Changes in the knowledge network are handled seamlessly by synchronizing information about knowledge interactions.
102
106
- Established open-source Semantic Web technologies are leveraged to provide knowledge models and reasoning capabilities.
103
107
104
-
## Dynamic knowledge network
108
+
## Dynamic Knowledge Network
105
109
106
110
As long as the smart connectors are aware of changes in the network, new knowledge bases can be dynamically added to the network.
107
111
108
-
Information about the [knowledge Interactions](#knowledge-interaction) of smart connectors is synchronized by using a [*knowledge directory*](#knowledge-directory), explained [further on](#knowledge-directory).
112
+
Information about the [Knowledge Interactions](#knowledge-interaction) of smart connectors is synchronized by using a [*Knowledge Directory*](#knowledge-directory), explained [further on](#knowledge-directory).
109
113
110
114
For example, we could add a smart curtain to the hypothetical home automation knowledge network that automatically closes the curtains when the lights in the same room are turned on after sunset.
111
115
@@ -167,35 +171,8 @@ The simple temperature sensor in the example is unable to store much data, so it
167
171
168
172
Since all smart connectors need to know about each other to exchange knowledge, they need a way to know of each other. The current solution implements this with a centralized knowledge directory. The knowledge directory is aware of all KE runtimes. The KE runtimes communicate with each other to receive information about all smart connectors within a particular KE runtime.
169
173
170
-
The Knowledge Engine runtimes can be started in distributive mode and non-distributive mode. In distributive mode, the KE runtime connects with a Knowledge Directory to discover other KE runtimes. In this mode, data exchange happens between smart connectors that live in any KE runtime that is registered with a particular Knowledge Directory. This is the preferred mode of the Knowledge Engine which is more decentralized because every actor hosts its own smart connector. More information about distributed mode can be found in the chapter on the [Distributed mode](04_distributed_mode.md).
171
-
172
-
The knowledge engine can also be started in non-distributive mode in which it does not connect to a Knowledge Directory and also does not cooperate with other KE runtimes. In this mode, data exchange only happens between smart connectors that live in this single KE runtime. This mode is useful for getting started with the Knowledge Engine and for development and testing purposes.
173
-
174
-
*Note: Developers using smart connectors do not need to know about the knowledge directory since the communication and synchronization is handled by the smart connectors internally.*
175
-
176
-
## Rules
177
-
178
-
<!-- TODO: Is information like this necessary for developers using smart connectors? They don't need to write rules, or do they? -->
179
-
180
-
An if-then statement that tells the reasoner how to derive inferred facts from asserted facts. There are many forms of reasoning, but backward reasoning and forward reasoning are the typical ones. Backward reasoning means reasoning to prove a certain statement (i.e. question). This is also called goal-based reasoning, because you reason towards a particular goal (or actually, from a goal backwards to the actual data). Forward reasoning is also called data-driven reasoning, because it starts from the data and tries to infer all possible facts from this data using the available rules.
181
-
182
-
## Security
183
-
184
-
*__General direction Knowledge Engine security__*
185
-
186
-
Within the KE we distinguish between several parts of the security question and explain below how we expect to deal with those:
187
-
188
-
1)**connection between Knowledge Base (KB) and Smart Connector (SC)**: When using _Java_ Developer API this is secure by default, however, when using the REST Developer API we need to be more careful. The Generic Adapter and Service Store already provide some solution for this.
189
-
2)**connection between SC and SC** (when in different Java Virtual Machines): By using a configurable Exposed URL (see [issue](https://gitlab.inesctec.pt/interconnect/knowledge-engine/-/issues/281)) the KE remains flexible with respect to the setup it is used in. This Exposed URL can point directly to the SC or to a proxy that is configured for HTTPS with certificates.
190
-
3)**connection between SC and Knowledge Directory (KD)**: The Knowledge Directory itself exposes a REST API that we recommend to be put behind a HTTPS proxy. SCs have a configuration option to point to the URL of the Knowledge Directory. This can be both HTTP and HTTPS.
191
-
4)**identification/authentication**: Still unclear, but we are thinking about *not* introducing the concept of a user within the KE. The reason is that the only way other KBs can really trust a user, is by having a centralized Identity Provider that all KBs can access which constrasts the distributed nature of the KE. But again, not sure about whether we can maintain this position. Sharing login credentials and JWT tokens through the KE by including them in the domain knowledge is of course possible and this indeed requires the ontologies to contain classes and properties related to login and token information.
192
-
5)**authorization**: In the future we want to support roles and access control policies that are agreed upon by all KBs and it should make up the domain knowledge together with the ontology. We will definitely work on this in the future, but probably not in the scope of InterConnect.
193
-
194
-
195
-
*__Sharing credentials__*
196
-
197
-
As I mentioned in my previous comment there is no _right_ way to deal with sharing credentials. More discussion and experience is definitely necessary to find the sweet spot for security related issues like these. In your use cases, the easiest and safest way is probably to share the credentials outside of the Knowledge Engine and just use some token (or home id) in the graph pattern, but it might be interesting to see how actually sending the credentials through the KE works out using a login graph pattern. Keep in mind, though, that the KE does not encrypt anything by itself and that the credentials might be visible to others.
174
+
The Knowledge Engine runtimes can be started in distributive mode and non-distributive mode. In distributive mode, the KE runtime connects with a Knowledge Directory to discover other KE runtimes. In this mode, data exchange happens between smart connectors that live in any KE runtime that is registered with a particular Knowledge Directory. This is the preferred mode of the Knowledge Engine which is more decentralized because every actor hosts its own smart connector.
198
175
199
-
## Mathematical framework
176
+
The Knowledge Engine can also be started in non-distributive mode in which it does not connect to a Knowledge Directory and also does not cooperate with other KE runtimes. In this mode, data exchange only happens between smart connectors that live in this single KE runtime. This mode is useful for getting started with the Knowledge Engine and for development and testing purposes.
200
177
201
-
The aim is to make a mathematical description of this framework, but for that we first need to stabilize our vision.
178
+
*Note: Developers using smart connectors do not need to know about the Knowledge Directory since the communication and synchronization is handled by the Smart Connectors internally.*
0 commit comments