@rdfc/js-runner 1.0.0 → 2.0.0-alpha.10

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.
Files changed (89) hide show
  1. package/.husky/pre-commit +6 -0
  2. package/.idea/LNKD.tech Editor.xml +194 -0
  3. package/.idea/codeStyles/Project.xml +52 -0
  4. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  5. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  6. package/.idea/js-runner.iml +12 -0
  7. package/.idea/modules.xml +8 -0
  8. package/.idea/vcs.xml +6 -0
  9. package/.prettierrc +4 -0
  10. package/README.md +3 -38
  11. package/__tests__/channels.test.ts +96 -0
  12. package/bin/runner.js +8 -0
  13. package/dist/args.d.ts +3 -3
  14. package/dist/args.js +50 -51
  15. package/dist/connectors/file.d.ts +11 -11
  16. package/dist/connectors/file.js +79 -79
  17. package/dist/connectors/http.d.ts +10 -10
  18. package/dist/connectors/http.js +76 -76
  19. package/dist/connectors/kafka.d.ts +36 -36
  20. package/dist/connectors/kafka.js +66 -62
  21. package/dist/connectors/ws.d.ts +6 -6
  22. package/dist/connectors/ws.js +66 -63
  23. package/dist/connectors.d.ts +61 -42
  24. package/dist/connectors.js +155 -132
  25. package/dist/index.cjs +650 -595
  26. package/dist/index.d.ts +40 -31
  27. package/dist/index.js +72 -63
  28. package/dist/util.d.ts +63 -35
  29. package/dist/util.js +80 -63
  30. package/eslint.config.mjs +21 -0
  31. package/examples/echo/package-lock.json +80 -0
  32. package/examples/echo/package.json +18 -0
  33. package/examples/echo/pipeline.ttl +48 -0
  34. package/examples/echo/processors.ttl +82 -0
  35. package/examples/echo/src/processors.ts +74 -0
  36. package/examples/echo/tsconfig.json +114 -0
  37. package/index.ttl +71 -0
  38. package/jest.config.js +2 -0
  39. package/lib/client.d.ts +1 -0
  40. package/lib/client.js +43 -0
  41. package/lib/convertor.d.ts +9 -0
  42. package/lib/convertor.js +51 -0
  43. package/lib/index.d.ts +7 -0
  44. package/lib/index.js +8 -0
  45. package/lib/jsonld.d.ts +17 -0
  46. package/lib/jsonld.js +135 -0
  47. package/lib/logger.d.ts +17 -0
  48. package/lib/logger.js +49 -0
  49. package/lib/processor.d.ts +19 -0
  50. package/lib/processor.js +13 -0
  51. package/lib/reader.d.ts +30 -0
  52. package/lib/reader.js +101 -0
  53. package/lib/reexports.d.ts +3 -0
  54. package/lib/reexports.js +4 -0
  55. package/lib/runner.d.ts +26 -0
  56. package/lib/runner.js +121 -0
  57. package/lib/testUtils.d.ts +24 -0
  58. package/lib/testUtils.js +150 -0
  59. package/lib/tsconfig.tsbuildinfo +1 -0
  60. package/lib/util_processors.d.ts +11 -0
  61. package/lib/util_processors.js +13 -0
  62. package/lib/writer.d.ts +26 -0
  63. package/lib/writer.js +57 -0
  64. package/package.json +49 -51
  65. package/src/client.ts +52 -0
  66. package/src/convertor.ts +59 -0
  67. package/src/index.ts +8 -0
  68. package/src/jsonld.ts +220 -0
  69. package/src/logger.ts +64 -0
  70. package/src/processor.ts +39 -0
  71. package/src/reader.ts +142 -0
  72. package/src/reexports.ts +6 -0
  73. package/src/runner.ts +197 -0
  74. package/src/testUtils.ts +196 -0
  75. package/src/util_processors.ts +20 -0
  76. package/src/writer.ts +90 -0
  77. package/tsconfig.json +33 -0
  78. package/vite.config.ts +10 -0
  79. package/LICENSE +0 -21
  80. package/bin/js-runner.js +0 -4
  81. package/channels/file.ttl +0 -37
  82. package/channels/http.ttl +0 -59
  83. package/channels/kafka.ttl +0 -98
  84. package/channels/ws.ttl +0 -33
  85. package/ontology.ttl +0 -169
  86. package/processor/echo.ttl +0 -38
  87. package/processor/resc.ttl +0 -34
  88. package/processor/send.ttl +0 -40
  89. package/processor/test.js +0 -35
