@oslo-flanders/core 1.0.8 → 1.0.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.
@@ -24,6 +24,19 @@ const DataTypes = new Map([
24
24
  ['duration', `${xsd}#duration`],
25
25
  ['html', `${rdf}#HTML`],
26
26
  ['uri', `${xsd}#anyURI`],
27
+ ['json', `${rdf}#JSON`],
28
+ ['short', `${xsd}#long`],
29
+ ['short', `${xsd}#short`],
30
+ ['byte', `${xsd}#byte`],
31
+ ['hexbinary', `${xsd}#hexBinary`],
32
+ ['base64binary', `${xsd}#base64Binary`],
33
+ ['nonnegativeinteger', `${xsd}#nonNegativeInteger`],
34
+ ['nonpositiveinteger', `${xsd}#nonPositiveInteger`],
35
+ ['negativeinteger', `${xsd}#negativeInteger`],
36
+ ['positiveinteger', `${xsd}#positiveInteger`],
37
+ ['unsignedshort', `${xsd}#unsignedLong`],
38
+ ['unsignedshort', `${xsd}#unsignedShort`],
39
+ ['unsignedbyte', `${xsd}#unsignedByte`],
27
40
  ]);
28
41
  const getDataType = (key) => DataTypes.get(key.toLowerCase());
29
42
  exports.getDataType = getDataType;
@@ -26,6 +26,15 @@ export declare class QuadStore {
26
26
  * @returns an array of RDF.NamedNodes
27
27
  */
28
28
  getDatatypes(graph?: RDF.Term | null): RDF.NamedNode[];
29
+ /**
30
+ * Finds all subjects where predicate is 'rdf:type' and object 'skos:Concept'
31
+ * We chose the skos:Concept here as enumerations have the skos:Concept uri in EA
32
+ * There is no skos:ConceptScheme used in EA since we assume that it's only used to
33
+ * represent a value from a skos:ConceptScheme instead of the conceptscheme as a whole
34
+ * https://github.com/Informatievlaanderen/OSLO-UML-Transformer/wiki/Technical-Guidelines#enumerations
35
+ * @returns an array of RDF.NamedNodes
36
+ */
37
+ getEnumerations(graph?: RDF.Term | null): RDF.NamedNode[];
29
38
  /**
30
39
  * Finds all subjects where predicate is 'rdf:type' and object 'owl:DatatypeProperty'
31
40
  * @returns an array of RDF.NamedNodes
@@ -142,13 +151,13 @@ export declare class QuadStore {
142
151
  getScope(subject: RDF.Term, graph?: RDF.Term | null): RDF.NamedNode | undefined;
143
152
  /**
144
153
  * Finds the shacl:minCardinality for a given subject
145
- * @param subject The RDF.Term to find the shacl:minCardinaly for
154
+ * @param subject The RDF.Term to find the shacl:minCardinality for
146
155
  * @returns An RDF.Literal or undefined if not found
147
156
  */
148
157
  getMinCardinality(subject: RDF.Term, graph?: RDF.Term | null): RDF.Literal | undefined;
149
158
  /**
150
159
  * Finds the shacl:maxCardinality for a given subject
151
- * @param subject The RDF.Term to find the shacl:maxCardinaly for
160
+ * @param subject The RDF.Term to find the shacl:maxCardinality for
152
161
  * @returns An RDF.Literal or undefined if not found
153
162
  */
154
163
  getMaxCardinality(subject: RDF.Term, graph?: RDF.Term | null): RDF.Literal | undefined;
@@ -101,6 +101,17 @@ let QuadStore = class QuadStore {
101
101
  getDatatypes(graph = null) {
102
102
  return (this.store.getSubjects(namespaces_1.ns.rdf('type'), namespaces_1.ns.rdfs('Datatype'), graph));
103
103
  }
104
+ /**
105
+ * Finds all subjects where predicate is 'rdf:type' and object 'skos:Concept'
106
+ * We chose the skos:Concept here as enumerations have the skos:Concept uri in EA
107
+ * There is no skos:ConceptScheme used in EA since we assume that it's only used to
108
+ * represent a value from a skos:ConceptScheme instead of the conceptscheme as a whole
109
+ * https://github.com/Informatievlaanderen/OSLO-UML-Transformer/wiki/Technical-Guidelines#enumerations
110
+ * @returns an array of RDF.NamedNodes
111
+ */
112
+ getEnumerations(graph = null) {
113
+ return (this.store.getSubjects(namespaces_1.ns.rdf('type'), namespaces_1.ns.skos('Concept'), graph));
114
+ }
104
115
  /**
105
116
  * Finds all subjects where predicate is 'rdf:type' and object 'owl:DatatypeProperty'
106
117
  * @returns an array of RDF.NamedNodes
@@ -269,7 +280,7 @@ let QuadStore = class QuadStore {
269
280
  }
270
281
  /**
271
282
  * Finds the shacl:minCardinality for a given subject
272
- * @param subject The RDF.Term to find the shacl:minCardinaly for
283
+ * @param subject The RDF.Term to find the shacl:minCardinality for
273
284
  * @returns An RDF.Literal or undefined if not found
274
285
  */
275
286
  getMinCardinality(subject, graph = null) {
@@ -277,7 +288,7 @@ let QuadStore = class QuadStore {
277
288
  }
278
289
  /**
279
290
  * Finds the shacl:maxCardinality for a given subject
280
- * @param subject The RDF.Term to find the shacl:maxCardinaly for
291
+ * @param subject The RDF.Term to find the shacl:maxCardinality for
281
292
  * @returns An RDF.Literal or undefined if not found
282
293
  */
283
294
  getMaxCardinality(subject, graph = null) {
@@ -336,8 +347,6 @@ let QuadStore = class QuadStore {
336
347
  * @returns An RDF.Term or undefined if not found
337
348
  */
338
349
  getExtension(subject, graph = null) {
339
- console.log(this.store.getObjects(subject, namespaces_1.ns.oslo('key'), graph).shift());
340
- console.log(this.store.getObjects(subject, null, graph));
341
350
  return (this.store.getObjects(subject, namespaces_1.ns.oslo('oslo:key'), graph).shift());
342
351
  }
343
352
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslo-flanders/core",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
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",