@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.
- package/.husky/pre-commit +6 -0
- package/.idea/LNKD.tech Editor.xml +194 -0
- package/.idea/codeStyles/Project.xml +52 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/js-runner.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.prettierrc +4 -0
- package/README.md +3 -38
- package/__tests__/channels.test.ts +96 -0
- package/bin/runner.js +8 -0
- package/dist/args.d.ts +3 -3
- package/dist/args.js +50 -51
- package/dist/connectors/file.d.ts +11 -11
- package/dist/connectors/file.js +79 -79
- package/dist/connectors/http.d.ts +10 -10
- package/dist/connectors/http.js +76 -76
- package/dist/connectors/kafka.d.ts +36 -36
- package/dist/connectors/kafka.js +66 -62
- package/dist/connectors/ws.d.ts +6 -6
- package/dist/connectors/ws.js +66 -63
- package/dist/connectors.d.ts +61 -42
- package/dist/connectors.js +155 -132
- package/dist/index.cjs +650 -595
- package/dist/index.d.ts +40 -31
- package/dist/index.js +72 -63
- package/dist/util.d.ts +63 -35
- package/dist/util.js +80 -63
- package/eslint.config.mjs +21 -0
- package/examples/echo/package-lock.json +80 -0
- package/examples/echo/package.json +18 -0
- package/examples/echo/pipeline.ttl +48 -0
- package/examples/echo/processors.ttl +82 -0
- package/examples/echo/src/processors.ts +74 -0
- package/examples/echo/tsconfig.json +114 -0
- package/index.ttl +71 -0
- package/jest.config.js +2 -0
- package/lib/client.d.ts +1 -0
- package/lib/client.js +43 -0
- package/lib/convertor.d.ts +9 -0
- package/lib/convertor.js +51 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +8 -0
- package/lib/jsonld.d.ts +17 -0
- package/lib/jsonld.js +135 -0
- package/lib/logger.d.ts +17 -0
- package/lib/logger.js +49 -0
- package/lib/processor.d.ts +19 -0
- package/lib/processor.js +13 -0
- package/lib/reader.d.ts +30 -0
- package/lib/reader.js +101 -0
- package/lib/reexports.d.ts +3 -0
- package/lib/reexports.js +4 -0
- package/lib/runner.d.ts +26 -0
- package/lib/runner.js +121 -0
- package/lib/testUtils.d.ts +24 -0
- package/lib/testUtils.js +150 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/util_processors.d.ts +11 -0
- package/lib/util_processors.js +13 -0
- package/lib/writer.d.ts +26 -0
- package/lib/writer.js +57 -0
- package/package.json +49 -51
- package/src/client.ts +52 -0
- package/src/convertor.ts +59 -0
- package/src/index.ts +8 -0
- package/src/jsonld.ts +220 -0
- package/src/logger.ts +64 -0
- package/src/processor.ts +39 -0
- package/src/reader.ts +142 -0
- package/src/reexports.ts +6 -0
- package/src/runner.ts +197 -0
- package/src/testUtils.ts +196 -0
- package/src/util_processors.ts +20 -0
- package/src/writer.ts +90 -0
- package/tsconfig.json +33 -0
- package/vite.config.ts +10 -0
- package/LICENSE +0 -21
- package/bin/js-runner.js +0 -4
- package/channels/file.ttl +0 -37
- package/channels/http.ttl +0 -59
- package/channels/kafka.ttl +0 -98
- package/channels/ws.ttl +0 -33
- package/ontology.ttl +0 -169
- package/processor/echo.ttl +0 -38
- package/processor/resc.ttl +0 -34
- package/processor/send.ttl +0 -40
- package/processor/test.js +0 -35
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#>.
|
|
2
|
+
@prefix ex: <http://example.org/>.
|
|
3
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
|
|
4
|
+
@prefix rdfl: <https://w3id.org/rdf-lens/ontology#>.
|
|
5
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
|
|
6
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
|
7
|
+
@prefix sh: <http://www.w3.org/ns/shacl#>.
|
|
8
|
+
@prefix rdfc: <https://w3id.org/rdf-connect#>.
|
|
9
|
+
|
|
10
|
+
<> owl:imports <../../index.ttl>.
|
|
11
|
+
rdfc:Test rdfc:jsImplementationOf rdfc:Processor;
|
|
12
|
+
rdfc:entrypoint <./>;
|
|
13
|
+
rdfc:file <./lib/processors.js>;
|
|
14
|
+
rdfc:class "TestProcessor".
|
|
15
|
+
|
|
16
|
+
[ ] a sh:NodeShape;
|
|
17
|
+
sh:targetClass rdfc:Test;
|
|
18
|
+
sh:property [
|
|
19
|
+
sh:path rdfc:path;
|
|
20
|
+
sh:name "path";
|
|
21
|
+
sh:class rdfl:Path;
|
|
22
|
+
], [
|
|
23
|
+
sh:path rdfc:cbd;
|
|
24
|
+
sh:name "cbd";
|
|
25
|
+
sh:class rdfl:CBD;
|
|
26
|
+
].
|
|
27
|
+
|
|
28
|
+
rdfc:EchoProcessor rdfc:jsImplementationOf rdfc:Processor;
|
|
29
|
+
rdfc:entrypoint <./>;
|
|
30
|
+
rdfc:file <./lib/processors.js>;
|
|
31
|
+
rdfc:class "EchoProcessor".
|
|
32
|
+
|
|
33
|
+
[ ] a sh:NodeShape;
|
|
34
|
+
sh:targetClass rdfc:EchoProcessor;
|
|
35
|
+
sh:property [
|
|
36
|
+
sh:path rdfc:reader;
|
|
37
|
+
sh:name "reader";
|
|
38
|
+
sh:minCount 1;
|
|
39
|
+
sh:maxCount 1;
|
|
40
|
+
sh:class rdfc:Reader;
|
|
41
|
+
], [
|
|
42
|
+
sh:path rdfc:writer;
|
|
43
|
+
sh:name "writer";
|
|
44
|
+
sh:minCount 1;
|
|
45
|
+
sh:maxCount 1;
|
|
46
|
+
sh:class rdfc:Writer;
|
|
47
|
+
].
|
|
48
|
+
|
|
49
|
+
rdfc:LogProcessor rdfc:jsImplementationOf rdfc:Processor;
|
|
50
|
+
rdfc:entrypoint <./>;
|
|
51
|
+
rdfc:file <./lib/processors.js>;
|
|
52
|
+
rdfc:class "LogProcessor".
|
|
53
|
+
|
|
54
|
+
[ ] a sh:NodeShape;
|
|
55
|
+
sh:targetClass rdfc:LogProcessor;
|
|
56
|
+
sh:property [
|
|
57
|
+
sh:path rdfc:reader;
|
|
58
|
+
sh:name "reader";
|
|
59
|
+
sh:minCount 1;
|
|
60
|
+
sh:maxCount 1;
|
|
61
|
+
sh:class rdfc:Reader;
|
|
62
|
+
].
|
|
63
|
+
|
|
64
|
+
rdfc:SendProcessor rdfc:jsImplementationOf rdfc:Processor;
|
|
65
|
+
rdfc:entrypoint <./>;
|
|
66
|
+
rdfc:file <./lib/processors.js>;
|
|
67
|
+
rdfc:class "SendProcessor".
|
|
68
|
+
|
|
69
|
+
[ ] a sh:NodeShape;
|
|
70
|
+
sh:targetClass rdfc:SendProcessor;
|
|
71
|
+
sh:property [
|
|
72
|
+
sh:path rdfc:writer;
|
|
73
|
+
sh:name "writer";
|
|
74
|
+
sh:minCount 1;
|
|
75
|
+
sh:maxCount 1;
|
|
76
|
+
sh:class rdfc:Writer;
|
|
77
|
+
], [
|
|
78
|
+
sh:path rdfc:msg;
|
|
79
|
+
sh:name "msgs";
|
|
80
|
+
sh:datatype xsd:string;
|
|
81
|
+
].
|
|
82
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { FullProc, Processor, Reader, Writer } from '@rdfc/js-runner'
|
|
2
|
+
|
|
3
|
+
export class TestProcessor extends Processor<unknown> {
|
|
4
|
+
async init(this: this): Promise<void> {
|
|
5
|
+
this.logger.info(JSON.stringify(this.args, undefined, 2))
|
|
6
|
+
}
|
|
7
|
+
async transform(this: this): Promise<void> {}
|
|
8
|
+
async produce(this: this): Promise<void> {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type EchoArgs = {
|
|
12
|
+
reader: Reader
|
|
13
|
+
writer: Writer
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class EchoProcessor extends Processor<EchoArgs> {
|
|
17
|
+
async init(this: this & EchoArgs): Promise<void> {
|
|
18
|
+
this.logger.info('Init echo processor')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async transform(this: EchoArgs & this): Promise<void> {
|
|
22
|
+
for await (const msg of this.reader.streams()) {
|
|
23
|
+
this.logger.info('Echoing message')
|
|
24
|
+
await this.writer.stream(msg)
|
|
25
|
+
}
|
|
26
|
+
await this.writer.close()
|
|
27
|
+
this.logger.info('closed')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async produce(this: this & EchoArgs): Promise<void> {
|
|
31
|
+
// nothing
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type LogArgs = {
|
|
36
|
+
reader: Reader
|
|
37
|
+
writer: Writer
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class LogProcessor extends Processor<LogArgs> {
|
|
41
|
+
async produce(this: LogArgs & LogProcessor): Promise<void> {}
|
|
42
|
+
async init(): Promise<void> {
|
|
43
|
+
this.logger.info('Init log processor')
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async transform(this: FullProc<this>): Promise<void> {
|
|
47
|
+
for await (const msg of this.args.reader.strings()) {
|
|
48
|
+
this.logger.info('Got msg' + msg)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type SendArgs = {
|
|
54
|
+
msgs: string[]
|
|
55
|
+
writer: Writer
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class SendProcessor extends Processor<SendArgs> {
|
|
59
|
+
async init(): Promise<void> {
|
|
60
|
+
this.logger.info('Init send processor')
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async transform(): Promise<void> {}
|
|
64
|
+
async produce(): Promise<void> {
|
|
65
|
+
for (const msg of this.get('msgs')) {
|
|
66
|
+
await this.get('writer').string(msg)
|
|
67
|
+
|
|
68
|
+
this.logger.info('Sending ' + msg)
|
|
69
|
+
await new Promise((res) => setTimeout(res, 1000))
|
|
70
|
+
}
|
|
71
|
+
await this.get('writer').close()
|
|
72
|
+
this.logger.info('Closed')
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
|
+
|
|
27
|
+
/* Modules */
|
|
28
|
+
"module": "commonjs" /* Specify what module code is generated. */,
|
|
29
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
+
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
31
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
32
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
34
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
35
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
36
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
37
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
38
|
+
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
39
|
+
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
|
|
40
|
+
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
41
|
+
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
42
|
+
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
43
|
+
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
|
44
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
45
|
+
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
46
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
47
|
+
|
|
48
|
+
/* JavaScript Support */
|
|
49
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
50
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
51
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
52
|
+
|
|
53
|
+
/* Emit */
|
|
54
|
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
55
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
56
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
57
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
58
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
59
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
60
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
61
|
+
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
62
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
63
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
64
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
65
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
66
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
67
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
68
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
69
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
70
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
71
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
72
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
73
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
74
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
75
|
+
|
|
76
|
+
/* Interop Constraints */
|
|
77
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
78
|
+
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
79
|
+
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
|
80
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
81
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
82
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
83
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
84
|
+
|
|
85
|
+
/* Type Checking */
|
|
86
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
87
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
88
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
89
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
90
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
91
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
92
|
+
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
|
|
93
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
94
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
95
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
96
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
97
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
98
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
99
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
100
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
101
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
102
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
103
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
104
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
105
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
106
|
+
|
|
107
|
+
/* Completeness */
|
|
108
|
+
|
|
109
|
+
"outDir": "lib/",
|
|
110
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
111
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
112
|
+
},
|
|
113
|
+
"include": ["src/**/*"]
|
|
114
|
+
}
|
package/index.ttl
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@prefix prov: <http://www.w3.org/ns/prov#>.
|
|
2
|
+
@prefix sds: <https://w3id.org/sds#>.
|
|
3
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
|
|
4
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#>.
|
|
5
|
+
@prefix rdfl: <https://w3id.org/rdf-lens/ontology#>.
|
|
6
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
|
|
7
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
|
8
|
+
@prefix sh: <http://www.w3.org/ns/shacl#>.
|
|
9
|
+
@prefix rdfc: <https://w3id.org/rdf-connect#>.
|
|
10
|
+
|
|
11
|
+
# rdfc:LogProcessor a rdfc:JsProcessor;
|
|
12
|
+
# rdfs:label "Simple Log Processor";
|
|
13
|
+
# rdfs:comment "Logs incoming messages";
|
|
14
|
+
# rdfc:entrypoint <./>;
|
|
15
|
+
# rdfc:file <./lib/util_processors.js>;
|
|
16
|
+
# rdfc:class "LogProcessor".
|
|
17
|
+
# [ ] a sh:NodeShape; sh:targetClass rdfc:LogProcessor;
|
|
18
|
+
# sh:property [
|
|
19
|
+
# sh:path rdfc:reader;
|
|
20
|
+
# sh:name "reader";
|
|
21
|
+
# sh:minCount 1;
|
|
22
|
+
# sh:maxCount 1;
|
|
23
|
+
# sh:class rdfc:Reader;
|
|
24
|
+
# ].
|
|
25
|
+
# rdfc:JsRunner a rdfc:CommandRunner;
|
|
26
|
+
# rdfc:command "npx js-runner";
|
|
27
|
+
# rdfc:processor_definition <JsProcessorShape>.
|
|
28
|
+
#
|
|
29
|
+
rdfc:JsRunner a rdfc:CommandRunner;
|
|
30
|
+
rdfc:handles rdfc:JsProcessor;
|
|
31
|
+
rdfc:command "node node_modules/@rdfc/js-runner/bin/runner.js";
|
|
32
|
+
rdfc:processor_definition <JsProcessorShape>.
|
|
33
|
+
|
|
34
|
+
rdfc:NodeRunner a rdfc:Runner;
|
|
35
|
+
rdfc:handlesSubjectsOf rdfc:jsImplementationOf;
|
|
36
|
+
rdfc:command "npx js-runner";
|
|
37
|
+
rdfc:processor_definition <JsProcessorShape>.
|
|
38
|
+
|
|
39
|
+
# rdfc:NodeRunner a rdfc:JsRunner;
|
|
40
|
+
# rdfc:command "npx js-runner";
|
|
41
|
+
# rdfc:processor_definition <JsProcessorShape>.
|
|
42
|
+
rdfc:BunRunner a rdfc:CommandRunner;
|
|
43
|
+
rdfc:handlesSubjectsOf rdfc:jsImplementationOf;
|
|
44
|
+
rdfc:command "bunx js-runner";
|
|
45
|
+
rdfc:processor_definition <JsProcessorShape>.
|
|
46
|
+
|
|
47
|
+
sds:Activity rdfs:subClassOf prov:Activity.
|
|
48
|
+
rdfc:Processor rdfs:subClassOf sds:Activity.
|
|
49
|
+
sds:implementationOf rdfs:subPropertyOf rdfs:subClassOf.
|
|
50
|
+
rdfc:jsImplementationOf rdfs:subPropertyOf sds:implementationOf.
|
|
51
|
+
[ ] a sh:NodeShape;
|
|
52
|
+
sh:targetSubjectsOf rdfc:jsImplementationOf;
|
|
53
|
+
sh:property [
|
|
54
|
+
sh:path rdfc:entrypoint;
|
|
55
|
+
sh:name "location";
|
|
56
|
+
sh:minCount 1;
|
|
57
|
+
sh:maxCount 1;
|
|
58
|
+
sh:datatype xsd:string;
|
|
59
|
+
], [
|
|
60
|
+
sh:path rdfc:file;
|
|
61
|
+
sh:name "file";
|
|
62
|
+
sh:minCount 1;
|
|
63
|
+
sh:maxCount 1;
|
|
64
|
+
sh:datatype xsd:string;
|
|
65
|
+
], [
|
|
66
|
+
sh:path rdfc:class;
|
|
67
|
+
sh:name "clazz";
|
|
68
|
+
sh:maxCount 1;
|
|
69
|
+
sh:datatype xsd:string;
|
|
70
|
+
].
|
|
71
|
+
|
package/jest.config.js
ADDED
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function start(addr: string, uri: string): Promise<void>;
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as grpc from '@grpc/grpc-js';
|
|
2
|
+
import { promisify } from 'util';
|
|
3
|
+
import { RunnerClient } from '@rdfc/proto';
|
|
4
|
+
import winston from 'winston';
|
|
5
|
+
import { RpcTransport } from './logger.js';
|
|
6
|
+
import { Runner } from './runner.js';
|
|
7
|
+
export async function start(addr, uri) {
|
|
8
|
+
const client = new RunnerClient(addr, grpc.credentials.createInsecure());
|
|
9
|
+
const logger = winston.createLogger({
|
|
10
|
+
transports: [
|
|
11
|
+
new RpcTransport({
|
|
12
|
+
entities: [uri, 'cli'],
|
|
13
|
+
stream: client.logStream(() => { }),
|
|
14
|
+
}),
|
|
15
|
+
],
|
|
16
|
+
});
|
|
17
|
+
const stream = client.connect();
|
|
18
|
+
logger.info('Connected with server ' + addr);
|
|
19
|
+
const writable = promisify(stream.write.bind(stream));
|
|
20
|
+
const runner = new Runner(client, writable, uri, logger);
|
|
21
|
+
await writable({ identify: { uri } });
|
|
22
|
+
let processorsEnd;
|
|
23
|
+
const processorsEnded = new Promise((res) => (processorsEnd = res));
|
|
24
|
+
(async () => {
|
|
25
|
+
for await (const chunk of stream) {
|
|
26
|
+
const msg = chunk;
|
|
27
|
+
if (msg.proc) {
|
|
28
|
+
await runner.addProcessor(msg.proc);
|
|
29
|
+
}
|
|
30
|
+
if (msg.start) {
|
|
31
|
+
runner.start().then(processorsEnd);
|
|
32
|
+
}
|
|
33
|
+
await runner.handleOrchMessage(msg);
|
|
34
|
+
}
|
|
35
|
+
logger.error('Stream ended');
|
|
36
|
+
})();
|
|
37
|
+
await processorsEnded;
|
|
38
|
+
logger.info('All processors are finished');
|
|
39
|
+
stream.end();
|
|
40
|
+
client.close();
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NsaWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssSUFBSSxNQUFNLGVBQWUsQ0FBQTtBQUNyQyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sTUFBTSxDQUFBO0FBQ2hDLE9B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WZ5OiB7IHVyaSB9IH0pXG5cbiAgbGV0IHByb2Nlc3NvcnNFbmQhOiAodjogdW5rbm93bikgPT4gdW5rbm93blxuICBjb25zdCBwcm9jZXNzb3JzRW5kZWQgPSBuZXcgUHJvbWlzZSgocmVzKSA9PiAocHJvY2Vzc29yc0VuZCA9IHJlcykpXG4gIDsoYXN5bmMgKCkgPT4ge1xuICAgIGZvciBhd2FpdCAoY29uc3QgY2h1bmsgb2Ygc3RyZWFtKSB7XG4gICAgICBjb25zdCBtc2c6IFJ1bm5lck1lc3NhZ2UgPSBjaHVua1xuICAgICAgaWYgKG1zZy5wcm9jKSB7XG4gICAgICAgIGF3YWl0IHJ1bm5lci5hZGRQcm9jZXNzb3IobXNnLnByb2MpXG4gICAgICB9XG4gICAgICBpZiAobXNnLnN0YXJ0KSB7XG4gICAgICAgIHJ1bm5lci5zdGFydCgpLnRoZW4ocHJvY2Vzc29yc0VuZClcbiAgICAgIH1cblxuICAgICAgYXdhaXQgcnVubmVyLmhhbmRsZU9yY2hNZXNzYWdlKG1zZylcbiAgICB9XG5cbiAgICBsb2dnZXIuZXJyb3IoJ1N0cmVhbSBlbmRlZCcpXG4gIH0pKClcblxuICBhd2FpdCBwcm9jZXNzb3JzRW5kZWRcblxuICBsb2dnZXIuaW5mbygnQWxsIHByb2Nlc3NvcnMgYXJlIGZpbmlzaGVkJylcbiAgc3RyZWFtLmVuZCgpXG4gIGNsaWVudC5jbG9zZSgpXG4gIHByb2Nlc3MuZXhpdCgwKVxufVxuIl19
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Any } from './reader.js';
|
|
2
|
+
export interface Convertor<T> {
|
|
3
|
+
from(buffer: Uint8Array): T;
|
|
4
|
+
fromStream(stream: AsyncIterable<Uint8Array>): Promise<T>;
|
|
5
|
+
}
|
|
6
|
+
export declare const AnyConvertor: Convertor<Any>;
|
|
7
|
+
export declare const StringConvertor: Convertor<string>;
|
|
8
|
+
export declare const StreamConvertor: Convertor<AsyncGenerator<Uint8Array>>;
|
|
9
|
+
export declare const NoConvertor: Convertor<Uint8Array>;
|
package/lib/convertor.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const decoder = new TextDecoder();
|
|
2
|
+
export const AnyConvertor = {
|
|
3
|
+
from: function (buffer) {
|
|
4
|
+
return {
|
|
5
|
+
buffer,
|
|
6
|
+
};
|
|
7
|
+
},
|
|
8
|
+
fromStream: async function (inp) {
|
|
9
|
+
const stream = (async function* () {
|
|
10
|
+
yield* inp;
|
|
11
|
+
})();
|
|
12
|
+
return { stream };
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export const StringConvertor = {
|
|
16
|
+
from(buffer) {
|
|
17
|
+
return decoder.decode(buffer);
|
|
18
|
+
},
|
|
19
|
+
async fromStream(stream) {
|
|
20
|
+
const chunks = [];
|
|
21
|
+
for await (const chunk of stream) {
|
|
22
|
+
chunks.push(chunk);
|
|
23
|
+
}
|
|
24
|
+
return decoder.decode(Buffer.concat(chunks));
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const StreamConvertor = {
|
|
28
|
+
from(buffer) {
|
|
29
|
+
return (async function* () {
|
|
30
|
+
yield buffer;
|
|
31
|
+
})();
|
|
32
|
+
},
|
|
33
|
+
async fromStream(stream) {
|
|
34
|
+
return (async function* () {
|
|
35
|
+
yield* stream;
|
|
36
|
+
})();
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
export const NoConvertor = {
|
|
40
|
+
from(buffer) {
|
|
41
|
+
return buffer;
|
|
42
|
+
},
|
|
43
|
+
async fromStream(stream) {
|
|
44
|
+
const chunks = [];
|
|
45
|
+
for await (const chunk of stream) {
|
|
46
|
+
chunks.push(chunk);
|
|
47
|
+
}
|
|
48
|
+
return Buffer.concat(chunks);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVydG9yLmpzIiwic291cm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pIHtcbiAgICAgIHlpZWxkKiBzdHJlYW1cbiAgICB9KSgpXG4gIH0sXG59XG5leHBvcnQgY29uc3QgTm9Db252ZXJ0b3I6IENvbnZlcnRvcjxVaW50OEFycmF5PiA9IHtcbiAgZnJvbShidWZmZXIpIHtcbiAgICByZXR1cm4gYnVmZmVyXG4gIH0sXG4gIGFzeW5jIGZyb21TdHJlYW0oc3RyZWFtKSB7XG4gICAgY29uc3QgY2h1bmtzOiBVaW50OEFycmF5W10gPSBbXVxuICAgIGZvciBhd2FpdCAoY29uc3QgY2h1bmsgb2Ygc3RyZWFtKSB7XG4gICAgICBjaHVua3MucHVzaChjaHVuaylcbiAgICB9XG4gICAgcmV0dXJuIEJ1ZmZlci5jb25jYXQoY2h1bmtzKVxuICB9LFxufVxuIl19
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './client.js';
|
|
2
|
+
export * from './writer.js';
|
|
3
|
+
export * from './reader.js';
|
|
4
|
+
export * from './processor.js';
|
|
5
|
+
export * from './runner.js';
|
|
6
|
+
export * from './logger.js';
|
|
7
|
+
export * as reexports from './reexports.js';
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxVQUFVLENBQUE7QUFDeEIsY0FBYyxVQUFVLENBQUE7QUFDeEIsY0FBYyxVQUFVLENBQUE7QUFDeEIsY0FBYyxhQUFhLENBQUE7QUFDM0IsY0FBYyxVQUFVLENBQUE7QUFDeEIsY0FBYyxVQUFVLENBQUE7QUFFeEIsT0FBTyxLQUFLLFNBQVMsTUFBTSxhQUFhLENBQUEiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2NsaWVudCdcbmV4cG9ydCAqIGZyb20gJy4vd3JpdGVyJ1xuZXhwb3J0ICogZnJvbSAnLi9yZWFkZXInXG5leHBvcnQgKiBmcm9tICcuL3Byb2Nlc3NvcidcbmV4cG9ydCAqIGZyb20gJy4vcnVubmVyJ1xuZXhwb3J0ICogZnJvbSAnLi9sb2dnZXInXG5cbmV4cG9ydCAqIGFzIHJlZXhwb3J0cyBmcm9tICcuL3JlZXhwb3J0cydcbiJdfQ==
|
package/lib/jsonld.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OrchestratorMessage, RunnerClient } from '@rdfc/proto';
|
|
2
|
+
import { ReaderInstance } from './reader.js';
|
|
3
|
+
import { WriterInstance } from './writer.js';
|
|
4
|
+
import { Logger } from 'winston';
|
|
5
|
+
export type RunnerItems = {
|
|
6
|
+
readers: {
|
|
7
|
+
[uri: string]: ReaderInstance[];
|
|
8
|
+
};
|
|
9
|
+
writers: {
|
|
10
|
+
[uri: string]: WriterInstance[];
|
|
11
|
+
};
|
|
12
|
+
client: RunnerClient;
|
|
13
|
+
write: Writable;
|
|
14
|
+
};
|
|
15
|
+
type Writable = (msg: OrchestratorMessage) => Promise<unknown>;
|
|
16
|
+
export declare function parse_jsonld(args: string, logger: Logger, items: RunnerItems): Promise<unknown>;
|
|
17
|
+
export {};
|