package/dist/index.d.ts CHANGED
@@ -1,33 +1,42 @@
1
- import { Quad, Term } from "@rdfjs/types";
2
- import { Shapes } from "rdf-lens";
3
- export * from "./connectors.js";
1
+ import { Quad, Term } from '@rdfjs/types'
2
+ import { Shapes } from 'rdf-lens'
3
+ export * from './connectors.js'
4
4
  type Processor = {
5
- ty: Term;
6
- file: string;
7
- location: string;
8
- func: string;
9
- mapping: {
10
- parameters: {
11
- parameter: string;
12
- position: number;
13
- }[];
14
- };
15
- };
16
- export type Source = {
17
- type: "remote";
18
- location: string;
19
- } | {
20
- type: "memory";
21
- value: string;
22
- baseIRI: string;
23
- };
5
+ ty: Term
6
+ file: string
7
+ location: string
8
+ func: string
9
+ mapping: {
10
+ parameters: {
11
+ parameter: string
12
+ position: number
13
+ }[]
14
+ }
15
+ }
16
+ export type Source =
17
+ | {
18
+ type: 'remote'
19
+ location: string
20
+ }
21
+ | {
22
+ type: 'memory'
23
+ value: string
24
+ baseIRI: string
25
+ }
24
26
  export type Extracted = {
25
- processors: Processor[];
26
- quads: Quad[];
27
- shapes: Shapes;
28
- };
29
- export declare function extractProcessors(source: Source, apply?: {
30
- [label: string]: (item: any) => any;
31
- }): Promise<Extracted>;
32
- export declare function extractSteps(proc: Processor, quads: Quad[], config: Shapes): any[][];
33
- export declare function jsRunner(): Promise<void>;
27
+ processors: Processor[]
28
+ quads: Quad[]
29
+ shapes: Shapes
30
+ }
31
+ export declare function extractProcessors(
32
+ source: Source,
33
+ apply?: {
34
+ [label: string]: (item: any) => any
35
+ },
36
+ ): Promise<Extracted>
37
+ export declare function extractSteps(
38
+ proc: Processor,
39
+ quads: Quad[],
40
+ config: Shapes,
41
+ ): any[][]
42
+ export declare function jsRunner(): Promise<void>
package/dist/index.js CHANGED
@@ -1,74 +1,83 @@
1
- import { Store } from "n3";
2
- import { getArgs } from "./args.js";
3
- import { load_store, LOG } from "./util.js";
4
- import path from "path";
5
- import { RDF } from "@treecg/types";
6
- import { ChannelFactory, Conn, JsOntology } from "./connectors.js";
7
- import { envReplace, extractShapes } from "rdf-lens";
8
- export * from "./connectors.js";
1
+ import { Store } from 'n3'
2
+ import { getArgs } from './args.js'
3
+ import { load_store, LOG } from './util.js'
4
+ import path from 'path'
5
+ import { RDF } from '@treecg/types'
6
+ import { ChannelFactory, Conn, JsOntology } from './connectors.js'
7
+ import { envReplace, extractShapes } from 'rdf-lens'
8
+ export * from './connectors.js'
9
9
  function safeJoin(a, b) {
10
- if (b.startsWith("/")) {
11
- return b;
12
- }
13
- return path.join(a, b);
10
+ if (b.startsWith('/')) {
11
+ return b
12
+ }
13
+ return path.join(a, b)
14
14
  }
