@oslo-flanders/core 1.0.9 → 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
@@ -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
@@ -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.9",
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",