@faubulous/mentor-rdf 0.2.49 → 0.2.50

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.
Files changed (154) hide show
  1. package/out/index.d.ts +0 -0
  2. package/out/index.js +1 -1
  3. package/out/ontologies/index.d.ts +0 -0
  4. package/out/ontologies/owl.d.ts +0 -0
  5. package/out/ontologies/rdf.d.ts +0 -0
  6. package/out/ontologies/rdfa.d.ts +0 -0
  7. package/out/ontologies/rdfs.d.ts +0 -0
  8. package/out/ontologies/sh.d.ts +0 -0
  9. package/out/ontologies/skos-xl.d.ts +0 -0
  10. package/out/ontologies/skos.d.ts +0 -0
  11. package/out/ontologies/src.d.ts +0 -0
  12. package/out/ontologies/xsd.d.ts +0 -0
  13. package/out/rdf/class-repository.d.ts +0 -0
  14. package/out/rdf/concept-repository.d.ts +0 -0
  15. package/out/rdf/index.d.ts +0 -0
  16. package/out/rdf/individual-repository.d.ts +0 -0
  17. package/out/rdf/parsers/rdf-syntax.d.ts +0 -0
  18. package/out/rdf/parsers/sparql-syntax-parser.d.ts +0 -0
  19. package/out/rdf/parsers/syntax-parser.d.ts +0 -0
  20. package/out/rdf/parsers/trig-syntax-parser.d.ts +0 -0
  21. package/out/rdf/parsers/turtle-syntax-parser.d.ts +0 -0
  22. package/out/rdf/property-repository.d.ts +0 -0
  23. package/out/rdf/reasoners/owl-reasoner.d.ts +0 -0
  24. package/out/rdf/reasoners/rdfs-reasoner.d.ts +0 -0
  25. package/out/rdf/reasoners/reasoner.d.ts +0 -0
  26. package/out/rdf/reasoners/shacl-reasoner.d.ts +0 -0
  27. package/out/rdf/reasoners/skos-reasoner.d.ts +0 -0
  28. package/out/rdf/resource-repository.d.ts +31 -15
  29. package/out/rdf/shape-repository.d.ts +0 -0
  30. package/out/rdf/store.d.ts +0 -0
  31. package/out/rdf/uri.d.ts +0 -0
  32. package/out/rdf/vocabulary-repository.d.ts +0 -0
  33. package/package.json +66 -66
  34. package/out/index.js.map +0 -1
  35. package/out/ontologies/index.js +0 -44
  36. package/out/ontologies/index.js.map +0 -1
  37. package/out/ontologies/owl.js +0 -322
  38. package/out/ontologies/owl.js.map +0 -1
  39. package/out/ontologies/rdf.js +0 -102
  40. package/out/ontologies/rdf.js.map +0 -1
  41. package/out/ontologies/rdfa.js +0 -56
  42. package/out/ontologies/rdfa.js.map +0 -1
  43. package/out/ontologies/rdfs.js +0 -76
  44. package/out/ontologies/rdfs.js.map +0 -1
  45. package/out/ontologies/sh.js +0 -822
  46. package/out/ontologies/sh.js.map +0 -1
  47. package/out/ontologies/skos-xl.js +0 -40
  48. package/out/ontologies/skos-xl.js.map +0 -1
  49. package/out/ontologies/skos.js +0 -144
  50. package/out/ontologies/skos.js.map +0 -1
  51. package/out/ontologies/src.js +0 -3016
  52. package/out/ontologies/src.js.map +0 -1
  53. package/out/ontologies/xsd.js +0 -108
  54. package/out/ontologies/xsd.js.map +0 -1
  55. package/out/rdf/class-repository.js +0 -324
  56. package/out/rdf/class-repository.js.map +0 -1
  57. package/out/rdf/concept-repository.js +0 -220
  58. package/out/rdf/concept-repository.js.map +0 -1
  59. package/out/rdf/index.js +0 -18
  60. package/out/rdf/index.js.map +0 -1
  61. package/out/rdf/individual-repository.js +0 -77
  62. package/out/rdf/individual-repository.js.map +0 -1
  63. package/out/rdf/parsers/rdf-syntax.js +0 -19
  64. package/out/rdf/parsers/rdf-syntax.js.map +0 -1
  65. package/out/rdf/parsers/sparql-syntax-parser.js +0 -61
  66. package/out/rdf/parsers/sparql-syntax-parser.js.map +0 -1
  67. package/out/rdf/parsers/syntax-parser.js +0 -3
  68. package/out/rdf/parsers/syntax-parser.js.map +0 -1
  69. package/out/rdf/parsers/trig-syntax-parser.js +0 -30
  70. package/out/rdf/parsers/trig-syntax-parser.js.map +0 -1
  71. package/out/rdf/parsers/turtle-syntax-parser.js +0 -30
  72. package/out/rdf/parsers/turtle-syntax-parser.js.map +0 -1
  73. package/out/rdf/property-repository.js +0 -257
  74. package/out/rdf/property-repository.js.map +0 -1
  75. package/out/rdf/reasoners/owl-reasoner.js +0 -218
  76. package/out/rdf/reasoners/owl-reasoner.js.map +0 -1
  77. package/out/rdf/reasoners/rdfs-reasoner.js +0 -144
  78. package/out/rdf/reasoners/rdfs-reasoner.js.map +0 -1
  79. package/out/rdf/reasoners/reasoner.js +0 -106
  80. package/out/rdf/reasoners/reasoner.js.map +0 -1
  81. package/out/rdf/reasoners/shacl-reasoner.js +0 -170
  82. package/out/rdf/reasoners/shacl-reasoner.js.map +0 -1
  83. package/out/rdf/reasoners/skos-reasoner.js +0 -109
  84. package/out/rdf/reasoners/skos-reasoner.js.map +0 -1
  85. package/out/rdf/resource-repository.js +0 -136
  86. package/out/rdf/resource-repository.js.map +0 -1
  87. package/out/rdf/shape-repository.js +0 -298
  88. package/out/rdf/shape-repository.js.map +0 -1
  89. package/out/rdf/store.js +0 -240
  90. package/out/rdf/store.js.map +0 -1
  91. package/out/rdf/tests/helpers.d.ts +0 -39
  92. package/out/rdf/tests/helpers.js +0 -85
  93. package/out/rdf/tests/helpers.js.map +0 -1
  94. package/out/rdf/tests/vocabularies/bfo.d.ts +0 -413
  95. package/out/rdf/tests/vocabularies/bfo.js +0 -418
  96. package/out/rdf/tests/vocabularies/bfo.js.map +0 -1
  97. package/out/rdf/tests/vocabularies/cidoc-crm.d.ts +0 -2101
  98. package/out/rdf/tests/vocabularies/cidoc-crm.js +0 -2106
  99. package/out/rdf/tests/vocabularies/cidoc-crm.js.map +0 -1
  100. package/out/rdf/tests/vocabularies/emmo.d.ts +0 -5525
  101. package/out/rdf/tests/vocabularies/emmo.js +0 -5530
  102. package/out/rdf/tests/vocabularies/emmo.js.map +0 -1
  103. package/out/rdf/tests/vocabularies/fibo-agents.d.ts +0 -17
  104. package/out/rdf/tests/vocabularies/fibo-agents.js +0 -22
  105. package/out/rdf/tests/vocabularies/fibo-agents.js.map +0 -1
  106. package/out/rdf/tests/vocabularies/fibo-organization.d.ts +0 -69
  107. package/out/rdf/tests/vocabularies/fibo-organization.js +0 -74
  108. package/out/rdf/tests/vocabularies/fibo-organization.js.map +0 -1
  109. package/out/rdf/tests/vocabularies/gist.d.ts +0 -1071
  110. package/out/rdf/tests/vocabularies/gist.js +0 -1076
  111. package/out/rdf/tests/vocabularies/gist.js.map +0 -1
  112. package/out/rdf/tests/vocabularies/index.d.ts +0 -17
  113. package/out/rdf/tests/vocabularies/index.js +0 -90
  114. package/out/rdf/tests/vocabularies/index.js.map +0 -1
  115. package/out/rdf/tests/vocabularies/lob.d.ts +0 -5669
  116. package/out/rdf/tests/vocabularies/lob.js +0 -5674
  117. package/out/rdf/tests/vocabularies/lob.js.map +0 -1
  118. package/out/rdf/tests/vocabularies/multi.d.ts +0 -29
  119. package/out/rdf/tests/vocabularies/multi.js +0 -34
  120. package/out/rdf/tests/vocabularies/multi.js.map +0 -1
  121. package/out/rdf/tests/vocabularies/org.d.ts +0 -193
  122. package/out/rdf/tests/vocabularies/org.js +0 -198
  123. package/out/rdf/tests/vocabularies/org.js.map +0 -1
  124. package/out/rdf/tests/vocabularies/owl.d.ts +0 -317
  125. package/out/rdf/tests/vocabularies/owl.js +0 -322
  126. package/out/rdf/tests/vocabularies/owl.js.map +0 -1
  127. package/out/rdf/tests/vocabularies/prov-o.d.ts +0 -391
  128. package/out/rdf/tests/vocabularies/prov-o.js +0 -396
  129. package/out/rdf/tests/vocabularies/prov-o.js.map +0 -1
  130. package/out/rdf/tests/vocabularies/schema-nq.d.ts +0 -12079
  131. package/out/rdf/tests/vocabularies/schema-nq.js +0 -12084
  132. package/out/rdf/tests/vocabularies/schema-nq.js.map +0 -1
  133. package/out/rdf/tests/vocabularies/schema-nt.d.ts +0 -12079
  134. package/out/rdf/tests/vocabularies/schema-nt.js +0 -12084
  135. package/out/rdf/tests/vocabularies/schema-nt.js.map +0 -1
  136. package/out/rdf/tests/vocabularies/schema.d.ts +0 -12079
  137. package/out/rdf/tests/vocabularies/schema.js +0 -12084
  138. package/out/rdf/tests/vocabularies/schema.js.map +0 -1
  139. package/out/rdf/tests/vocabularies/shapes.d.ts +0 -53
  140. package/out/rdf/tests/vocabularies/shapes.js +0 -58
  141. package/out/rdf/tests/vocabularies/shapes.js.map +0 -1
  142. package/out/rdf/tests/vocabularies/skos.d.ts +0 -139
  143. package/out/rdf/tests/vocabularies/skos.js +0 -144
  144. package/out/rdf/tests/vocabularies/skos.js.map +0 -1
  145. package/out/rdf/tests/vocabularies/unesco.d.ts +0 -10517
  146. package/out/rdf/tests/vocabularies/unesco.js +0 -10522
  147. package/out/rdf/tests/vocabularies/unesco.js.map +0 -1
  148. package/out/rdf/uri.js +0 -84
  149. package/out/rdf/uri.js.map +0 -1
  150. package/out/rdf/vocabulary-generator.d.ts +0 -86
  151. package/out/rdf/vocabulary-generator.js +0 -294
  152. package/out/rdf/vocabulary-generator.js.map +0 -1
  153. package/out/rdf/vocabulary-repository.js +0 -121
  154. package/out/rdf/vocabulary-repository.js.map +0 -1
