@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
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
import { Quad, Term } from
|
|
2
|
-
import { Shapes } from
|
|
3
|
-
export * from
|
|
1
|
+
import { Quad, Term } from '@rdfjs/types'
|
|
2
|
+
import { Shapes } from 'rdf-lens'
|
|
3
|
+
export * from './connectors.js'
|
|
4
4
|
type Processor = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
export type Source =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export declare function extractProcessors(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
2
|
-
import { getArgs } from
|
|
3
|
-
import { load_store, LOG } from
|
|
4
|
-
import path from
|
|
5
|
-
import { RDF } from
|
|
6
|
-
import { ChannelFactory, Conn, JsOntology } from
|
|
7
|
-
import { envReplace, extractShapes } from
|
|
8
|
-
export * from
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
47
|
+
out.push(functionArgs)
|
|
48
|
+
}
|
|
49
|
+
return out
|
|
45
50
|
}
|
|
46
51
|
export async function jsRunner() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
|
2
|
-
import { Store } from
|
|
3
|
-
import { Source } from
|
|
4
|
-
import { Quad, Term } from
|
|
5
|
-
import debug from
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
14
|
-
|
|
13
|
+
namespace: string
|
|
14
|
+
custom: (input: string) => string
|
|
15
15
|
} & {
|
|
16
|
-
|
|
16
|
+
imports: string
|
|
17
17
|
} & {
|
|
18
|
-
|
|
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
|
-
|
|
22
|
-
|
|
25
|
+
namespace: string
|
|
26
|
+
custom: (input: string) => string
|
|
23
27
|
} & {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
40
|
-
}
|
|
41
|
-
export type Map<V, K, T, O> = (value: V, key: K, item: T) => O
|
|
42
|
-
export declare function load_quads(
|
|
43
|
-
|
|
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
|
|
2
|
-
import http from
|
|
3
|
-
import https from
|
|
4
|
-
import { DataFactory, Parser, StreamParser } from
|
|
5
|
-
import { createUriAndTermNamespace } from
|
|
6
|
-
import debug from
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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(
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
+
|