@rdfc/sparql-ingest-processor-ts 0.5.1 → 1.0.0

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/processors.ttl CHANGED
@@ -1,132 +1,115 @@
1
- @prefix js: <https://w3id.org/conn/js#>.
2
- @prefix fno: <https://w3id.org/function/ontology#>.
3
- @prefix fnom: <https://w3id.org/function/vocabulary/mapping#>.
4
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
5
- @prefix : <https://w3id.org/conn#>.
1
+ @prefix rdfc: <https://w3id.org/rdf-connect#>.
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
6
3
  @prefix sh: <http://www.w3.org/ns/shacl#>.
7
- @prefix dc: <http://purl.org/dc/terms/>.
4
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
8
5
 
9
- js:SPARQLIngest a js:JsProcess;
10
- js:file <./lib/SPARQLIngest.js>;
11
- js:function "sparqlIngest";
12
- js:location <./>;
13
- js:mapping [
14
- a fno:Mapping;
15
- fno:parameterMapping [
16
- a fnom:PositionParameterMapping;
17
- fnom:functionParameter "memberStream";
18
- fnom:implementationParameterPosition "0"^^xsd:integer;
19
- ], [
20
- a fnom:PositionParameterMapping;
21
- fnom:functionParameter "ingestConfig";
22
- fnom:implementationParameterPosition "1"^^xsd:integer;
23
- ], [
24
- a fnom:PositionParameterMapping;
25
- fnom:functionParameter "sparqlWriter";
26
- fnom:implementationParameterPosition "2"^^xsd:integer;
27
- ]
28
- ].
6
+ rdfc:SPARQLIngest rdfc:jsImplementationOf rdfc:Processor;
7
+ rdfs:label "SPARQL Ingest Processor";
8
+ rdfs:comment "A processor that ingests RDF data into a SPARQL endpoint";
9
+ rdfc:file <./lib/SPARQLIngest.js>;
10
+ rdfc:class "SPARQLIngest";
11
+ rdfc:entrypoint <./>.
29
12
 
30
13
  [ ] a sh:NodeShape;
31
- sh:targetClass js:SPARQLIngest;
14
+ sh:targetClass rdfc:SPARQLIngest;
32
15
  sh:property [
33
- sh:path js:memberStream;
16
+ sh:path rdfc:memberStream;
34
17
  sh:name "memberStream";
35
- sh:class :ReaderChannel;
18
+ sh:class rdfc:Reader;
36
19
  sh:minCount 1;
37
20
  sh:maxCount 1;
38
21
  ], [
39
- sh:path js:ingestConfig;
40
- sh:name "ingestConfig";
41
- sh:class js:IngestConfig;
22
+ sh:path rdfc:ingestConfig;
23
+ sh:name "config";
24
+ sh:class rdfc:IngestConfig;
42
25
  sh:minCount 1;
43
26
  sh:maxCount 1;
44
27
  ], [
45
- sh:path js:sparqlWriter;
28
+ sh:path rdfc:sparqlWriter;
46
29
  sh:name "sparqlWriter";
47
- sh:class :WriterChannel;
30
+ sh:class rdfc:Writer;
48
31
  sh:maxCount 1;
49
32
  ].
50
33
 
51
34
  [ ] a sh:NodeShape;