15
15
  export async function extractProcessors(source, apply) {
16
- const store = new Store();
17
- await load_store(source, store);
18
- const quads = store.getQuads(null, null, null, null);
19
- const config = extractShapes(quads, apply);
20
- const subjects = quads
21
- .filter((x) => x.predicate.equals(RDF.terms.type) &&
22
- x.object.equals(JsOntology.JsProcess))
23
- .map((x) => x.subject);
24
- const processorLens = config.lenses[JsOntology.JsProcess.value];
25
- const processors = subjects.map((id) => processorLens.execute({ id, quads }));
26
- const newQuads = envReplace().execute(quads);
27
- return { processors, quads: newQuads, shapes: config };
16
+ const store = new Store()
17
+ await load_store(source, store)
18
+ const quads = store.getQuads(null, null, null, null)
19
+ const config = extractShapes(quads, apply)
20
+ const subjects = quads
21
+ .filter(
22
+ (x) =>
23
+ x.predicate.equals(RDF.terms.type) &&
24
+ x.object.equals(JsOntology.JsProcess),
25
+ )
26
+ .map((x) => x.subject)
27
+ const processorLens = config.lenses[JsOntology.JsProcess.value]
28
+ const processors = subjects.map((id) => processorLens.execute({ id, quads }))
29
+ const newQuads = envReplace().execute(quads)
30
+ return { processors, quads: newQuads, shapes: config }
28
31
  }
