Skip to content

Commit 5d3dfe3

Browse files
committed
minor updates to README
1 parent 385b96f commit 5d3dfe3

2 files changed

Lines changed: 26 additions & 14 deletions

File tree

README.MD

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,22 @@ ORG_KGRID_JAVASCRIPT_ACTIVATOR_MANIFEST_PATH=<path> ORG_KGRID_JAVASCRIPT_ACTIVAT
3535

3636
For examples of this command see [Using reference objects](#using-reference-objects) or [Using other legacy examples](#using-other-legacy-examples)
3737

38-
#### Test the loaded knowledge objects
39-
Use http://localhost:3001/kos to get the list of knowledge objects and their status.
38+
### Test the knowledge objects in the running app
39+
Use http://localhost:3000/kos to get the list of knowledge objects and their status.
4040

41-
#### Test the loaded endpoints of knowledge objects
42-
Use http://localhost:3001/endpoints to get the endpoints and their status. Each endpoint is accessible via an http POST request (e.g. using postman) to http://localhost:3001/endpoints/{ko id}/{endpoint id} with a Json body.
41+
Use http://localhost:3000/endpoints to get the list of endpoints. Each endpoint is accessible via an http POST request (e.g. using postman) to http://localhost:3000/endpoints/{ko id}/{endpoint id} with a Json body.
4342

4443
For activated KOs that have a service specification, the JavaScript activator provides access to swagger and OpenAPI editor for each activated KO at {server address}/kos/{KO id}/doc.
4544

46-
As an example, once the BMI Calculator KO (in folder bmi-calc-ko with id BMICalculator) from the reference objects is activated, a post request could be sent to `POST http://localhost:3001/endpoints/BMICalculator/bmi` with the following body to use the bmi endpoint
45+
As an example, once the BMI Calculator KO (in folder bmi-calc-ko with id BMICalculator) from the reference objects is activated, a post request could be sent to `POST http://localhost:3000/endpoints/BMICalculator/bmi` with the following body to use the bmi endpoint
4746
```json
4847
{
4948
"height": 175,
5049
"weight": 70,
5150
"unit_system": "metric"
5251
}
5352
```
54-
55-
swagger editor link "documentation": "http://localhost:3001/kos/BMICalculator/doc" which is provided at http://localhost:3001/kos could also be used to test this KO's endpoint.
53+
or swagger editor could be accessed at http://localhost:3000/kos/BMICalculator/doc for this KO to test its endpoint.
5654
## Development
5755

5856
### Setting up the project
@@ -77,9 +75,11 @@ deno fmt
7775
deno lint
7876
deno test
7977
```
80-
78+
- 'deno fmt' automatically formats and styles the code according to a predefined set of rules.
79+
- 'deno lint' analyzes the code for potential errors, coding style violations, and other issues based on a specified set of linting rules.
80+
- 'deno test' runs unit tests to ensure the correctness of the code
8181
### Using reference objects
82-
This activator supports [kgrid 2.0 Knowledge objects](). This collection has knowledge objects that have API services implemented for JavaScript activator. A [Local Manifest file](https://github.com/kgrid/reference-objects/blob/main/local_manifest.json) is provided in this repository to help loading these KOs from a cloned location. Clone this repository using
82+
This activator supports [kgrid 2.0 Knowledge objects](https://github.com/kgrid/koio/blob/master/kgrid_knowledge_objects.md). [Reference Knowledge Objects Collection](https://github.com/kgrid/reference-objects) has knowledge objects that have API services implemented for JavaScript activator. A [Local Manifest file](https://github.com/kgrid/reference-objects/blob/main/local_manifest.json) is provided in this repository to help loading these KOs from a cloned location. Clone this repository using
8383

8484
```bash
8585
git clone https://github.com/kgrid/reference-objects.git
@@ -90,15 +90,15 @@ Then run the JavaScript activator and give the path to the cloned repository as
9090
ORG_KGRID_JAVASCRIPT_ACTIVATOR_COLLECTION_PATH=/home/code/reference-objects deno run --allow-net=github.com,objects.githubusercontent.com,kgrid.org,0.0.0.0 --allow-env --allow-read --allow-write=shelf/ --allow-run=unzip --allow-sys=osRelease --unstable api.ts --port=3000
9191
```
9292
### Using other legacy examples
93-
The new activator does not support legacy knowledge objects. But examples of kgrid 1.0 knowledge objects that are upgraded to be activated by this version of activator are included in ./tests/fixtures/installfiles/ in this repository. A manifest file is also located in this folder for testing.
93+
The new activator does not support legacy knowledge objects. But examples of kgrid 1.0 knowledge objects that are updated to be activated by this version of activator are included in ./tests/fixtures/installfiles/ in this repository. A manifest file is also located in this folder for testing.
9494

9595
Use the following command, from the root of this repository to deploy these knowledge objects to the JavaScript activator:
9696
```bash
97-
ORG_KGRID_JAVASCRIPT_ACTIVATOR_MANIFEST_PATH=./fixtures/installfiles/manifest.json deno run --allow-net=github.com,objects.githubusercontent.com,kgrid.org,0.0.0.0 --allow-env --allow-read --allow-write=shelf/ --allow-run=unzip --allow-sys=osRelease --unstable api.ts --port=3001
97+
ORG_KGRID_JAVASCRIPT_ACTIVATOR_MANIFEST_PATH=./fixtures/installfiles/manifest.json deno run --allow-net=github.com,objects.githubusercontent.com,kgrid.org,0.0.0.0 --allow-env --allow-read --allow-write=shelf/ --allow-run=unzip --allow-sys=osRelease --unstable api.ts --port=3000
9898
```
9999

100100
## Knowledge Object Development
101-
The JavaScript activator supports [kgrdi 2.0 knowledge objects](https://github.com/kgrid/koio/blob/master/kgrid_knowledge_objects.md). kgrid 1.0 knowledge objects, however require some minor update to work with JavaScript activator:
101+
The JavaScript activator supports [kgrdi 2.0 knowledge objects](https://github.com/kgrid/koio/blob/master/kgrid_knowledge_objects.md). kgrid 1.0 knowledge objects, however require some minor updates to work with JavaScript activator:
102102
1. The deployment files need to be restructured using the following example:
103103
```
104104
/{route name}:
@@ -138,7 +138,7 @@ JavaScript activator uses ORG_KGRID_JAVASCRIPT_ACTIVATOR_MANIFEST_PATH as the en
138138
139139
When using manifest file, this activator only accepts zipped knowledge objects. The local or remote (URL) paths to zip files should be listed on the input manifest. Relative local paths of zip files on the manifest file will be resolved towards the location of the manifest file.
140140
141-
The JavaScript activator creates an unzipped local copy of KOs and a local manifest file in the cache folder when it activates knowledge objects from a manifest. (See [local manifest file created for reference objects]() as an example of local manifest). To unzip remote zip files, this activator downloads them in the cache folder first.
141+
The JavaScript activator creates an unzipped local copy of KOs and a local manifest file in the cache folder when it activates knowledge objects from a manifest. (See [local manifest file created for reference objects](https://github.com/kgrid/reference-objects/blob/main/local_manifest.json) as an example of local manifest). To unzip remote zip files, this activator downloads them in the cache folder first.
142142
143143
If no manifest path is provided, JAVASCRIPT activator can activate knowledge objects from a local cache that contains unzipped knowledge objects and the local manifest.
144144
@@ -157,4 +157,12 @@ The JavaScript activator provides access to service specification file at {serve
157157
158158
If a KO has more than one service, this version of JavaScript activator will only activate the last service.
159159
160-
If a service has more than one endpoint with the same name, the JavaScript activator will keep and route to the last one.
160+
If a service has more than one endpoint with the same name, the JavaScript activator will keep and route to the last one.
161+
162+
## Related links
163+
- Ontology [validation service](http://iot.ee.surrey.ac.uk/SSNValidation/)
164+
- [Kgrid Website](https://kgrid.org/)
165+
- [Python Activator](https://github.com/kgrid/python-activator)
166+
- [kgrid Reference Objects](https://github.com/kgrid/reference-objects)
167+
- [Kgrid Knowledge Objects](https://github.com/kgrid/koio/blob/master/kgrid_knowledge_objects.md)
168+
- [Knowledge Object Implementation Ontology (KOIO)](https://github.com/kgrid/koio)

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "javascript-activator",
3+
"version": "0.1.0"
4+
}

0 commit comments

Comments
 (0)