52
- sh:targetClass js:IngestConfig;
35
+ sh:targetClass rdfc:IngestConfig;
53
36
  sh:property [
54
- sh:path js:memberIsGraph;
37
+ sh:path rdfc:memberIsGraph;
55
38
  sh:datatype xsd:boolean;
56
39
  sh:name "memberIsGraph";
57
40
  sh:maxCount 1;
58
41
  sh:minCount 1;
59
42
  ], [
60
- sh:path js:memberShape;
43
+ sh:path rdfc:memberShape;
61
44
  sh:datatype xsd:string;
62
45
  sh:name "memberShapes";
63
46
  sh:minCount 0;
64
47
  ], [
65
- sh:path js:changeSemantics;
66
- sh:class js:ChangeSemantics;
48
+ sh:path rdfc:changeSemantics;
49
+ sh:class rdfc:ChangeSemantics;
67
50
  sh:name "changeSemantics";
68
51
  sh:maxCount 1;
69
52
  sh:minCount 0;
70
53
  ], [
71
- sh:path js:targetNamedGraph;
54
+ sh:path rdfc:targetNamedGraph;
72
55
  sh:datatype xsd:string;
73
56
  sh:name "targetNamedGraph";
74
57
  sh:maxCount 1;
75
58
  sh:minCount 0;
76
59
  ], [
77
- sh:path js:transactionConfig;
78
- sh:class js:TransactionConfig;
60
+ sh:path rdfc:transactionConfig;
61
+ sh:class rdfc:TransactionConfig;
79
62
  sh:name "transactionConfig";
80
63
  sh:maxCount 1;
81
64
  sh:minCount 0;
82
65
  ], [
83
- sh:path js:graphStoreUrl;
66
+ sh:path rdfc:graphStoreUrl;
84
67
  sh:datatype xsd:string;
85
68
  sh:name "graphStoreUrl";
86
69
  sh:maxCount 1;
87
70
  sh:minCount 0;
88
71
  ], [
89
- sh:path js:forVirtuoso;
72
+ sh:path rdfc:forVirtuoso;
90
73
  sh:datatype xsd:boolean;
91
74
  sh:name "forVirtuoso";
92
75
  sh:maxCount 1;
93
76
  sh:minCount 0;
94
77
  ], [
95
- sh:path js:accessToken;
78
+ sh:path rdfc:accessToken;
96
79
  sh:datatype xsd:string;
97
80
  sh:name "accessToken";
98
81
  sh:maxCount 1;
99
82
  sh:minCount 0;
100
83
  ], [
101
- sh:path js:measurePerformance;
102
- sh:class js:PerformanceConfig;
84
+ sh:path rdfc:measurePerformance;
85
+ sh:class rdfc:PerformanceConfig;
103
86
  sh:name "measurePerformance";
104
87
  sh:maxCount 1;
105
88
  sh:minCount 0;
106
89
  ].
107
90
 
108
91
  [ ] a sh:NodeShape;
109
- sh:targetClass js:PerformanceConfig;
92
+ sh:targetClass rdfc:PerformanceConfig;
110
93
  sh:property [
111
- sh:path js:name;
94
+ sh:path rdfc:name;
112
95
  sh:datatype xsd:string;
113
96
  sh:name "name";
114
97
  sh:maxCount 1;
115
98
  sh:minCount 1;
116
99
  ], [
117
- sh:path js:outputPath;
100
+ sh:path rdfc:outputPath;
118
101
  sh:datatype xsd:string;
119
102
  sh:name "outputPath";
120
103
  sh:maxCount 1;
121
104
  sh:minCount 1;
122
105
  ], [
123
- sh:path js:failureIsFatal;
106
+ sh:path rdfc:failureIsFatal;
124
107
  sh:datatype xsd:boolean;
125
108
  sh:name "failureIsFatal";
126
109
  sh:maxCount 1;
127
110
  sh:minCount 0;
128
111
  ], [
129
- sh:path js:queryTimeout;
112
+ sh:path rdfc:queryTimeout;
130
113
  sh:datatype xsd:integer;
131
114
  sh:name "queryTimeout";
132
115
  sh:maxCount 1;
@@ -134,45 +117,46 @@ js:SPARQLIngest a js:JsProcess;
134
117
  ].
135
118
 
136
119
  [ ] a sh:NodeShape;