29
32
  export function extractSteps(proc, quads, config) {
30
- const out = [];
31
- const subjects = quads
32
- .filter((x) => x.predicate.equals(RDF.terms.type) && x.object.equals(proc.ty))
33
- .map((x) => x.subject);
34
- const processorLens = config.lenses[proc.ty.value];
35
- const fields = proc.mapping.parameters;
36
- for (const id of subjects) {
37
- const obj = processorLens.execute({ id, quads });
38
- const functionArgs = new Array(fields.length);
39
- for (const field of fields) {
40
- functionArgs[field.position] = obj[field.parameter];
41
- }
42
- out.push(functionArgs);
33
+ const out = []
34
+ const subjects = quads
35
+ .filter(
36
+ (x) => x.predicate.equals(RDF.terms.type) && x.object.equals(proc.ty),
37
+ )
38
+ .map((x) => x.subject)
39
+ const processorLens = config.lenses[proc.ty.value]
40
+ const fields = proc.mapping.parameters
41
+ for (const id of subjects) {
42
+ const obj = processorLens.execute({ id, quads })
43
+ const functionArgs = new Array(fields.length)
44
+ for (const field of fields) {
45
+ functionArgs[field.position] = obj[field.parameter]
43
46
  }
44
- return out;
47
+ out.push(functionArgs)
48
+ }
49
+ return out
45
50
  }
46
51
  export async function jsRunner() {
47
- const args = getArgs();
48
- const cwd = process.cwd();
49
- const source = {
50
- location: safeJoin(cwd, args.input).replaceAll("\\", "/"),
51
- type: "remote",
52
- };
53
- const factory = new ChannelFactory();
54
- const apply = {};
55
- apply[Conn.ReaderChannel.value] = factory.createReader.bind(factory);
56
- apply[Conn.WriterChannel.value] = factory.createWriter.bind(factory);
57
- const { processors, quads, shapes: config, } = await extractProcessors(source, apply);
58
- LOG.main("Found %d processors", processors.length);
59
- const starts = [];
60
- for (const proc of processors) {
61
- const argss = extractSteps(proc, quads, config);
62
- const jsProgram = await import("file://" + proc.file);
63
- process.chdir(proc.location);
64
- for (const args of argss) {
65
- starts.push(await jsProgram[proc.func](...args));
66
- }
52
+ const args = getArgs()
53
+ const cwd = process.cwd()
54
+ const source = {
55
+ location: safeJoin(cwd, args.input).replaceAll('\\', '/'),
56
+ type: 'remote',
57
+ }
58
+ const factory = new ChannelFactory()
59
+ const apply = {}
60
+ apply[Conn.ReaderChannel.value] = factory.createReader.bind(factory)
61
+ apply[Conn.WriterChannel.value] = factory.createWriter.bind(factory)
62
+ const {
63
+ processors,
64
+ quads,
65
+ shapes: config,
66
+ } = await extractProcessors(source, apply)
67
+ LOG.main('Found %d processors', processors.length)
68
+ const starts = []
69
+ for (const proc of processors) {
70
+ const argss = extractSteps(proc, quads, config)
71
+ const jsProgram = await import('file://' + proc.file)
72
+ process.chdir(proc.location)
73
+ for (const args of argss) {
74
+ starts.push(await jsProgram[proc.func](...args))
67
75
  }
68
- await factory.init();
69
- for (const s of starts) {
70
- if (s && typeof s === "function") {
71
- s();
72
- }
76
+ }
77
+ await factory.init()
78
+ for (const s of starts) {
79
+ if (s && typeof s === 'function') {
80
+ s()
73
81
  }
82
+ }
74
83
  }
package/dist/util.d.ts CHANGED
@@ -1,43 +1,71 @@
1
- import stream from "stream";
2
- import { Store } from "n3";
3
- import { Source } from "./index.js";
4
- import { Quad, Term } from "@rdfjs/types";
5
- import debug from "debug";
1
+ import stream from 'stream'
2
+ import { Store } from 'n3'
3
+ import { Source } from './index.js'
4
+ import { Quad, Term } from '@rdfjs/types'
5
+ import debug from 'debug'
6
6
  export declare const LOG: {
7
- main: debug.Debugger;
8
- channel: debug.Debugger;
9
- util: debug.Debugger;
10
- };
11
- export declare function toArray<T>(stream: stream.Readable): Promise<T[]>;
7
+ main: debug.Debugger
8
+ channel: debug.Debugger
9
+ util: debug.Debugger
10
+ }
11
+ export declare function toArray<T>(stream: stream.Readable): Promise<T[]>
12
12
  export declare const OWL: {
13
- namespace: string;
14
- custom: (input: string) => string;
13
+ namespace: string
14
+ custom: (input: string) => string
15
15
  } & {
16
- imports: string;
16
+ imports: string
17
17
  } & {
18
- terms: import("@treecg/types").Namespace<"imports"[], import("@rdfjs/types").NamedNode<string>, string>;
19
- };
18
+ terms: import('@treecg/types').Namespace<
19
+ 'imports'[],
20
+ import('@rdfjs/types').NamedNode<string>,
21
+ string
22
+ >
23
+ }
20
24
  export declare const CONN2: {
21
- namespace: string;
22
- custom: (input: string) => string;
25
+ namespace: string
26
+ custom: (input: string) => string
23
27
  } & {
24
- install: string;
25
- build: string;
26
- GitInstall: string;
27
- LocalInstall: string;
28
- url: string;
29
- procFile: string;
30
- path: string;
31
- EnvVariable: string;
32
- envKey: string;
33
- envDefault: string;
28
+ install: string
29
+ build: string
30
+ GitInstall: string
31
+ LocalInstall: string
32
+ url: string
33
+ procFile: string
34
+ path: string
35
+ EnvVariable: string
36
+ envKey: string
37
+ envDefault: string
34
38
  } & {
35
- terms: import("@treecg/types").Namespace<("install" | "build" | "GitInstall" | "LocalInstall" | "url" | "procFile" | "path" | "EnvVariable" | "envKey" | "envDefault")[], import("@rdfjs/types").NamedNode<string>, string>;
36
- };
37
- export declare const namedNode: <Iri extends string = string>(value: Iri) => import("n3").NamedNode<Iri>;
39
+ terms: import('@treecg/types').Namespace<
40
+ (
41
+ | 'install'
42
+ | 'build'
43
+ | 'GitInstall'
44
+ | 'LocalInstall'
45
+ | 'url'
46
+ | 'procFile'
47
+ | 'path'
48
+ | 'EnvVariable'
49
+ | 'envKey'
50
+ | 'envDefault'
51
+ )[],
52
+ import('@rdfjs/types').NamedNode<string>,
53
+ string
54
+ >
55
+ }
56
+ export declare const namedNode: <Iri extends string = string>(
57
+ value: Iri,
58
+ ) => import('n3').NamedNode<Iri>
38
59
  export type Keyed<T> = {
39
- [Key in keyof T]: Term | undefined;
40
- };
41
- export type Map<V, K, T, O> = (value: V, key: K, item: T) => O;
42
- export declare function load_quads(location: string, baseIRI?: string): Promise<Quad[]>;
43
- export declare function load_store(location: Source, store: Store, recursive?: boolean): Promise<void>;
60
+ [Key in keyof T]: Term | undefined
61
+ }
62
+ export type Map<V, K, T, O> = (value: V, key: K, item: T) => O
63
+ export declare function load_quads(
64
+ location: string,
65
+ baseIRI?: string,
66
+ ): Promise<Quad[]>
67
+ export declare function load_store(
68
+ location: Source,
69
+ store: Store,
70
+ recursive?: boolean,
71
+ ): Promise<void>
package/dist/util.js CHANGED
@@ -1,75 +1,92 @@
1
- import { createReadStream } from "fs";
2
- import http from "http";
3
- import https from "https";
4
- import { DataFactory, Parser, StreamParser } from "n3";
5
- import { createUriAndTermNamespace } from "@treecg/types";
6
- import debug from "debug";
1
+ import { createReadStream } from 'fs'
2
+ import http from 'http'
3
+ import https from 'https'
4
+ import { DataFactory, Parser, StreamParser } from 'n3'
5
+ import { createUriAndTermNamespace } from '@treecg/types'
6
+ import debug from 'debug'
7
7
  export const LOG = (function () {
8
- const main = debug("js-runner");
9
- const channel = main.extend("channel");
10
- const util = main.extend("util");
11
- return { main, channel, util };
12
- })();
8
+ const main = debug('js-runner')
9
+ const channel = main.extend('channel')
10
+ const util = main.extend('util')
11
+ return { main, channel, util }
12
+ })()
13
13
  export function toArray(stream) {
14
- const output = [];
15
- return new Promise((res, rej) => {
16
- stream.on("data", (x) => output.push(x));
17
- stream.on("end", () => res(output));
18
- stream.on("close", () => res(output));
19
- stream.on("error", rej);
20
- });
14
+ const output = []
15
+ return new Promise((res, rej) => {
16
+ stream.on('data', (x) => output.push(x))
17
+ stream.on('end', () => res(output))
18
+ stream.on('close', () => res(output))
19
+ stream.on('error', rej)
20
+ })
21
21
  }
