@oslo-flanders/core 0.0.16-alpha.0 → 0.0.18-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/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './lib/store/QuadStore';
10
10
  export * from './lib/ServiceIdentifier';
11
11
  export * from './lib/enums/Scope';
12
12
  export * from './lib/enums/PropertyTypes';
13
+ export * from './lib/enums/specificationType';
13
14
  export * from './lib/logging/LogLevel';
14
15
  export * from './lib/logging/Logger';
15
16
  export * from './lib/logging/VoidLogger';
package/index.js CHANGED
@@ -26,6 +26,7 @@ __exportStar(require("./lib/store/QuadStore"), exports);
26
26
  __exportStar(require("./lib/ServiceIdentifier"), exports);
27
27
  __exportStar(require("./lib/enums/Scope"), exports);
28
28
  __exportStar(require("./lib/enums/PropertyTypes"), exports);
29
+ __exportStar(require("./lib/enums/specificationType"), exports);
29
30
  __exportStar(require("./lib/logging/LogLevel"), exports);
30
31
  __exportStar(require("./lib/logging/Logger"), exports);
31
32
  __exportStar(require("./lib/logging/VoidLogger"), exports);
@@ -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 = exports.PropertyType || (exports.PropertyType = {}));
9
+ })(PropertyType || (exports.PropertyType = PropertyType = {}));
10
10
  //# sourceMappingURL=PropertyTypes.js.map
@@ -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 = exports.Scope || (exports.Scope = {}));
10
+ })(Scope || (exports.Scope = Scope = {}));
11
11
  //# sourceMappingURL=Scope.js.map
@@ -0,0 +1,4 @@
1
+ export declare enum SpecificationType {
2
+ ApplicationProfile = 0,
3
+ Vocabulary = 1
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpecificationType = void 0;
4
+ var SpecificationType;
5
+ (function (SpecificationType) {
6
+ SpecificationType[SpecificationType["ApplicationProfile"] = 0] = "ApplicationProfile";
7
+ SpecificationType[SpecificationType["Vocabulary"] = 1] = "Vocabulary";
8
+ })(SpecificationType || (exports.SpecificationType = SpecificationType = {}));
9
+ //# sourceMappingURL=specificationType.js.map
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { Container } from 'inversify';
3
2
  import type { IConfiguration } from './IConfiguration';
4
3
  import type { IService } from './IService';
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setLoggerFactory = exports.createLogger = void 0;
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
@@ -29,8 +29,8 @@ let BaseLogger = class BaseLogger {
29
29
  return this.log('silly', message);
30
30
  }
31
31
  };
32
- BaseLogger = __decorate([
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 = __decorate([
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 = __decorate([
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
@@ -169,7 +169,7 @@ export declare class QuadStore {
169
169
  getCodelist(subject: RDF.Term, graph?: RDF.Term | null): RDF.NamedNode | undefined;
170
170
  /**
171
171
  * Finds the status of a given RDF.Term
172
- * @param subject The RDF.Term to find the parent of
172
+ * @param subject The RDF.Term to find the status of
173
173
  * @param store A N3 quad store
174
174
  * @returns An RDF.Term or undefined if not found
175
175
  */
@@ -306,17 +306,17 @@ let QuadStore = class QuadStore {
306
306
  }
307
307
  /**
308
308
  * Finds the status of a given RDF.Term
309
- * @param subject The RDF.Term to find the parent of
309
+ * @param subject The RDF.Term to find the status of
310
310
  * @param store A N3 quad store
311
311
  * @returns An RDF.Term or undefined if not found
312
312
  */
313
313
  getStatus(subject, graph = null) {
314
- return (this.store.getObjects(subject, namespaces_1.ns.oslo('status'), graph).shift());
314
+ return (this.store.getObjects(subject, namespaces_1.ns.adms('status'), graph).shift());
315
315
  }
316
316
  };
317
- QuadStore = __decorate([
317
+ exports.QuadStore = QuadStore;
318
+ exports.QuadStore = QuadStore = __decorate([
318
319
  (0, inversify_1.injectable)(),
319
320
  __metadata("design:paramtypes", [])
320
321
  ], QuadStore);
321
- exports.QuadStore = QuadStore;
322
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
@@ -1,2 +1 @@
1
- /// <reference types="node" />
2
1
  export declare function fetchFileOrUrl(file: string): Promise<Buffer>;
@@ -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 = void 0;
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
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMaxCount = exports.getMinCount = exports.getVocabularyUsageNote = exports.getApplicationProfileUsageNote = exports.getVocabularyDefinition = exports.getApplicationProfileDefinition = exports.getVocabularyLabel = exports.getApplicationProfileLabel = void 0;
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
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uniqueId = void 0;
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.16-alpha.0",
3
+ "version": "0.0.18-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",