@rdfc/js-runner 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/bin/bundle.mjs +32933 -0
- package/dist/args.d.ts +4 -0
- package/dist/args.js +47 -0
- package/dist/connectors/file.d.ts +15 -0
- package/dist/connectors/file.js +89 -0
- package/dist/connectors/http.d.ts +14 -0
- package/dist/connectors/http.js +81 -0
- package/dist/connectors/kafka.d.ts +48 -0
- package/dist/connectors/kafka.js +66 -0
- package/dist/connectors/ws.d.ts +10 -0
- package/dist/connectors/ws.js +69 -0
- package/dist/connectors.d.ts +52 -0
- package/dist/connectors.js +136 -0
- package/dist/index.cjs +655 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +73 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/util.d.ts +43 -0
- package/dist/util.js +75 -0
- package/package.json +24 -23
package/README.md
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
# Js-runner
|
|
2
2
|
|
|
3
|
-
[](https://github.com/rdf-connect/js-runner/actions/workflows/build-test.yml) [](https://npmjs.com/package/@rdfc/js-runner)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Typescript/Javascript executor for an [RDF-Connect](https://rdf-connect.github.io/rdfc.github.io/) pipeline. Starting from a declarative RDF file describing the pipeline.
|
|
6
6
|
|
|
7
7
|
## Process definition
|
|
8
8
|
|
|
9
|
-
Each js process must have `js:file`, `js:function` and `js:mapping` objects.
|
|
9
|
+
Each js process must have `js:file`, `js:function` and `js:mapping` objects.
|
|
10
10
|
|
|
11
11
|
- `js:file` points to the location of the main javascript file, containing the function.
|
|
12
12
|
- `js:location` points to the starting location for `js:file` relative from the current file.
|
|
13
13
|
- `js:function` points to the function name in the file.
|
|
14
14
|
- `js:mapping` is a `fno:Mapping` object that links properties to function arguments.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
When you declare a new js process, it is required to add a shacl shape.
|
|
16
|
+
When you declare a new js process, it is required to add a SHACL shape.
|
|
18
17
|
Each `sh:property` is accounted for, noting the type `sh:class` or `sh:datatype`.
|
|
19
18
|
|
|
20
19
|
Example definitions are available in `processor/configs/*.ttl`.
|
|
21
20
|
|
|
22
|
-
|
|
23
21
|
## Pipeline configuration
|
|
24
22
|
|
|
25
|
-
In a js pipeline you can use all declared js processes, as defined in their
|
|
23
|
+
In a js pipeline you can use all declared js processes, as defined in their SHACL shapes.
|
|
26
24
|
|
|
27
25
|
An example can be found in `input.ttl`, here a `js:Send` process and a `js:Resc` process are defined.
|
|
28
26
|
`js:Send` takes in a message to send, and a channel to send it to.
|
|
@@ -30,13 +28,13 @@ An example can be found in `input.ttl`, here a `js:Send` process and a `js:Resc`
|
|
|
30
28
|
|
|
31
29
|
(implementation can be found in `procossor/test.js`)
|
|
32
30
|
|
|
33
|
-
Note: currently
|
|
31
|
+
Note: currently Websockets are configured, but changing the configuration to use the JsReaderChannel and JsWriterChannel will work too, even without a serialization step.
|
|
34
32
|
|
|
35
33
|
You can execute this pipeline with
|
|
34
|
+
|
|
36
35
|
```bash
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
tsc
|
|
37
|
+
bun bin/js-runner.js input.ttl
|
|
39
38
|
```
|
|
40
39
|
|
|
41
|
-
This example input configuration file uses `owl:imports` to specify additional configuration files.
|
|
42
|
-
|
|
40
|
+
This example input configuration file uses `owl:imports` to specify additional configuration files.
|