22
- export const OWL = createUriAndTermNamespace("http://www.w3.org/2002/07/owl#", "imports");
23
- export const CONN2 = createUriAndTermNamespace("https://w3id.org/conn#", "install", "build", "GitInstall", "LocalInstall", "url", "procFile", "path", "EnvVariable", "envKey", "envDefault");
24
- export const { namedNode } = DataFactory;
22
+ export const OWL = createUriAndTermNamespace(
23
+ 'http://www.w3.org/2002/07/owl#',
24
+ 'imports',
25
+ )
26
+ export const CONN2 = createUriAndTermNamespace(
27
+ 'https://w3id.org/conn#',
28
+ 'install',
29
+ 'build',
30
+ 'GitInstall',
31
+ 'LocalInstall',
32
+ 'url',
33
+ 'procFile',
34
+ 'path',
35
+ 'EnvVariable',
36
+ 'envKey',
37
+ 'envDefault',
38
+ )
39
+ export const { namedNode } = DataFactory
25
40
  async function get_readstream(location) {
26
- if (location.startsWith("https")) {
27
- return new Promise((res) => {
28
- https.get(location, res);
29
- });
30
- }
31
- else if (location.startsWith("http")) {
32
- return new Promise((res) => {
33
- http.get(location, res);
34
- });
35
- }
36
- else {
37
- return createReadStream(location);
38
- }
41
+ if (location.startsWith('https')) {
42
+ return new Promise((res) => {
43
+ https.get(location, res)
44
+ })
45
+ } else if (location.startsWith('http')) {
46
+ return new Promise((res) => {
47
+ http.get(location, res)
48
+ })
49
+ } else {
50
+ return createReadStream(location)
51
+ }
39
52
  }
