@oslo-flanders/core 0.0.15-alpha.0 → 0.0.17-alpha.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/lib/enums/PropertyTypes.js +1 -1
- package/lib/enums/Scope.js +1 -1
- package/lib/interfaces/AppRunner.d.ts +0 -1
- package/lib/logging/LogUtil.js +2 -3
- package/lib/logging/Logger.js +2 -2
- package/lib/logging/VoidLogger.js +2 -2
- package/lib/logging/WinstonLogger.js +2 -2
- package/lib/store/QuadStore.d.ts +7 -0
- package/lib/store/QuadStore.js +24 -15
- package/lib/utils/anchorTag.d.ts +1 -0
- package/lib/utils/anchorTag.js +9 -0
- package/lib/utils/fetchFileOrUrl.d.ts +0 -1
- package/lib/utils/fetchFileOrUrl.js +1 -2
- package/lib/utils/storeUtils.js +8 -9
- package/lib/utils/uniqueId.js +1 -2
- package/package.json +2 -2
|
@@ -6,5 +6,5 @@ var PropertyType;
|
|
|
6
6
|
PropertyType["DataTypeProperty"] = "http://www.w3.org/2002/07/owl#DatatypeProperty";
|
|
7
7
|
PropertyType["ObjectProperty"] = "http://www.w3.org/2002/07/owl#ObjectProperty";
|
|
8
8
|
PropertyType["Property"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property";
|
|
9
|
-
})(PropertyType
|
|
9
|
+
})(PropertyType || (exports.PropertyType = PropertyType = {}));
|
|
10
10
|
//# sourceMappingURL=PropertyTypes.js.map
|
package/lib/enums/Scope.js
CHANGED
|
@@ -7,5 +7,5 @@ var Scope;
|
|
|
7
7
|
Scope["InPublicationEnvironment"] = "https://data.vlaanderen.be/id/concept/scope/InPublicationEnvironment";
|
|
8
8
|
Scope["External"] = "https://data.vlaanderen.be/id/concept/scope/External";
|
|
9
9
|
Scope["Undefined"] = "https://data.vlaanderen.be/id/concept/scope/Undefined";
|
|
10
|
-
})(Scope
|
|
10
|
+
})(Scope || (exports.Scope = Scope = {}));
|
|
11
11
|
//# sourceMappingURL=Scope.js.map
|
package/lib/logging/LogUtil.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createLogger = createLogger;
|
|
4
|
+
exports.setLoggerFactory = setLoggerFactory;
|
|
4
5
|
const VoidLoggerFactory_1 = require("./VoidLoggerFactory");
|
|
5
6
|
const WinstonLoggerFactory_1 = require("./WinstonLoggerFactory");
|
|
6
7
|
let loggerFactory = new VoidLoggerFactory_1.VoidLoggerFactory();
|
|
7
8
|
function createLogger() {
|
|
8
9
|
return loggerFactory.createLogger();
|
|
9
10
|
}
|
|
10
|
-
exports.createLogger = createLogger;
|
|
11
11
|
function setLoggerFactory(params) {
|
|
12
12
|
if (!params.silent) {
|
|
13
13
|
loggerFactory = new WinstonLoggerFactory_1.WinstonLoggerFactory(params.logLevel);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
exports.setLoggerFactory = setLoggerFactory;
|
|
17
16
|
//# sourceMappingURL=LogUtil.js.map
|
package/lib/logging/Logger.js
CHANGED
|
@@ -29,8 +29,8 @@ let BaseLogger = class BaseLogger {
|
|
|
29
29
|
return this.log('silly', message);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
BaseLogger =
|
|
32
|
+
exports.BaseLogger = BaseLogger;
|
|
33
|
+
exports.BaseLogger = BaseLogger = __decorate([
|
|
33
34
|
(0, inversify_1.injectable)()
|
|
34
35
|
], BaseLogger);
|
|
35
|
-
exports.BaseLogger = BaseLogger;
|
|
36
36
|
//# sourceMappingURL=Logger.js.map
|
|
@@ -20,9 +20,9 @@ let VoidLogger = class VoidLogger extends Logger_1.BaseLogger {
|
|
|
20
20
|
return this;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
VoidLogger =
|
|
23
|
+
exports.VoidLogger = VoidLogger;
|
|
24
|
+
exports.VoidLogger = VoidLogger = __decorate([
|
|
24
25
|
(0, inversify_1.injectable)(),
|
|
25
26
|
__metadata("design:paramtypes", [])
|
|
26
27
|
], VoidLogger);
|
|
27
|
-
exports.VoidLogger = VoidLogger;
|
|
28
28
|
//# sourceMappingURL=VoidLogger.js.map
|
|
@@ -23,9 +23,9 @@ let WinstonLogger = class WinstonLogger extends Logger_1.BaseLogger {
|
|
|
23
23
|
return this;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
WinstonLogger =
|
|
26
|
+
exports.WinstonLogger = WinstonLogger;
|
|
27
|
+
exports.WinstonLogger = WinstonLogger = __decorate([
|
|
27
28
|
(0, inversify_1.injectable)(),
|
|
28
29
|
__metadata("design:paramtypes", [winston_1.Logger])
|
|
29
30
|
], WinstonLogger);
|
|
30
|
-
exports.WinstonLogger = WinstonLogger;
|
|
31
31
|
//# sourceMappingURL=WinstonLogger.js.map
|
package/lib/store/QuadStore.d.ts
CHANGED
|
@@ -167,4 +167,11 @@ export declare class QuadStore {
|
|
|
167
167
|
*/
|
|
168
168
|
getParentOfProperty(subject: RDF.Term, graph?: RDF.Term | null): RDF.NamedNode | undefined;
|
|
169
169
|
getCodelist(subject: RDF.Term, graph?: RDF.Term | null): RDF.NamedNode | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Finds the status of a given RDF.Term
|
|
172
|
+
* @param subject The RDF.Term to find the status of
|
|
173
|
+
* @param store A N3 quad store
|
|
174
|
+
* @returns An RDF.Term or undefined if not found
|
|
175
|
+
*/
|
|
176
|
+
getStatus(subject: RDF.Term, graph?: RDF.Term | null): RDF.NamedNode | undefined;
|
|
170
177
|
}
|
package/lib/store/QuadStore.js
CHANGED
|
@@ -145,8 +145,8 @@ let QuadStore = class QuadStore {
|
|
|
145
145
|
*/
|
|
146
146
|
getVocLabel(subject, language, graph = null) {
|
|
147
147
|
var _a;
|
|
148
|
-
return (_a = this.getLabels(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('vocLabel')) &&
|
|
149
|
-
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object;
|
|
148
|
+
return ((_a = this.getLabels(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('vocLabel')) &&
|
|
149
|
+
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object);
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
152
|
* Finds the oslo:apLabel whose language tag matches the given language
|
|
@@ -157,8 +157,8 @@ let QuadStore = class QuadStore {
|
|
|
157
157
|
*/
|
|
158
158
|
getApLabel(subject, language, graph = null) {
|
|
159
159
|
var _a;
|
|
160
|
-
return (_a = this.getLabels(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('apLabel')) &&
|
|
161
|
-
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object;
|
|
160
|
+
return ((_a = this.getLabels(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('apLabel')) &&
|
|
161
|
+
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object);
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Finds the oslo:diagramLabel for a given subject
|
|
@@ -169,7 +169,7 @@ let QuadStore = class QuadStore {
|
|
|
169
169
|
*/
|
|
170
170
|
getDiagramLabel(subject, graph = null) {
|
|
171
171
|
var _a;
|
|
172
|
-
return (_a = this.getLabels(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('diagramLabel')))) === null || _a === void 0 ? void 0 : _a.object;
|
|
172
|
+
return ((_a = this.getLabels(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('diagramLabel')))) === null || _a === void 0 ? void 0 : _a.object);
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* Find all definitions for a given subject
|
|
@@ -191,8 +191,8 @@ let QuadStore = class QuadStore {
|
|
|
191
191
|
*/
|
|
192
192
|
getVocDefinition(subject, language, graph = null) {
|
|
193
193
|
var _a;
|
|
194
|
-
return (_a = this.getDefinitions(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('vocDefinition')) &&
|
|
195
|
-
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object;
|
|
194
|
+
return ((_a = this.getDefinitions(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('vocDefinition')) &&
|
|
195
|
+
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object);
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* Finds the oslo:apDefinition whose language tag matches the given language
|
|
@@ -203,8 +203,8 @@ let QuadStore = class QuadStore {
|
|
|
203
203
|
*/
|
|
204
204
|
getApDefinition(subject, language, graph = null) {
|
|
205
205
|
var _a;
|
|
206
|
-
return (_a = this.getDefinitions(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('apDefinition')) &&
|
|
207
|
-
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object;
|
|
206
|
+
return ((_a = this.getDefinitions(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('apDefinition')) &&
|
|
207
|
+
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object);
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
210
|
* Finds the rdfs:range of a given RDF.Term
|
|
@@ -244,8 +244,8 @@ let QuadStore = class QuadStore {
|
|
|
244
244
|
*/
|
|
245
245
|
getVocUsageNote(subject, language, graph = null) {
|
|
246
246
|
var _a;
|
|
247
|
-
return (_a = this.getUsageNotes(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('vocUsageNote')) &&
|
|
248
|
-
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object;
|
|
247
|
+
return ((_a = this.getUsageNotes(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('vocUsageNote')) &&
|
|
248
|
+
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object);
|
|
249
249
|
}
|
|
250
250
|
/**
|
|
251
251
|
* Finds the oslo:apUsageNote of which the language tag matches the given language
|
|
@@ -256,8 +256,8 @@ let QuadStore = class QuadStore {
|
|
|
256
256
|
*/
|
|
257
257
|
getApUsageNote(subject, language, graph = null) {
|
|
258
258
|
var _a;
|
|
259
|
-
return (_a = this.getUsageNotes(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('apUsageNote')) &&
|
|
260
|
-
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object;
|
|
259
|
+
return ((_a = this.getUsageNotes(subject, graph).find((x) => x.predicate.equals(namespaces_1.ns.oslo('apUsageNote')) &&
|
|
260
|
+
x.object.language === (language || ''))) === null || _a === void 0 ? void 0 : _a.object);
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
263
263
|
* Finds the example:scope of a given subject
|
|
@@ -304,10 +304,19 @@ let QuadStore = class QuadStore {
|
|
|
304
304
|
getCodelist(subject, graph = null) {
|
|
305
305
|
return (this.store.getObjects(subject, namespaces_1.ns.oslo('codelist'), graph).shift());
|
|
306
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Finds the status of a given RDF.Term
|
|
309
|
+
* @param subject The RDF.Term to find the status of
|
|
310
|
+
* @param store A N3 quad store
|
|
311
|
+
* @returns An RDF.Term or undefined if not found
|
|
312
|
+
*/
|
|
313
|
+
getStatus(subject, graph = null) {
|
|
314
|
+
return (this.store.getObjects(subject, namespaces_1.ns.oslo('status'), graph).shift());
|
|
315
|
+
}
|
|
307
316
|
};
|
|
308
|
-
QuadStore =
|
|
317
|
+
exports.QuadStore = QuadStore;
|
|
318
|
+
exports.QuadStore = QuadStore = __decorate([
|
|
309
319
|
(0, inversify_1.injectable)(),
|
|
310
320
|
__metadata("design:paramtypes", [])
|
|
311
321
|
], QuadStore);
|
|
312
|
-
exports.QuadStore = QuadStore;
|
|
313
322
|
//# sourceMappingURL=QuadStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateAnchorTag(entityLabel: string, propLabel?: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateAnchorTag = generateAnchorTag;
|
|
4
|
+
function generateAnchorTag(entityLabel, propLabel) {
|
|
5
|
+
const label = propLabel ? `${entityLabel}:${propLabel}` : entityLabel;
|
|
6
|
+
const anchorHref = `${encodeURIComponent(label.replace(' ', ''))}`;
|
|
7
|
+
return anchorHref;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=anchorTag.js.map
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchFileOrUrl =
|
|
6
|
+
exports.fetchFileOrUrl = fetchFileOrUrl;
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const promises_1 = require("fs/promises");
|
|
9
9
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
@@ -19,5 +19,4 @@ async function fetchFileOrUrl(file) {
|
|
|
19
19
|
}
|
|
20
20
|
return (0, promises_1.readFile)(file);
|
|
21
21
|
}
|
|
22
|
-
exports.fetchFileOrUrl = fetchFileOrUrl;
|
|
23
22
|
//# sourceMappingURL=fetchFileOrUrl.js.map
|
package/lib/utils/storeUtils.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getApplicationProfileLabel = getApplicationProfileLabel;
|
|
4
|
+
exports.getVocabularyLabel = getVocabularyLabel;
|
|
5
|
+
exports.getApplicationProfileDefinition = getApplicationProfileDefinition;
|
|
6
|
+
exports.getVocabularyDefinition = getVocabularyDefinition;
|
|
7
|
+
exports.getApplicationProfileUsageNote = getApplicationProfileUsageNote;
|
|
8
|
+
exports.getVocabularyUsageNote = getVocabularyUsageNote;
|
|
9
|
+
exports.getMinCount = getMinCount;
|
|
10
|
+
exports.getMaxCount = getMaxCount;
|
|
4
11
|
const namespaces_1 = require("./namespaces");
|
|
5
12
|
function getApplicationProfileLabel(subject, store, language = null) {
|
|
6
13
|
var _a, _b, _c;
|
|
@@ -16,7 +23,6 @@ function getApplicationProfileLabel(subject, store, language = null) {
|
|
|
16
23
|
}
|
|
17
24
|
return (_c = labels.find(x => x.predicate.equals(namespaces_1.ns.oslo('diagramLabel')))) === null || _c === void 0 ? void 0 : _c.object;
|
|
18
25
|
}
|
|
19
|
-
exports.getApplicationProfileLabel = getApplicationProfileLabel;
|
|
20
26
|
function getVocabularyLabel(subject, store, language = null) {
|
|
21
27
|
var _a, _b;
|
|
22
28
|
const labels = store.getLabels(subject);
|
|
@@ -27,7 +33,6 @@ function getVocabularyLabel(subject, store, language = null) {
|
|
|
27
33
|
}
|
|
28
34
|
return (_b = labels.find(x => x.predicate.equals(namespaces_1.ns.oslo('diagramLabel')))) === null || _b === void 0 ? void 0 : _b.object;
|
|
29
35
|
}
|
|
30
|
-
exports.getVocabularyLabel = getVocabularyLabel;
|
|
31
36
|
function getApplicationProfileDefinition(subject, store, language = null) {
|
|
32
37
|
var _a, _b;
|
|
33
38
|
const definitions = store.getDefinitions(subject);
|
|
@@ -43,7 +48,6 @@ function getApplicationProfileDefinition(subject, store, language = null) {
|
|
|
43
48
|
}
|
|
44
49
|
return undefined;
|
|
45
50
|
}
|
|
46
|
-
exports.getApplicationProfileDefinition = getApplicationProfileDefinition;
|
|
47
51
|
function getVocabularyDefinition(subject, store, language = null) {
|
|
48
52
|
var _a;
|
|
49
53
|
const definitions = store.getDefinitions(subject);
|
|
@@ -54,7 +58,6 @@ function getVocabularyDefinition(subject, store, language = null) {
|
|
|
54
58
|
}
|
|
55
59
|
return undefined;
|
|
56
60
|
}
|
|
57
|
-
exports.getVocabularyDefinition = getVocabularyDefinition;
|
|
58
61
|
function getApplicationProfileUsageNote(subject, store, language = null) {
|
|
59
62
|
var _a, _b;
|
|
60
63
|
const usageNotes = store.getUsageNotes(subject);
|
|
@@ -70,7 +73,6 @@ function getApplicationProfileUsageNote(subject, store, language = null) {
|
|
|
70
73
|
}
|
|
71
74
|
return undefined;
|
|
72
75
|
}
|
|
73
|
-
exports.getApplicationProfileUsageNote = getApplicationProfileUsageNote;
|
|
74
76
|
function getVocabularyUsageNote(subject, store, language = null) {
|
|
75
77
|
var _a;
|
|
76
78
|
const usageNotes = store.getUsageNotes(subject);
|
|
@@ -81,15 +83,12 @@ function getVocabularyUsageNote(subject, store, language = null) {
|
|
|
81
83
|
}
|
|
82
84
|
return undefined;
|
|
83
85
|
}
|
|
84
|
-
exports.getVocabularyUsageNote = getVocabularyUsageNote;
|
|
85
86
|
function getMinCount(subject, store) {
|
|
86
87
|
var _a;
|
|
87
88
|
return (_a = store.findObject(subject, namespaces_1.ns.shacl('minCount'))) === null || _a === void 0 ? void 0 : _a.value;
|
|
88
89
|
}
|
|
89
|
-
exports.getMinCount = getMinCount;
|
|
90
90
|
function getMaxCount(subject, store) {
|
|
91
91
|
var _a;
|
|
92
92
|
return (_a = store.findObject(subject, namespaces_1.ns.shacl('maxCount'))) === null || _a === void 0 ? void 0 : _a.value;
|
|
93
93
|
}
|
|
94
|
-
exports.getMaxCount = getMaxCount;
|
|
95
94
|
//# sourceMappingURL=storeUtils.js.map
|
package/lib/utils/uniqueId.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uniqueId =
|
|
3
|
+
exports.uniqueId = uniqueId;
|
|
4
4
|
const crypto_js_1 = require("crypto-js");
|
|
5
5
|
function uniqueId(guid, label, id) {
|
|
6
6
|
const object = {
|
|
@@ -10,5 +10,4 @@ function uniqueId(guid, label, id) {
|
|
|
10
10
|
};
|
|
11
11
|
return (0, crypto_js_1.SHA256)(JSON.stringify(object)).toString();
|
|
12
12
|
}
|
|
13
|
-
exports.uniqueId = uniqueId;
|
|
14
13
|
//# sourceMappingURL=uniqueId.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslo-flanders/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17-alpha.0",
|
|
4
4
|
"description": "Core interfaces and utilities",
|
|
5
5
|
"author": "Digitaal Vlaanderen <https://data.vlaanderen.be/id/organisatie/OVO002949>",
|
|
6
6
|
"homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-core#readme",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@types/streamify-string": "^1.0.0",
|
|
50
50
|
"@types/tmp": "^0.2.3"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "beaa3821b72a7df104ff61af49fed6c1140fadd8"
|
|
53
53
|
}
|