@oslo-flanders/core 0.0.14-alpha.0 → 0.0.16-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.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WinstonLoggerFactory = void 0;
4
4
  const winston_1 = require("winston");
5
5
  const WinstonLogger_1 = require("./WinstonLogger");
6
- const { combine, colorize, printf } = winston_1.format;
6
+ const { combine, printf } = winston_1.format;
7
7
  const messageFormat = printf(({ level, message, messageTimestamp }) => `${new Date(Date.now()).toISOString()} ${level}: ${message}`);
8
8
  class WinstonLoggerFactory {
9
9
  constructor(level) {
@@ -13,7 +13,7 @@ class WinstonLoggerFactory {
13
13
  return new WinstonLogger_1.WinstonLogger((0, winston_1.createLogger)({
14
14
  level: this.level,
15
15
  transports: this.createTransports(),
16
- format: combine(colorize(), messageFormat),
16
+ format: combine(messageFormat),
17
17
  }));
18
18
  }
19
19
  createTransports() {
@@ -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 parent 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
  }
@@ -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,6 +304,15 @@ 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 parent 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
317
  QuadStore = __decorate([
309
318
  (0, inversify_1.injectable)(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslo-flanders/core",
3
- "version": "0.0.14-alpha.0",
3
+ "version": "0.0.16-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": "b8a15c4c91863a99770fcd716ca0ba1ead9bd85c"
52
+ "gitHead": "beaa3821b72a7df104ff61af49fed6c1140fadd8"
53
53
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Digitaal Vlaanderen
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.