40
53
  export async function load_quads(location, baseIRI) {
41
- try {
42
- LOG.util("Loading quads %s", location);
43
- const parser = new StreamParser({ baseIRI: baseIRI || location });
44
- const rdfStream = await get_readstream(location);
45
- rdfStream.pipe(parser);
46
- const quads = await toArray(parser);
47
- return quads;
48
- }
49
- catch (ex) {
50
- console.error("Failed to load_quads", location, baseIRI);
51
- console.error(ex);
52
- return [];
53
- }
54
+ try {
55
+ LOG.util('Loading quads %s', location)
56
+ const parser = new StreamParser({ baseIRI: baseIRI || location })
57
+ const rdfStream = await get_readstream(location)
58
+ rdfStream.pipe(parser)
59
+ const quads = await toArray(parser)
60
+ return quads
61
+ } catch (ex) {
62
+ console.error('Failed to load_quads', location, baseIRI)
63
+ console.error(ex)
64
+ return []
65
+ }
54
66
  }
55
67
  function load_memory_quads(value, baseIRI) {
56
- const parser = new Parser({ baseIRI });
57
- return parser.parse(value);
68
+ const parser = new Parser({ baseIRI })
69
+ return parser.parse(value)
58
70
  }
59
- const loaded = new Set();
71
+ const loaded = new Set()
60
72
  export async function load_store(location, store, recursive = true) {
61
- if (loaded.has(location))
62
- return;
63
- loaded.add(location);
64
- const quads = location.type === "remote"
65
- ? await load_quads(location.location)
66
- : load_memory_quads(location.value, location.baseIRI);
67
- store.addQuads(quads);
68
- if (recursive) {
69
- const loc = location.type === "remote" ? location.location : location.baseIRI;
70
- const other_imports = store.getObjects(namedNode(loc), OWL.terms.imports, null);
71
- for (const other of other_imports) {
72
- await load_store({ location: other.value, type: "remote" }, store, true);
73
- }
73
+ if (loaded.has(location)) return
74
+ loaded.add(location)
75
+ const quads =
76
+ location.type === 'remote'
77
+ ? await load_quads(location.location)
78
+ : load_memory_quads(location.value, location.baseIRI)
79
+ store.addQuads(quads)
80
+ if (recursive) {
81
+ const loc =
82
+ location.type === 'remote' ? location.location : location.baseIRI
83
+ const other_imports = store.getObjects(
84
+ namedNode(loc),
85
+ OWL.terms.imports,
86
+ null,
87
+ )
88
+ for (const other of other_imports) {
89
+ await load_store({ location: other.value, type: 'remote' }, store, true)
74
90
  }
91
+ }
75
92
  }
@@ -0,0 +1,21 @@
1
+ import globals from 'globals'
2
+ import pluginJs from '@eslint/js'
3
+ import tseslint from 'typescript-eslint'
4
+
5
+ /** @type {import('eslint').Linter.Config[]} */
6
+ export default [
7
+ {
8
+ files: ['src/**/*.{js,mjs,cjs,ts}'],
9
+ },
10
+ { languageOptions: { globals: globals.browser } },
11
+ pluginJs.configs.recommended,
12
+ ...tseslint.configs.recommended,
13
+ {
14
+ ignores: ['src/generated/', '**/lib/', 'coverage/'],
15
+ },
16
+ {
17
+ languageOptions: {
18
+ globals: { process: 'readable' },
19
+ },
20
+ },
21
+ ]
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "echo",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "echo",
9
+ "version": "1.0.0",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@rdfc/js-runner": "file:../.."
13
+ },
14
+ "devDependencies": {
15
+ "typescript": "^5.8.2"
16
+ }
17
+ },
18
+ "../..": {
19
+ "name": "@rdfc/js-runner",
20
+ "version": "1.0.0",
21
+ "license": "ISC",
22
+ "dependencies": {
23
+ "@grpc/grpc-js": "^1.12.6",
24
+ "@rdfc/proto": "^0.1.1",
25
+ "@treecg/types": "^0.4.6",
26
+ "jsonld": "^8.3.3",
27
+ "jsonld-streaming-parser": "^5.0.0",
28
+ "n3": "^1.23.1",
29
+ "rdf-lens": "^1.3.5",
30
+ "winston": "^3.17.0",
31
+ "winston-transport": "^4.9.0"
32
+ },
33
+ "bin": {
34
+ "js-runner": "bin/runner.js"
35
+ },
36
+ "devDependencies": {
37
+ "@eslint/js": "^9.21.0",
38
+ "@rdfjs/types": "^2.0.1",
39
+ "@types/jest": "^29.5.14",
40
+ "@types/jsonld": "^1.5.15",
41
+ "@types/n3": "^1.21.1",
42
+ "@types/node": "^22.13.5",
43
+ "@typescript-eslint/eslint-plugin": "^8.25.0",
44
+ "@typescript-eslint/parser": "^8.25.0",
45
+ "@vitest/coverage-v8": "^3.0.7",
46
+ "eslint": "^9.21.0",
47
+ "eslint-config-prettier": "^10.0.1",
48
+ "eslint-plugin-prettier": "^5.2.3",
49
+ "globals": "^16.0.0",
50
+ "husky": "^9.1.7",
51
+ "jest": "^29.7.0",
52
+ "lint-staged": "^15.4.3",
53
+ "prettier": "^3.5.2",
54
+ "ts-jest": "^29.2.6",
55
+ "tsc-alias": "^1.8.10",
56
+ "typescript": "^5.7.3",
57
+ "typescript-eslint": "^8.25.0",
58
+ "vitest": "^3.0.7"
59
+ }
60
+ },
61
+ "node_modules/@rdfc/js-runner": {
62
+ "resolved": "../..",
63
+ "link": true
64
+ },
65
+ "node_modules/typescript": {
66
+ "version": "5.8.2",
67
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
68
+ "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
69
+ "dev": true,
70
+ "license": "Apache-2.0",
71
+ "bin": {
72
+ "tsc": "bin/tsc",
73
+ "tsserver": "bin/tsserver"
74
+ },
75
+ "engines": {
76
+ "node": ">=14.17"
77
+ }
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "echo",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "build": "tsc"
7
+ },
8
+ "keywords": [],
9
+ "author": "",
10
+ "license": "ISC",
11
+ "description": "",
12
+ "dependencies": {
13
+ "@rdfc/js-runner": "file:../.."
14
+ },
15
+ "devDependencies": {
16
+ "typescript": "^5.8.2"
17
+ }
18
+ }
@@ -0,0 +1,48 @@
1
+ @prefix owl: <http://www.w3.org/2002/07/owl#>.
2
+ @prefix rdfc: <https://w3id.org/rdf-connect#>.
3
+
4
+ <> owl:imports <./processors.ttl>.
5
+ <> a rdfc:Pipeline;
6
+ rdfc:consistsOf [
7
+ rdfc:instantiates rdfc:NodeRunner;
8
+ rdfc:processor <sender>, <echo>, <log>;
9
+ ].
10
+
11
+ # <> a rdfc:Pipeline;
12
+ # rdfc:dependency <>;
13
+ # rdfc:processor <sender>, <echo>, <log>;
14
+ # rdfc:runner rdfc:JsRunner;
15
+ # rdfc:consistsOf [
16
+ # rdfc:instantiates rdfc:BunRunner;
17
+ # rdfc:processor <log>;
18
+ # ], [
19
+ # rdfc:instantiates rdfc:AnyRunner;
20
+ # rdfc:processor <echo>, <test>;
21
+ # rdfc:via [
22
+ # a rdfc:HttpEndpoint;
23
+ # rdfc:url "http://myRemote:5000/";
24
+ # ];
25
+ # ].
26
+ <1> a rdfc:Writer, rdfc:Reader.
27
+
28
+ <2> a rdfc:Writer, rdfc:Reader.
29
+ #
30
+ <sender> a rdfc:SendProcessor;
31
+ rdfc:writer <1>;
32
+ rdfc:msg "hallo", "world".
33
+
34
+ <echo> a rdfc:EchoProcessor;
35
+ rdfc:reader <1>;
36
+ rdfc:writer <2>.
37
+
38
+ <log> a rdfc:LogProcessor;
39
+ rdfc:reader <2>.
40
+
41
+ <test> a rdfc:Test;
42
+ rdfc:path ( <a> <b> );
43
+ rdfc:path "help";
44
+ rdfc:cbd [
45
+ a rdfc:Something;
46
+ rdfc:else [ a rdfc:SomethingElse ];
47
+ ].
48
+