@@ -1,257 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PropertyRepository = void 0;
4
- const tslib_1 = require("tslib");
5
- const n3 = tslib_1.__importStar(require("n3"));
6
- const ontologies_1 = require("../ontologies");
7
- const class_repository_1 = require("./class-repository");
8
- /**
9
- * A repository for retrieving properties from graphs.
10
- */
11
- class PropertyRepository extends class_repository_1.ClassRepository {
12
- constructor(store) {
13
- super(store);
14
- /**
15
- * The predicate used to indicate the domain of a property.
16
- */
17
- this.domainPredicate = ontologies_1.rdfs.domain;
18
- /**
19
- * The predicate used to indicate the range of a property.
20
- */
21
- this.rangePredicate = ontologies_1.rdfs.range;
22
- }
23
- /**
24
- * Get all properties in the repository.
25
- * @param options Optional options for retrieving properties.
26
- * @returns A list of all properties in the repository.
27
- */
28
- getProperties(graphUris, options) {
29
- const result = new Set();
30
- for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.rdf.Property, options === null || options === void 0 ? void 0 : options.includeInferred)) {
31
- if (this.skip(graphUris, q.subject, options)) {
32
- continue;
33
- }
34
- result.add(q.subject.value);
35
- }
36
- return Array.from(result);
37
- }
38
- /**
39
- * Get properties of a given type.
40
- * @param typeUri URI of a property type.
41
- * @param includeInferred Indicate if properties of a more specific type should be included in the result.
42
- * @returns A list of properties of the given type.
43
- */
44
- getRootPropertiesOfType(graphUris, typeUri, options) {
45
- const result = new Set();
46
- const type = new n3.NamedNode(typeUri);
47
- for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, type, options === null || options === void 0 ? void 0 : options.includeInferred)) {
48
- if (this.skip(graphUris, q.subject, options)) {
49
- continue;
50
- }
51
- let hasSuperProperty = false;
52
- for (let q2 of this.store.match(graphUris, q.subject, ontologies_1.rdfs.subPropertyOf, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
53
- // Note: We have not skipped the property so it is relevant for our result. However, if we want
54
- // to include referenced properties, then we include the referenced super property instead of the
55
- // current one.
56
- if ((options === null || options === void 0 ? void 0 : options.includeReferenced) && !this.hasSubject(graphUris, q2.object.value)) {
57
- // We must assume that the referenced super property is of the same type as the given type or a super type of it.
58
- result.add(q2.object.value);
59
- }
60
- else if (this.skip(graphUris, q2.object, options)) {
61
- // If the super property is skipped, then we ignore it.
62
- continue;
63
- }
64
- hasSuperProperty = true;
65
- break;
66
- }
67
- if (hasSuperProperty) {
68
- continue;
69
- }
70
- if (typeUri === ontologies_1.RDF.Property && (options === null || options === void 0 ? void 0 : options.includeInferred) === false) {
71
- // In the case of rdf:Property, we do not want to include properties that have a more specific type.
72
- const t = Array.from(this.store.match(graphUris, q.subject, ontologies_1.rdf.type, null, options === null || options === void 0 ? void 0 : options.includeInferred)).map(q => q.object.value);
73
- if (new Set(t).size == 1) {
74
- result.add(q.subject.value);
75
- }
76
- }
77
- else {
78
- result.add(q.subject.value);
79
- }
80
- }
81
- return Array.from(result);
82
- }
83
- /**
84
- * Get the super properties of a given property.
85
- * @param subjectUri URI of a property.
86
- * @param options Optional options for retrieving properties.
87
- * @returns An array of super properties of the given property, an empty array if the property has no super properties.
88
- */
89
- getSuperProperties(graphUris, subjectUri, options) {
90
- const result = [];
91
- const s = n3.DataFactory.namedNode(subjectUri);
92
- for (let q of this.store.match(graphUris, s, ontologies_1.rdfs.subPropertyOf, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
93
- if (this.skip(graphUris, q.object, options)) {
94
- continue;
95
- }
96
- result.push(q.object.value);
97
- }
98
- return result;
99
- }
100
- /**
101
- * Recursively find the first path from a given property to a root property.
102
- * @param subjectUri URI of a property.
103
- * @param path The current property path.
104
- * @param backtrack Set of URIs that have already been visited.
105
- * @param options Optional options for retrieving properties.
106
- * @returns The first path that is found from the given property to a root class.
107
- */
108
- _getRootPropertyPath(graphUris, subjectUri, path, backtrack, options) {
109
- const superClasses = this.getSuperProperties(graphUris, subjectUri, options);
110
- for (let o of superClasses.filter(o => !backtrack.has(o))) {
111
- return this._getRootPropertyPath(graphUris, o, [...path, o], backtrack, options);
112
- }
113
- return path;
114
- }
115
- /**
116
- * Get the first discovered path from a given property to a root property.
117
- * @param subjectUri URI of a property.
118
- * @param options Optional options for retrieving properties.
119
- * @returns A string array containing the first path that is found from the given property to a root property.
120
- */
121
- getRootPropertiesPath(graphUris, subjectUri, options) {
122
- return this._getRootPropertyPath(graphUris, subjectUri, [], new Set(), options);
123
- }
124
- /**
125
- * Indicate if there are sub properties of a given property.
126
- * @param subjectUri URI of a property.
127
- * @param options Optional options for retrieving properties.
128
- * @returns true if the property has sub properties, false otherwise.
129
- */
130
- hasSubProperties(graphUris, subjectUri, options) {
131
- const o = n3.DataFactory.namedNode(subjectUri);
132
- for (let q of this.store.match(graphUris, null, ontologies_1.rdfs.subPropertyOf, o, options === null || options === void 0 ? void 0 : options.includeInferred)) {
133
- if (!this.skip(graphUris, q.subject, options)) {
134
- return true;
135
- }
136
- }
137
- return false;
138
- }
139
- /**
140
- * Get the sub properties of a given property or all root properties.
141
- * @param subjectUri URI of a property or undefined to get all root properties.
142
- * @param options Optional options for retrieving properties.
143
- * @returns An array of sub properties of the given property, an empty array if the property has no sub properties.
144
- */
145
- getSubProperties(graphUris, subjectUri, options) {
146
- if (subjectUri) {
147
- const result = new Set();
148
- const o = n3.DataFactory.namedNode(subjectUri);
149
- for (let q of this.store.match(graphUris, null, ontologies_1.rdfs.subPropertyOf, o, options === null || options === void 0 ? void 0 : options.includeInferred)) {
150
- if (this.skip(graphUris, q.subject, options)) {
151
- continue;
152
- }
153
- result.add(q.subject.value);
154
- }
155
- return Array.from(result);
156
- }
157
- else {
158
- return this.getRootProperties(graphUris, options);
159
- }
160
- }
161
- /**
162
- * Get all properties from the repository that have no super properties.
163
- * @param options Optional options for retrieving properties.
164
- * @returns An array of root properties in the repository.
165
- */
166
- getRootProperties(graphUris, options) {
167
- var _a;
168
- const result = new Set();
169
- const properties = new Set(this.getProperties(graphUris, options));
170
- for (let p of properties) {
171
- let hasSuperProperty = false;
172
- for (let q of this.store.match(graphUris, new n3.NamedNode(p), ontologies_1.rdfs.subPropertyOf, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
173
- const includeReferenced = (_a = options === null || options === void 0 ? void 0 : options.includeReferenced) !== null && _a !== void 0 ? _a : false;
174
- const skip = this.skip(graphUris, q.object, options);
175
- // Do not skip the super property if it is only referenced and the includeReferenced option is set.
176
- if (q.object.termType != "NamedNode" || skip && (!includeReferenced || includeReferenced && this.hasSubject(graphUris, q.object.value))) {
177
- continue;
178
- }
179
- hasSuperProperty = true;
180
- // If we have a super property that is not in the list of properties and not excluded by the options, we add it to the result.
181
- if (!properties.has(q.object.value)) {
182
- result.add(q.object.value);
183
- }
184
- break;
185
- }
186
- if (!hasSuperProperty) {
187
- result.add(p);
188
- }
189
- }
190
- return Array.from(result);
191
- }
192
- /**
193
- * Indicate if there is an equivalent property of a given property.
194
- * @param propertyUri URI of a property.
195
- * @returns true if the property has an equivalent property, false otherwise.
196
- */
197
- hasEquivalentProperty(graphUris, propertyUri) {
198
- const s = n3.DataFactory.namedNode(propertyUri);
199
- // The OWL resoner will assert the equivalent class relationship in both directions.
200
- for (let _ of this.store.match(graphUris, s, ontologies_1.owl.equivalentProperty, null)) {
201
- return true;
202
- }
203
- return false;
204
- }
205
- /**
206
- * Get the domain of a given property.
207
- * @param propertyUri URI of a property.
208
- * @returns The URI of the domain of the given property. If no domain is specified, rdfs:Resource is returned.
209
- */
210
- getDomain(graphUris, propertyUri) {
211
- const s = n3.DataFactory.namedNode(propertyUri);
212
- for (let q of this.store.match(graphUris, s, this.domainPredicate, null)) {
213
- return q.object.value;
214
- }
215
- return ontologies_1.rdfs.Resource.value;
216
- }
217
- /**
218
- * Get the range of a given property.
219
- * @param propertyUri URI of a property.
220
- * @returns The URI of the range of the given property. If no range is specified, `undefined` is returned.
221
- */
222
- getRange(graphUris, propertyUri) {
223
- const s = n3.DataFactory.namedNode(propertyUri);
224
- for (let q of this.store.match(graphUris, s, this.rangePredicate, null)) {
225
- return q.object.value;
226
- }
227
- return undefined;
228
- }
229
- /**
230
- * Get all asserted and inferred property types.
231
- * @param graphUris The URI of the graph or an array of graphs to search for property types.
232
- * @param options Optional options for retrieving properties.
233
- * @returns A list of all property types in the repository.
234
- */
235
- getPropertyTypes(graphUris, options) {
236
- const result = new Set();
237
- const properties = this.getProperties(graphUris, options).map(p => new n3.NamedNode(p));
238
- for (let p of properties) {
239
- const types = new Set(Array.from(this.store.match(graphUris, p, ontologies_1.rdf.type, null, false)).map(t => t.object.value));
240
- if (types.size > 0) {
241
- for (let t of types) {
242
- // Do not assert rdf:Property for properties that have multiple types.
243
- if (t !== ontologies_1.RDF.Property || types.size == 1) {
244
- result.add(t);
245
- }
246
- }
247
- }
248
- else {
249
- // If there are no asserted types, we need to infer rdf:Property.
250
- result.add(ontologies_1.RDF.Property);
251
- }
252
- }
253
- return Array.from(result);
254
- }
255
- }
256
- exports.PropertyRepository = PropertyRepository;
257
- //# sourceMappingURL=property-repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"property-repository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AI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAE1H,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBACjB,KAAK,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;oBAClB,sEAAsE;oBACtE,IAAI,CAAC,KAAK,gBAAG,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC;wBACxC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBAClB,CAAC;gBACL,CAAC;YACL,CAAC;iBAAM,CAAC;gBACJ,iEAAiE;gBACjE,MAAM,CAAC,GAAG,CAAC,gBAAG,CAAC,QAAQ,CAAC,CAAC;YAC7B,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACJ;AAlSD,gDAkSC"}
@@ -1,218 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OwlReasoner = void 0;
4
- const ontologies_1 = require("../../ontologies");
5
- const shacl_reasoner_1 = require("./shacl-reasoner");
6
- /**
7
- * A simple OWL reasoner that expands the graph with inferred triples.
8
- */
9
- class OwlReasoner extends shacl_reasoner_1.ShaclReasoner {
10
- constructor() {
11
- super();
12
- this.restrictions = {};
13
- }
14
- afterInference() {
15
- super.afterInference();
16
- for (let r of Object.values(this.restrictions)) {
17
- const p = r.onProperty;
18
- if (!p)
19
- continue;
20
- if (r.onDataRange) {
21
- this.store.addQuad(p, ontologies_1.rdf.type, ontologies_1.owl.DatatypeProperty, this.targetGraph);
22
- this.store.addQuad(p, ontologies_1.rdfs.range, r.onDataRange, this.targetGraph);
23
- }
24
- else if (r.onClass) {
25
- this.store.addQuad(p, ontologies_1.rdf.type, ontologies_1.owl.ObjectProperty, this.targetGraph);
26
- this.store.addQuad(p, ontologies_1.rdfs.range, r.onClass, this.targetGraph);
27
- }
28
- else if (r.allValuesFrom) {
29
- this.store.addQuad(p, ontologies_1.rdf.type, ontologies_1.owl.ObjectProperty, this.targetGraph);
30
- }
31
- else if (r.someValuesFrom) {
32
- this.store.addQuad(p, ontologies_1.rdf.type, ontologies_1.owl.ObjectProperty, this.targetGraph);
33
- }
34
- }
35
- this.restrictions = {};
36
- }
37
- inferClassAxioms(quad) {
38
- super.inferClassAxioms(quad);
39
- let s = quad.subject;
40
- let p = quad.predicate;
41
- let o = quad.object.termType != "Literal" ? quad.object : undefined;
42
- if (!o) {
43
- return;
44
- }
45
- // See: https://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules
46
- switch (p.id) {
47
- case ontologies_1.rdf.type.id: {
48
- if (o.id == ontologies_1.owl.Restriction.id) {
49
- this.restrictions[s.value] = {};
50
- }
51
- return;
52
- }
53
- case ontologies_1.owl.equivalentClass.id: {
54
- this.assertClass(s);
55
- if (o && !this.isW3CNode(o)) {
56
- this.assertClass(o);
57
- }
58
- // The opposite is also true.
59
- if (o.termType == "NamedNode") {
60
- this.store.addQuad(o, ontologies_1.owl.equivalentClass, s, this.targetGraph);
61
- }
62
- return;
63
- }
64
- case ontologies_1.owl.complementOf.id:
65
- case ontologies_1.owl.disjointWith.id: {
66
- this.assertClass(s);
67
- if (o && !this.isW3CNode(o)) {
68
- this.assertClass(o);
69
- }
70
- return;
71
- }
72
- case ontologies_1.owl.intersectionOf.id: {
73
- let equivalentSubjects = [...this.store.match(null, ontologies_1.owl.equivalentClass, s)]
74
- .map(q => q.subject)
75
- .filter(q => q.termType == "NamedNode");
76
- // Rule #scm-int
77
- let classes = this.getListItems(o.value);
78
- if (!Array.isArray(classes)) {
79
- this.errors.push({ quad: quad, message: `Expected an array of classes for ${o.value}` });
80
- return;
81
- }
82
- for (let c of classes) {
83
- if (c.termType != "NamedNode") {
84
- continue;
85
- }
86
- this.store.addQuad(s, ontologies_1.rdfs.subClassOf, c, this.targetGraph);
87
- for (let es of equivalentSubjects) {
88
- this.store.addQuad(es, ontologies_1.rdfs.subClassOf, c, this.targetGraph);
89
- }
90
- }
91
- return;
92
- }
93
- case ontologies_1.owl.unionOf.id: {
94
- let equivalentSubjects = [...this.store.match(null, ontologies_1.owl.equivalentClass, s)]
95
- .map(q => q.subject)
96
- .filter(q => q.termType == "NamedNode");
97
- // Rule #scm-uni
98
- let classes = this.getListItems(o.value);
99
- if (!Array.isArray(classes)) {
100
- this.errors.push({ quad: quad, message: `Expected an array of classes for ${o.value}` });
101
- return;
102
- }
103
- for (let c of classes) {
104
- if (c.termType != "NamedNode") {
105
- continue;
106
- }
107
- this.store.addQuad(c, ontologies_1.rdfs.subClassOf, s, this.targetGraph);
108
- for (let es of equivalentSubjects) {
109
- this.store.addQuad(c, ontologies_1.rdfs.subClassOf, es, this.targetGraph);
110
- }
111
- }
112
- return;
113
- }
114
- case ontologies_1.owl.onClass.id: {
115
- if (o.termType == "NamedNode") {
116
- this.assertClass(o);
117
- }
118
- return;
119
- }
120
- case ontologies_1.owl.onDataRange.id: {
121
- if (o.termType == "NamedNode") {
122
- this.store.addQuad(o, ontologies_1.rdf.type, ontologies_1.rdfs.Datatype, this.targetGraph);
123
- }
124
- return;
125
- }
126
- // Note:
127
- // e.g. Gist also uses these on xsd:string, so inferring that this is a
128
- // class is technically true, however, it would lead to undesirable results.
129
- //
130
- // case owl.allValuesFrom.id: {
131
- // if (o.termType == "NamedNode") {
132
- // this.store.addQuad(o, rdf.type, rdfs.Class, this.targetGraph);
133
- // }
134
- //
135
- // return;
136
- // }
137
- // case owl.someValuesFrom.id: {
138
- // if (o.termType == "NamedNode") {
139
- // this.store.addQuad(o, rdf.type, rdfs.Class, this.targetGraph);
140
- // }
141
- //
142
- // break;
143
- // }
144
- }
145
- }
146
- inferPropertyAxioms(quad) {
147
- super.inferPropertyAxioms(quad);
148
- let s = quad.subject;
149
- let p = quad.predicate;
150
- let o = quad.object.termType != "Literal" ? quad.object : undefined;
151
- if (!o) {
152
- return;
153
- }
154
- switch (p.id) {
155
- case ontologies_1.owl.onProperty.id: {
156
- this.assertProperty(o);
157
- if (this.restrictions[s.value] && o.termType == "NamedNode") {
158
- this.restrictions[s.value].onProperty = o;
159
- }
160
- return;
161
- }
162
- case ontologies_1.owl.onClass.id: {
163
- if (this.restrictions[s.value] && o.termType == "NamedNode") {
164
- this.restrictions[s.value].onClass = o;
165
- }
166
- return;
167
- }
168
- case ontologies_1.owl.onDataRange.id: {
169
- if (this.restrictions[s.value] && o.termType == "NamedNode") {
170
- this.restrictions[s.value].onDataRange = o;
171
- }
172
- return;
173
- }
174
- case ontologies_1.owl.allValuesFrom.id: {
175
- if (this.restrictions[s.value]) {
176
- this.restrictions[s.value].allValuesFrom = o;
177
- }
178
- return;
179
- }
180
- case ontologies_1.owl.someValuesFrom.id: {
181
- if (this.restrictions[s.value]) {
182
- this.restrictions[s.value].someValuesFrom = o;
183
- }
184
- return;
185
- }
186
- case ontologies_1.owl.equivalentProperty.id: {
187
- this.assertProperty(s);
188
- this.assertProperty(o);
189
- // The opposite is also true.
190
- if (o.termType == "NamedNode") {
191
- this.store.addQuad(o, ontologies_1.owl.equivalentProperty, s, this.targetGraph);
192
- }
193
- return;
194
- }
195
- case ontologies_1.rdf.type.id: {
196
- switch (o.id) {
197
- case ontologies_1.owl.AnnotationProperty.id:
198
- case ontologies_1.owl.AsymmetricProperty.id:
199
- case ontologies_1.owl.DatatypeProperty.id:
200
- case ontologies_1.owl.DeprecatedProperty.id:
201
- case ontologies_1.owl.FunctionalProperty.id:
202
- case ontologies_1.owl.InverseFunctionalProperty.id:
203
- case ontologies_1.owl.IrreflexiveProperty.id:
204
- case ontologies_1.owl.ObjectProperty.id:
205
- case ontologies_1.owl.OntologyProperty.id:
206
- case ontologies_1.owl.ReflexiveProperty.id:
207
- case ontologies_1.owl.SymmetricProperty.id:
208
- case ontologies_1.owl.TransitiveProperty.id: {
209
- this.assertProperty(s);
210
- }
211
- }
212
- return;
213
- }
214
- }
215
- }
216
- }
217
- exports.OwlReasoner = OwlReasoner;
218
- //# sourceMappingURL=owl-reasoner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"owl-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/owl-reasoner.ts"],"names":[],"mappings":";;;AACA,iDAAkD;AAClD,qDAAiD;AAiBjD;;GAEG;AACH,MAAa,WAAY,SAAQ,8BAAa;IAG1C;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;IAES,cAAc;QACpB,KAAK,CAAC,cAAc,EAAE,CAAC;QAEvB,KAAK,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YAC7C,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC;YAEvB,IAAI,CAAC,CAAC;gBAAE,SAAS;YAEjB,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;gBAChB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,gBAAG,CAAC,IAAI,EAAE,gBAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;gBACxE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,iBAAI,CAAC,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YACvE,CAAC;iBAAM,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,gBAAG,CAAC,IAAI,EAAE,gBAAG,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;gBACtE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,iBAAI,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC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,CAAC,kBAAkB,CAAC,EAAE,CAAC;oBAC/B,KAAK,gBAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;oBAC/B,KAAK,gBAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;oBAC7B,KAAK,gBAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;oBAC/B,KAAK,gBAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;oBAC/B,KAAK,gBAAG,CAAC,yBAAyB,CAAC,EAAE,CAAC;oBACtC,KAAK,gBAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;oBAChC,KAAK,gBAAG,CAAC,cAAc,CAAC,EAAE,CAAC;oBAC3B,KAAK,gBAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;oBAC7B,KAAK,gBAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBAC9B,KAAK,gBAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBAC9B,KAAK,gBAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC;wBAC7B,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;oBAC3B,CAAC;gBACL,CAAC;gBAED,OAAO;YACX,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AAxPD,kCAwPC"}
@@ -1,144 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RdfsReasoner = void 0;
4
- const ontologies_1 = require("../../ontologies");
5
- const skos_reasoner_1 = require("./skos-reasoner");
6
- /**
7
- * A simple RDFS reasoner that expands the graph with inferred triples.
8
- */
9
- class RdfsReasoner extends skos_reasoner_1.SkosReasoner {
10
- constructor() {
11
- super(...arguments);
12
- this.ontologies = new Set();
13
- this.classes = new Set();
14
- this.properties = new Set();
15
- this.invididuals = new Set();
16
- }
17
- isIgnoredNode(term) {
18
- switch (term.id) {
19
- case ontologies_1.skos.Concept.id:
20
- case ontologies_1.skos.ConceptScheme.id:
21
- case ontologies_1.skos.Collection.id:
22
- case ontologies_1.skos.OrderedCollection.id:
23
- case ontologies_1.sh.Shape.id:
24
- case ontologies_1.sh.NodeShape.id:
25
- case ontologies_1.sh.PropertyShape.id:
26
- return true;
27
- default:
28
- return false;
29
- }
30
- }
31
- isClass(id) {
32
- return super.isClass(id) ||
33
- this.classes.has(id) ||
34
- this.properties.has(id) ||
35
- this.ontologies.has(id);
36
- }
37
- afterInference() {
38
- super.afterInference();
39
- // After all axioms have been inferred, add the inferred individuals to the graph.
40
- const individuals = [...this.invididuals].filter(x => !this.isClass(x.id));
41
- for (let individual of individuals) {
42
- this.store.addQuad(individual, ontologies_1.rdf.type, ontologies_1.owl.NamedIndividual, this.targetGraph);
43
- }
44
- }
45
- applyInference(quad) {
46
- super.applyInference(quad);
47
- // Treat all named nodes with rdf:type definitions as potential individuals.
48
- if (quad.subject.termType == "NamedNode" && quad.predicate.equals(ontologies_1.rdf.type)) {
49
- // Only consider individuals that are not of a type that is ignored such as skos:Concept.
50
- if (!this.isIgnoredNode(quad.object)) {
51
- this.invididuals.add(quad.subject);
52
- }
53
- if (quad.object.id == ontologies_1.owl.Ontology.id) {
54
- this.ontologies.add(quad.subject.id);
55
- }
56
- }
57
- this.inferClassAxioms(quad);
58
- this.inferPropertyAxioms(quad);
59
- }
60
- assertClass(subject) {
61
- this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
62
- this.classes.add(subject.id);
63
- }
64
- inferClassAxioms(quad) {
65
- let s = quad.subject;
66
- let p = quad.predicate;
67
- let o = quad.object.termType != "Literal" ? quad.object : undefined;
68
- if (!o) {
69
- return;
70
- }
71
- switch (p.id) {
72
- case ontologies_1.rdf.type.id: {
73
- if (o.equals(ontologies_1.rdfs.Class)) {
74
- // No need to infer the class type, as it is already asserted.
75
- this.classes.add(s.id);
76
- }
77
- else if (o.equals(ontologies_1.owl.Class)) {
78
- this.assertClass(s);
79
- }
80
- else if (!this.isW3CNode(o)) {
81
- this.assertClass(o);
82
- }
83
- return;
84
- }
85
- case ontologies_1.rdfs.subClassOf.id: {
86
- this.assertClass(s);
87
- if (!this.isW3CNode(o)) {
88
- this.assertClass(o);
89
- }
90
- else if (o.equals(ontologies_1.rdfs.Resource)) {
91
- this.store.addQuad(ontologies_1.rdfs.Resource, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
92
- }
93
- else if (o.equals(ontologies_1.rdfs.Class)) {
94
- this.store.addQuad(ontologies_1.rdfs.Class, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
95
- this.store.addQuad(ontologies_1.rdfs.Class, ontologies_1.rdfs.subClassOf, ontologies_1.rdfs.Resource, this.targetGraph);
96
- }
97
- else if (o.equals(ontologies_1.rdfs.Datatype)) {
98
- this.store.addQuad(ontologies_1.rdfs.Datatype, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
99
- this.store.addQuad(ontologies_1.rdfs.Datatype, ontologies_1.rdfs.subClassOf, ontologies_1.rdfs.Class, this.targetGraph);
100
- }
101
- else if (o.equals(ontologies_1.owl.Class)) {
102
- this.store.addQuad(ontologies_1.owl.Class, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
103
- this.store.addQuad(ontologies_1.owl.Class, ontologies_1.rdfs.subClassOf, ontologies_1.rdfs.Class, this.targetGraph);
104
- }
105
- return;
106
- }
107
- case ontologies_1.rdfs.range.id:
108
- case ontologies_1.rdfs.domain.id: {
109
- if (!this.isW3CNode(o)) {
110
- this.assertClass(o);
111
- }
112
- return;
113
- }
114
- }
115
- }
116
- assertProperty(subject) {
117
- this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.rdf.Property, this.targetGraph);
118
- this.properties.add(subject.id);
119
- }
120
- inferPropertyAxioms(quad) {
121
- let s = quad.subject;
122
- let p = quad.predicate;
123
- let o = quad.object.termType != "Literal" ? quad.object : undefined;
124
- if (!o) {
125
- return;
126
- }
127
- switch (p.id) {
128
- case ontologies_1.rdf.type.id: {
129
- if (o.equals(ontologies_1.rdf.Property)) {
130
- // No need to infer the property type, as it is already asserted.
131
- this.properties.add(s.id);
132
- }
133
- return;
134
- }
135
- case ontologies_1.rdfs.range.id:
136
- case ontologies_1.rdfs.domain.id: {
137
- this.assertProperty(s);
138
- return;
139
- }
140
- }
141
- }
142
- }
143
- exports.RdfsReasoner = RdfsReasoner;
144
- //# sourceMappingURL=rdfs-reasoner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rdfs-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/rdfs-reasoner.ts"],"names":[],"mappings":";;;AACA,iDAA4D;AAC5D,mDAA+C;AAE/C;;GAEG;AACH,MAAa,YAAa,SAAQ,4BAAY;IAA9C;;QACc,eAAU,GAAgB,IAAI,GAAG,EAAE,CAAC;QAEpC,YAAO,GAAgB,IAAI,GAAG,EAAE,CAAC;QAEjC,eAAU,GAAgB,IAAI,GAAG,EAAE,CAAC;QAEpC,gBAAW,GAAiB,IAAI,GAAG,EAAE,CAAC;IA8IpD,CAAC;IA5Ia,aAAa,CAAC,IAAa;QACjC,QAAQ,IAAI,CAAC,EAAE,EAAE,CAAC;YACd,KAAK,iBAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACrB,KAAK,iBAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC3B,KAAK,iBAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACxB,KAAK,iBAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC/B,KAAK,eAAE,CAAC,KAAK,CAAC,EAAE,CAAC;YACjB,KAAK,eAAE,CAAC,SAAS,CAAC,EAAE,CAAC;YACrB,KAAK,eAAE,CAAC,aAAa,CAAC,EAAE;gBACpB,OAAO,IAAI,CAAC;YAChB;gBACI,OAAO,KAAK,CAAC;QACrB,CAAC;IACL,CAAC;IAES,OAAO,CAAC,EAAU;QACxB,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,GAAG,C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