137
- sh:targetClass js:ChangeSemantics;
120
+ sh:targetClass rdfc:ChangeSemantics;
138
121
  sh:property [
139
- sh:path js:changeTypePath;
122
+ sh:path rdfc:changeTypePath;
140
123
  sh:datatype xsd:string;
141
124
  sh:name "changeTypePath";
142
125
  sh:maxCount 1;
143
126
  sh:minCount 1;
144
127
  ], [
145
- sh:path js:createValue;
128
+ sh:path rdfc:createValue;
146
129
  sh:datatype xsd:string;
147
130
  sh:name "createValue";
148
131
  sh:maxCount 1;
149
132
  sh:minCount 1;
150
133
  ], [
151
- sh:path js:updateValue;
134
+ sh:path rdfc:updateValue;
152
135
  sh:datatype xsd:string;
153
136
  sh:name "updateValue";
154
137
  sh:maxCount 1;
155
138
  sh:minCount 1;
156
139
  ], [
157
- sh:path js:deleteValue;
140
+ sh:path rdfc:deleteValue;
158
141
  sh:datatype xsd:string;
159
142
  sh:name "deleteValue";
160
143
  sh:maxCount 1;
161
144
  sh:minCount 1;
162
145
  ].
163
146
 
164
- [ ] a sh:NodeShape;
165
- sh:targetClass js:TransactionConfig;
147
+ [ ] a sh:NodeShape;
148
+ sh:targetClass rdfc:TransactionConfig;
166
149
  sh:property [
167
- sh:path js:transactionIdPath;
150
+ sh:path rdfc:transactionIdPath;
168
151
  sh:datatype xsd:string;
169
152
  sh:name "transactionIdPath";
170
153
  sh:maxCount 1;
171
154
  sh:minCount 1;
172
155
  ], [
173
- sh:path js:transactionEndPath;
156
+ sh:path rdfc:transactionEndPath;
174
157
  sh:datatype xsd:string;
175
158
  sh:name "transactionEndPath";
176
159
  sh:maxCount 1;
177
160
  sh:minCount 1;
178
- ].
161
+ ].
162
+
package/lib/LogUtil.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { Logger } from "winston";
2
- export declare function getLoggerFor(loggable: string | Instance): Logger;
3
- interface Constructor {
4
- name: string;
5
- }
6
- interface Instance {
7
- constructor: Constructor;
8
- }
9
- export {};
package/lib/LogUtil.js DELETED
@@ -1,54 +0,0 @@
1
- import winston, { format } from "winston";
2
- const PROCESSOR_NAME = "sparql-ingest";
3
- const consoleTransport = new winston.transports.Console({
4
- stderrLevels: [
5
- "error",
6
- "warn",
7
- "info",
8
- "http",
9
- "verbose",
10
- "debug",
11
- "silly"
12
- ]
13
- });
14
- if (typeof process !== "undefined") {
15
- consoleTransport.level =
16
- process.env.LOG_LEVEL ||
17
- (process.env.DEBUG?.includes(PROCESSOR_NAME) ||
18
- process.env.DEBUG === "*"
19
- ? "debug"
20
- : "info");
21
- }
22
- const classLoggers = new WeakMap();
23
- const stringLoggers = new Map();
24
- export function getLoggerFor(loggable) {
25
- let logger;
26
- if (typeof loggable === "string") {
27
- if (stringLoggers.has(loggable)) {
28
- logger = stringLoggers.get(loggable);
29
- }
30
- else {
31
- logger = createLogger(loggable);
32
- stringLoggers.set(loggable, logger);
33
- }
34
- }
35
- else {
36
- const { constructor } = loggable;
37
- if (classLoggers.has(constructor)) {
38
- logger = classLoggers.get(constructor);
39
- }
40
- else {
41
- logger = createLogger(constructor.name);
42
- classLoggers.set(constructor, logger);
43
- }
44
- }
45
- return logger;
46
- }
47
- function createLogger(label) {
48
- return winston.createLogger({
49
- format: format.combine(format.label({ label }), format.colorize(), format.timestamp(), format.metadata({
50
- fillExcept: ["level", "timestamp", "label", "message"],
51
- }), format.printf(({ level: levelInner, message, label: labelInner, timestamp, }) => `${timestamp} {${PROCESSOR_NAME}} [${labelInner}] ${levelInner}: ${message}`)),
52
- transports: [consoleTransport],
53
- });
54
- }