@faubulous/mentor-rdf 0.2.38 → 0.2.39
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/out/ontologies/index.d.ts +8 -7
- package/out/ontologies/index.js +23 -4
- package/out/ontologies/index.js.map +1 -1
- package/out/ontologies/owl.d.ts +4 -0
- package/out/ontologies/owl.js +5 -1
- package/out/ontologies/owl.js.map +1 -1
- package/out/ontologies/rdf.d.ts +4 -0
- package/out/ontologies/rdf.js +5 -1
- package/out/ontologies/rdf.js.map +1 -1
- package/out/ontologies/rdfa.d.ts +4 -0
- package/out/ontologies/rdfa.js +5 -1
- package/out/ontologies/rdfa.js.map +1 -1
- package/out/ontologies/rdfs.d.ts +4 -0
- package/out/ontologies/rdfs.js +5 -1
- package/out/ontologies/rdfs.js.map +1 -1
- package/out/ontologies/sh.d.ts +815 -0
- package/out/ontologies/sh.js +820 -0
- package/out/ontologies/sh.js.map +1 -0
- package/out/ontologies/shacl.d.ts +78 -76
- package/out/ontologies/shacl.js +79 -77
- package/out/ontologies/shacl.js.map +1 -1
- package/out/ontologies/skos-xl.d.ts +35 -0
- package/out/ontologies/skos-xl.js +40 -0
- package/out/ontologies/skos-xl.js.map +1 -0
- package/out/ontologies/skos.d.ts +4 -0
- package/out/ontologies/skos.js +5 -1
- package/out/ontologies/skos.js.map +1 -1
- package/out/ontologies/skos_xl.d.ts +33 -0
- package/out/ontologies/skos_xl.js +38 -0
- package/out/ontologies/skos_xl.js.map +1 -0
- package/out/ontologies/src.d.ts +2 -1
- package/out/ontologies/src.js +72 -2
- package/out/ontologies/src.js.map +1 -1
- package/out/ontologies/xsd.d.ts +4 -0
- package/out/ontologies/xsd.js +5 -1
- package/out/ontologies/xsd.js.map +1 -1
- package/out/rdf/class-repository.d.ts +38 -4
- package/out/rdf/class-repository.js +89 -4
- package/out/rdf/class-repository.js.map +1 -1
- package/out/rdf/property-repository.d.ts +2 -2
- package/out/rdf/property-repository.js +2 -2
- package/out/rdf/property-repository.js.map +1 -1
- package/out/rdf/reasoners/rdfs-reasoner.js +3 -3
- package/out/rdf/reasoners/rdfs-reasoner.js.map +1 -1
- package/out/rdf/reasoners/shacl-reasoner.d.ts +1 -0
- package/out/rdf/reasoners/shacl-reasoner.js +49 -33
- package/out/rdf/reasoners/shacl-reasoner.js.map +1 -1
- package/out/rdf/resource-repository.d.ts +8 -4
- package/out/rdf/resource-repository.js +11 -3
- package/out/rdf/resource-repository.js.map +1 -1
- package/out/rdf/shape-repository.d.ts +42 -5
- package/out/rdf/shape-repository.js +173 -25
- package/out/rdf/shape-repository.js.map +1 -1
- package/out/rdf/store.d.ts +29 -0
- package/out/rdf/store.js +50 -8
- package/out/rdf/store.js.map +1 -1
- package/out/rdf/tests/vocabularies/bfo.d.ts +6 -2
- package/out/rdf/tests/vocabularies/bfo.js +7 -3
- package/out/rdf/tests/vocabularies/bfo.js.map +1 -1
- package/out/rdf/tests/vocabularies/cidoc-crm.d.ts +18 -14
- package/out/rdf/tests/vocabularies/cidoc-crm.js +19 -15
- package/out/rdf/tests/vocabularies/cidoc-crm.js.map +1 -1
- package/out/rdf/tests/vocabularies/cidoc_crm.d.ts +2099 -0
- package/out/rdf/tests/vocabularies/cidoc_crm.js +2104 -0
- package/out/rdf/tests/vocabularies/cidoc_crm.js.map +1 -0
- package/out/rdf/tests/vocabularies/emmo.d.ts +4 -0
- package/out/rdf/tests/vocabularies/emmo.js +5 -1
- package/out/rdf/tests/vocabularies/emmo.js.map +1 -1
- package/out/rdf/tests/vocabularies/fibo-agents.d.ts +4 -0
- package/out/rdf/tests/vocabularies/fibo-agents.js +5 -1
- package/out/rdf/tests/vocabularies/fibo-agents.js.map +1 -1
- package/out/rdf/tests/vocabularies/fibo-organization.d.ts +4 -0
- package/out/rdf/tests/vocabularies/fibo-organization.js +5 -1
- package/out/rdf/tests/vocabularies/fibo-organization.js.map +1 -1
- package/out/rdf/tests/vocabularies/fibo_agents.d.ts +15 -0
- package/out/rdf/tests/vocabularies/fibo_agents.js +20 -0
- package/out/rdf/tests/vocabularies/fibo_agents.js.map +1 -0
- package/out/rdf/tests/vocabularies/fibo_organization.d.ts +67 -0
- package/out/rdf/tests/vocabularies/fibo_organization.js +72 -0
- package/out/rdf/tests/vocabularies/fibo_organization.js.map +1 -0
- package/out/rdf/tests/vocabularies/gist.d.ts +4 -0
- package/out/rdf/tests/vocabularies/gist.js +5 -1
- package/out/rdf/tests/vocabularies/gist.js.map +1 -1
- package/out/rdf/tests/vocabularies/index.d.ts +17 -17
- package/out/rdf/tests/vocabularies/index.js +36 -1
- package/out/rdf/tests/vocabularies/index.js.map +1 -1
- package/out/rdf/tests/vocabularies/lob.d.ts +4 -0
- package/out/rdf/tests/vocabularies/lob.js +5 -1
- package/out/rdf/tests/vocabularies/lob.js.map +1 -1
- package/out/rdf/tests/vocabularies/multi.d.ts +4 -0
- package/out/rdf/tests/vocabularies/multi.js +5 -1
- package/out/rdf/tests/vocabularies/multi.js.map +1 -1
- package/out/rdf/tests/vocabularies/org.d.ts +4 -0
- package/out/rdf/tests/vocabularies/org.js +5 -1
- package/out/rdf/tests/vocabularies/org.js.map +1 -1
- package/out/rdf/tests/vocabularies/owl.d.ts +4 -0
- package/out/rdf/tests/vocabularies/owl.js +5 -1
- package/out/rdf/tests/vocabularies/owl.js.map +1 -1
- package/out/rdf/tests/vocabularies/prov-o.d.ts +4 -0
- package/out/rdf/tests/vocabularies/prov-o.js +5 -1
- package/out/rdf/tests/vocabularies/prov-o.js.map +1 -1
- package/out/rdf/tests/vocabularies/prov_o.d.ts +389 -0
- package/out/rdf/tests/vocabularies/prov_o.js +394 -0
- package/out/rdf/tests/vocabularies/prov_o.js.map +1 -0
- package/out/rdf/tests/vocabularies/schema-nq.d.ts +4 -0
- package/out/rdf/tests/vocabularies/schema-nq.js +5 -1
- package/out/rdf/tests/vocabularies/schema-nq.js.map +1 -1
- package/out/rdf/tests/vocabularies/schema-nt.d.ts +4 -0
- package/out/rdf/tests/vocabularies/schema-nt.js +5 -1
- package/out/rdf/tests/vocabularies/schema-nt.js.map +1 -1
- package/out/rdf/tests/vocabularies/schema.d.ts +4 -0
- package/out/rdf/tests/vocabularies/schema.js +5 -1
- package/out/rdf/tests/vocabularies/schema.js.map +1 -1
- package/out/rdf/tests/vocabularies/schema_nq.d.ts +12077 -0
- package/out/rdf/tests/vocabularies/schema_nq.js +12082 -0
- package/out/rdf/tests/vocabularies/schema_nq.js.map +1 -0
- package/out/rdf/tests/vocabularies/schema_nt.d.ts +12077 -0
- package/out/rdf/tests/vocabularies/schema_nt.js +12082 -0
- package/out/rdf/tests/vocabularies/schema_nt.js.map +1 -0
- package/out/rdf/tests/vocabularies/shapes.d.ts +34 -6
- package/out/rdf/tests/vocabularies/shapes.js +35 -7
- package/out/rdf/tests/vocabularies/shapes.js.map +1 -1
- package/out/rdf/tests/vocabularies/skos.d.ts +4 -0
- package/out/rdf/tests/vocabularies/skos.js +5 -1
- package/out/rdf/tests/vocabularies/skos.js.map +1 -1
- package/out/rdf/tests/vocabularies/unesco.d.ts +180 -176
- package/out/rdf/tests/vocabularies/unesco.js +181 -177
- package/out/rdf/tests/vocabularies/unesco.js.map +1 -1
- package/out/rdf/uri.d.ts +1 -1
- package/out/rdf/uri.js +5 -15
- package/out/rdf/uri.js.map +1 -1
- package/out/rdf/vocabulary-generator.d.ts +19 -0
- package/out/rdf/vocabulary-generator.js +50 -10
- package/out/rdf/vocabulary-generator.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,26 +24,39 @@ class ShaclReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
24
24
|
this.inferShapeAxioms(quad);
|
|
25
25
|
}
|
|
26
26
|
assertShape(subject, type) {
|
|
27
|
-
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.
|
|
27
|
+
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.sh.Shape, this.targetGraph);
|
|
28
28
|
if (type) {
|
|
29
29
|
this.store.addQuad(subject, ontologies_1.rdf.type, type, this.targetGraph);
|
|
30
30
|
}
|
|
31
31
|
this.shapes.add(subject.id);
|
|
32
32
|
}
|
|
33
33
|
assertValidator(subject) {
|
|
34
|
-
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.
|
|
34
|
+
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.sh.Validator, this.targetGraph);
|
|
35
35
|
this.validators.add(subject.id);
|
|
36
36
|
}
|
|
37
37
|
assertParameterizable(subject) {
|
|
38
|
-
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.
|
|
38
|
+
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.sh.Parameterizable, this.targetGraph);
|
|
39
39
|
this.parameterizables.add(subject.id);
|
|
40
40
|
}
|
|
41
41
|
isShapeType(subject) {
|
|
42
42
|
switch (subject.id) {
|
|
43
|
-
case ontologies_1.
|
|
44
|
-
case ontologies_1.
|
|
45
|
-
case ontologies_1.
|
|
46
|
-
case ontologies_1.
|
|
43
|
+
case ontologies_1.sh.Shape.id:
|
|
44
|
+
case ontologies_1.sh.NodeShape.id:
|
|
45
|
+
case ontologies_1.sh.PropertyShape.id:
|
|
46
|
+
case ontologies_1.sh.Parameter.id: {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
default: {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
isValidatorType(subject) {
|
|
55
|
+
switch (subject.id) {
|
|
56
|
+
case ontologies_1.sh.Validator.id:
|
|
57
|
+
case ontologies_1.sh.JSValidator.id:
|
|
58
|
+
case ontologies_1.sh.SPARQLAskValidator.id:
|
|
59
|
+
case ontologies_1.sh.SPARQLSelectValidator.id: {
|
|
47
60
|
return true;
|
|
48
61
|
}
|
|
49
62
|
default: {
|
|
@@ -53,14 +66,14 @@ class ShaclReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
53
66
|
}
|
|
54
67
|
isParameterizableType(subject) {
|
|
55
68
|
switch (subject.id) {
|
|
56
|
-
case ontologies_1.
|
|
57
|
-
case ontologies_1.
|
|
58
|
-
case ontologies_1.
|
|
59
|
-
case ontologies_1.
|
|
60
|
-
case ontologies_1.
|
|
61
|
-
case ontologies_1.
|
|
62
|
-
case ontologies_1.
|
|
63
|
-
case ontologies_1.
|
|
69
|
+
case ontologies_1.sh.Parameter.id:
|
|
70
|
+
case ontologies_1.sh.ConstraintComponent.id:
|
|
71
|
+
case ontologies_1.sh.Function.id:
|
|
72
|
+
case ontologies_1.sh.JSFunction.id:
|
|
73
|
+
case ontologies_1.sh.SPARQLFunction.id:
|
|
74
|
+
case ontologies_1.sh.TargetType.id:
|
|
75
|
+
case ontologies_1.sh.JSTargetType.id:
|
|
76
|
+
case ontologies_1.sh.SPARQLTargetType.id: {
|
|
64
77
|
return true;
|
|
65
78
|
}
|
|
66
79
|
default: {
|
|
@@ -77,53 +90,56 @@ class ShaclReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
77
90
|
}
|
|
78
91
|
switch (p.id) {
|
|
79
92
|
case ontologies_1.rdf.type.id: {
|
|
80
|
-
if (o.equals(ontologies_1.
|
|
93
|
+
if (o.equals(ontologies_1.sh.Shape)) {
|
|
81
94
|
// No need to infer the type, as it is already asserted.
|
|
82
95
|
this.shapes.add(s.id);
|
|
83
96
|
}
|
|
84
97
|
else if (this.isShapeType(o)) {
|
|
85
98
|
this.assertShape(s, o);
|
|
86
99
|
}
|
|
87
|
-
else if (o.equals(ontologies_1.
|
|
100
|
+
else if (o.equals(ontologies_1.sh.Parameterizable)) {
|
|
88
101
|
// No need to infer the type, as it is already asserted.
|
|
89
102
|
this.parameterizables.add(s.id);
|
|
90
103
|
}
|
|
91
104
|
else if (this.isParameterizableType(o)) {
|
|
92
105
|
this.assertParameterizable(s);
|
|
93
106
|
}
|
|
107
|
+
else if (this.isValidatorType(o)) {
|
|
108
|
+
this.assertValidator(s);
|
|
109
|
+
}
|
|
94
110
|
return;
|
|
95
111
|
}
|
|
96
|
-
case ontologies_1.
|
|
97
|
-
this.assertShape(s, ontologies_1.
|
|
112
|
+
case ontologies_1.sh.targetClass.id: {
|
|
113
|
+
this.assertShape(s, ontologies_1.sh.NodeShape);
|
|
98
114
|
this.assertClass(o);
|
|
99
115
|
return;
|
|
100
116
|
}
|
|
101
|
-
case ontologies_1.
|
|
102
|
-
this.assertShape(s, ontologies_1.
|
|
117
|
+
case ontologies_1.sh.class.id: {
|
|
118
|
+
this.assertShape(s, ontologies_1.sh.PropertyShape);
|
|
103
119
|
this.assertClass(o);
|
|
104
120
|
return;
|
|
105
121
|
}
|
|
106
|
-
case ontologies_1.
|
|
107
|
-
this.assertShape(s, ontologies_1.
|
|
122
|
+
case ontologies_1.sh.path.id: {
|
|
123
|
+
this.assertShape(s, ontologies_1.sh.PropertyShape);
|
|
108
124
|
this.assertProperty(o);
|
|
109
125
|
return;
|
|
110
126
|
}
|
|
111
|
-
case ontologies_1.
|
|
112
|
-
this.assertShape(s, ontologies_1.
|
|
113
|
-
this.assertShape(o, ontologies_1.
|
|
127
|
+
case ontologies_1.sh.property.id: {
|
|
128
|
+
this.assertShape(s, ontologies_1.sh.NodeShape);
|
|
129
|
+
this.assertShape(o, ontologies_1.sh.PropertyShape);
|
|
114
130
|
return;
|
|
115
131
|
}
|
|
116
|
-
case ontologies_1.
|
|
117
|
-
this.assertShape(o, ontologies_1.
|
|
132
|
+
case ontologies_1.sh.parameter.id: {
|
|
133
|
+
this.assertShape(o, ontologies_1.sh.Parameter);
|
|
134
|
+
this.assertParameterizable(s);
|
|
118
135
|
return;
|
|
119
136
|
}
|
|
120
|
-
case ontologies_1.
|
|
121
|
-
this.
|
|
137
|
+
case ontologies_1.sh.labelTemplate.id: {
|
|
138
|
+
this.assertParameterizable(s);
|
|
122
139
|
return;
|
|
123
140
|
}
|
|
124
|
-
case ontologies_1.
|
|
125
|
-
|
|
126
|
-
this.assertParameterizable(s);
|
|
141
|
+
case ontologies_1.sh.validator.id: {
|
|
142
|
+
this.assertValidator(o);
|
|
127
143
|
return;
|
|
128
144
|
}
|
|
129
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shacl-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/shacl-reasoner.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"shacl-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/shacl-reasoner.ts"],"names":[],"mappings":";;;AACA,iDAA2C;AAC3C,mDAA+C;AAE/C;;GAEG;AACH,MAAa,aAAc,SAAQ,4BAAY;IAA/C;;QACc,WAAM,GAAgB,IAAI,GAAG,EAAE,CAAC;QAEhC,eAAU,GAAgB,IAAI,GAAG,EAAE,CAAC;QAEpC,qBAAgB,GAAgB,IAAI,GAAG,EAAE,CAAC;IAgJxD,CAAC;IA9Ia,OAAO,CAAC,EAAU;QACxB,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,cAAc,CAAC,IAAa;QACxB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE3B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAES,WAAW,CAAC,OAAkD,EAAE,IAAmB;QACzF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,gBAAG,CAAC,IAAI,EAAE,eAAE,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAElE,IAAI,IAAI,EAAE;YACN,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,gBAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACjE;QA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AC,CAAC,EAAE,eAAE,CAAC,aAAa,CAAC,CAAC;gBACtC,OAAO;aACV;YACD,KAAK,eAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBAClB,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAE,CAAC,SAAS,CAAC,CAAC;gBAClC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;gBAC9B,OAAO;aACV;YACD,KAAK,eAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBACtB,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;gBAC9B,OAAO;aACV;YACD,KAAK,eAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBAClB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACxB,OAAO;aACV;SACJ;IACL,CAAC;CACJ;AArJD,sCAqJC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as n3 from "n3";
|
|
2
1
|
import { Quad_Subject, Quad_Object } from "@rdfjs/types";
|
|
3
2
|
import { Store } from "./store";
|
|
4
3
|
/**
|
|
@@ -31,8 +30,13 @@ export interface DefinitionQueryOptions extends QueryOptions {
|
|
|
31
30
|
* Indicate if blank nodes should be included in the result (default: false).
|
|
32
31
|
*/
|
|
33
32
|
includeBlankNodes?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parameters for store queries that support filtering on the type of resource.
|
|
36
|
+
*/
|
|
37
|
+
export interface TypedInstanceQueryOptions extends QueryOptions {
|
|
34
38
|
/**
|
|
35
|
-
* Indicate if
|
|
39
|
+
* Indicate if instances of a subclasses of the type should be included in the result.
|
|
36
40
|
*/
|
|
37
41
|
includeSubTypes?: boolean;
|
|
38
42
|
}
|
|
@@ -68,11 +72,11 @@ export declare class ResourceRepository {
|
|
|
68
72
|
* @param definedBy URI of the vocabulary that defines the resource (rdfs:isDefinedBy). Provide `null` to only return resources that have no `rdfs:isDefinedBy` property.
|
|
69
73
|
* @returns `true` if the node is defined by the given URI, `false` otherwise.
|
|
70
74
|
*/
|
|
71
|
-
isDefinedBy(graphUris: string | string[] | undefined, node:
|
|
75
|
+
isDefinedBy(graphUris: string | string[] | undefined, node: Quad_Subject, definedBy: string | null): boolean;
|
|
72
76
|
/**
|
|
73
77
|
* Indicate if a resource has a given type in the graph.
|
|
74
78
|
* @param graphUris URIs of the graphs to search.
|
|
75
|
-
* @param subjectUri URI of the subject to match.
|
|
79
|
+
* @param subjectUri URI or blank node id of the subject to match.
|
|
76
80
|
* @param typeUri URI of the type to match.
|
|
77
81
|
* @param options Optional query parameters.
|
|
78
82
|
* @returns `true` if the resource has the type, `false` otherwise.
|
|
@@ -104,21 +104,29 @@ class ResourceRepository {
|
|
|
104
104
|
return true;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
+
// A blank node is defined in the namespace if it is the object of a triple that is defined by the URI.
|
|
108
|
+
if (s.termType === "BlankNode") {
|
|
109
|
+
for (let q of this.store.match(graphUris, null, null, s, false)) {
|
|
110
|
+
return this.isDefinedBy(graphUris, q.subject, definedBy);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
107
113
|
}
|
|
108
114
|
return false;
|
|
109
115
|
}
|
|
110
116
|
/**
|
|
111
117
|
* Indicate if a resource has a given type in the graph.
|
|
112
118
|
* @param graphUris URIs of the graphs to search.
|
|
113
|
-
* @param subjectUri URI of the subject to match.
|
|
119
|
+
* @param subjectUri URI or blank node id of the subject to match.
|
|
114
120
|
* @param typeUri URI of the type to match.
|
|
115
121
|
* @param options Optional query parameters.
|
|
116
122
|
* @returns `true` if the resource has the type, `false` otherwise.
|
|
117
123
|
*/
|
|
118
124
|
hasType(graphUris, subjectUri, typeUri, options) {
|
|
119
|
-
const s = n3.DataFactory.namedNode(subjectUri);
|
|
120
125
|
const o = n3.DataFactory.namedNode(typeUri);
|
|
121
|
-
for (let _ of this.store.match(graphUris,
|
|
126
|
+
for (let _ of this.store.match(graphUris, n3.DataFactory.namedNode(subjectUri), ontologies_1.rdf.type, o, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
for (let _ of this.store.match(graphUris, n3.DataFactory.blankNode(subjectUri), ontologies_1.rdf.type, o, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
122
130
|
return true;
|
|
123
131
|
}
|
|
124
132
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-repository.js","sourceRoot":"","sources":["../../src/rdf/resource-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AAGzB,8CAA0C;AAC1C,+BAA4B;
|
|
1
|
+
{"version":3,"file":"resource-repository.js","sourceRoot":"","sources":["../../src/rdf/resource-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AAGzB,8CAA0C;AAC1C,+BAA4B;AAgD5B;;GAEG;AACH,MAAa,kBAAkB;IAM3B,YAAY,KAAY;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACO,IAAI,CAAC,SAAwC,EAAE,OAAmC,EAAE,OAAgC,EAAE,iBAAyC,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE;QAC3N,MAAM,IAAI,mCAAQ,cAAc,GAAK,OAAO,CAAE,CAAC;QAE/C,IAAI,CAAC,IAAI,CAAC,iBAAiB,IAAI,OAAO,CAAC,QAAQ,IAAI,WAAW,EAAE;YAC5D,yCAAyC;YACzC,OAAO,IAAI,CAAC;SACf;QAED,IAAI,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE;YACjE,2EAA2E;YAC3E,OAAO,IAAI,CAAC;SACf;QAED,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,MAAK,SAAS,EAAE;YAC/B,MAAM,SAAS,GAAG,IAA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IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;iBAC3D;aACJ;SACJ;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,SAAwC,EAAE,UAAkB,EAAE,OAAe,EAAE,OAAsB;QACzG,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAE5C,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,gBAAG,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAC,EAAE;YACpH,OAAO,IAAI,CAAC;SACf;QAED,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,gBAAG,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAC,EAAE;YACpH,OAAO,IAAI,CAAC;SACf;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AApJD,gDAoJC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Store } from "./store";
|
|
2
2
|
import { DefinitionQueryOptions } from "./resource-repository";
|
|
3
3
|
import { IndividualRepository } from "./individual-repository";
|
|
4
|
+
import { Quad_Subject } from "@rdfjs/types";
|
|
4
5
|
/**
|
|
5
6
|
* A repository for retrieving SHACL shapes from graphs.
|
|
6
7
|
*/
|
|
@@ -14,19 +15,27 @@ export declare class ShapeRepository extends IndividualRepository {
|
|
|
14
15
|
*/
|
|
15
16
|
getShapes(graphUris: string | string[] | undefined, subjectUri?: string, options?: DefinitionQueryOptions): string[];
|
|
16
17
|
/**
|
|
17
|
-
* Get all
|
|
18
|
+
* Get all shape types in the repository.
|
|
18
19
|
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
19
20
|
* @param options Optional query parameters.
|
|
20
|
-
* @returns A list of all
|
|
21
|
+
* @returns A list of all shape types in the repository.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
+
getShapeTypes(graphUris: string | string[] | undefined, options?: DefinitionQueryOptions): string[];
|
|
23
24
|
/**
|
|
24
|
-
* Get all
|
|
25
|
+
* Get all validator types in the repository.
|
|
25
26
|
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
26
27
|
* @param options Optional query parameters.
|
|
27
28
|
* @returns A list of all shape types in the repository.
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
getValidatorTypes(graphUris: string | string[] | undefined, options?: DefinitionQueryOptions): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Get all target classes, nodes or properties of a given shape in the repository.
|
|
33
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
34
|
+
* @param shape The URI or blank id of the shape.
|
|
35
|
+
* @param options Optional query parameters.
|
|
36
|
+
* @returns A list of all targeted reesources in the repository.
|
|
37
|
+
*/
|
|
38
|
+
getShapeTargets(graphUris: string | string[] | undefined, shape: Quad_Subject, options?: DefinitionQueryOptions): string[];
|
|
30
39
|
/**
|
|
31
40
|
* Indicate if there are shapes for a subject in the repository.
|
|
32
41
|
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
@@ -35,4 +44,32 @@ export declare class ShapeRepository extends IndividualRepository {
|
|
|
35
44
|
* @returns `true` if there are shapes for the subject, `false` otherwise.
|
|
36
45
|
*/
|
|
37
46
|
hasShapes(graphUris: string | string[] | undefined, subjectUri: string, options?: DefinitionQueryOptions): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Get the SHACL datatype of a given property.
|
|
49
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
50
|
+
* @param subjectUri The URI of the subject.
|
|
51
|
+
* @param options Optional query parameters.
|
|
52
|
+
* @returns A datatype URI on success, `xsd:anyURI` otherwise.
|
|
53
|
+
*/
|
|
54
|
+
getDatatype(graphUris: string | string[] | undefined, subjectUri: string, options?: DefinitionQueryOptions): string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Get the SHACL cardinality constraints of a given property.
|
|
57
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
58
|
+
* @param subjectUri The URI of the subject.
|
|
59
|
+
* @param options Optional query parameters.
|
|
60
|
+
* @returns An object with the minimum and maximum cardinalities; values are `-1` if not found.
|
|
61
|
+
*/
|
|
62
|
+
getCardinalites(graphUris: string | string[] | undefined, subjectUri: string, options?: DefinitionQueryOptions): {
|
|
63
|
+
minCount: number;
|
|
64
|
+
maxCount: number;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Get the RDF property path representation of the given SHACL property path. This method parses the SHACL property path and
|
|
68
|
+
* returns the RDF property path as a combination of nodes and strings.
|
|
69
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
70
|
+
* @param subject The URI or blank id of the node referred to by sh:path.
|
|
71
|
+
* @param options Optional query parameters.
|
|
72
|
+
* @returns A flattened list of all path components, either as URIs or as strings.
|
|
73
|
+
*/
|
|
74
|
+
getPropertyPathTokens(graphUris: string | string[] | undefined, subject: Quad_Subject): (string | Quad_Subject)[];
|
|
38
75
|
}
|
|
@@ -19,7 +19,7 @@ class ShapeRepository extends individual_repository_1.IndividualRepository {
|
|
|
19
19
|
getShapes(graphUris, subjectUri, options) {
|
|
20
20
|
const result = new Set();
|
|
21
21
|
if (!subjectUri) {
|
|
22
|
-
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.
|
|
22
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.sh.Shape, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
23
23
|
if (!this.skip(graphUris, q.subject, options)) {
|
|
24
24
|
result.add(q.subject.value);
|
|
25
25
|
}
|
|
@@ -27,17 +27,17 @@ class ShapeRepository extends individual_repository_1.IndividualRepository {
|
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
const s = n3.DataFactory.namedNode(subjectUri);
|
|
30
|
-
for (let q of this.store.match(graphUris, s, ontologies_1.rdf.type, ontologies_1.
|
|
30
|
+
for (let q of this.store.match(graphUris, s, ontologies_1.rdf.type, ontologies_1.sh.Shape, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
31
31
|
if (!this.skip(graphUris, q.subject, options)) {
|
|
32
32
|
result.add(q.subject.value);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
for (let q of this.store.match(graphUris, null, ontologies_1.
|
|
35
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.sh.targetClass, s, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
36
36
|
if (!this.skip(graphUris, q.subject, options)) {
|
|
37
37
|
result.add(q.subject.value);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
for (let q of this.store.match(graphUris, null, ontologies_1.
|
|
40
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.sh.path, s, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
41
41
|
if (!this.skip(graphUris, q.subject, options)) {
|
|
42
42
|
result.add(q.subject.value);
|
|
43
43
|
}
|
|
@@ -46,39 +46,71 @@ class ShapeRepository extends individual_repository_1.IndividualRepository {
|
|
|
46
46
|
return Array.from(result);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Get all
|
|
49
|
+
* Get all shape types in the repository.
|
|
50
50
|
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
51
51
|
* @param options Optional query parameters.
|
|
52
|
-
* @returns A list of all
|
|
52
|
+
* @returns A list of all shape types in the repository.
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
getShapeTypes(graphUris, options) {
|
|
55
55
|
const result = new Set();
|
|
56
|
-
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type,
|
|
57
|
-
if (!this.skip(graphUris, q.subject, options)) {
|
|
58
|
-
result.add(
|
|
56
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.sh.NodeShape)) {
|
|
57
|
+
if (!this.skip(graphUris, q.subject, options, { includeBlankNodes: true })) {
|
|
58
|
+
result.add(ontologies_1.SH.NodeShape);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.sh.PropertyShape)) {
|
|
63
|
+
if (!this.skip(graphUris, q.subject, options, { includeBlankNodes: true })) {
|
|
64
|
+
result.add(ontologies_1.SH.PropertyShape);
|
|
65
|
+
break;
|
|
59
66
|
}
|
|
60
67
|
}
|
|
61
68
|
return Array.from(result);
|
|
62
69
|
}
|
|
63
70
|
/**
|
|
64
|
-
* Get all
|
|
71
|
+
* Get all validator types in the repository.
|
|
65
72
|
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
66
73
|
* @param options Optional query parameters.
|
|
67
74
|
* @returns A list of all shape types in the repository.
|
|
68
75
|
*/
|
|
69
|
-
|
|
76
|
+
getValidatorTypes(graphUris, options) {
|
|
70
77
|
const result = new Set();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
78
|
+
// Get all validators in the repository, including the inferred ones.
|
|
79
|
+
if (this.store.has(graphUris, null, ontologies_1.rdf.type, ontologies_1.sh.Validator, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
80
|
+
result.add(ontologies_1.SH.Validator);
|
|
76
81
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
if (this.store.has(graphUris, null, ontologies_1.rdf.type, ontologies_1.sh.JSValidator, false)) {
|
|
83
|
+
result.add(ontologies_1.SH.JSValidator);
|
|
84
|
+
}
|
|
85
|
+
if (this.store.has(graphUris, null, ontologies_1.rdf.type, ontologies_1.sh.SPARQLAskValidator, false)) {
|
|
86
|
+
result.add(ontologies_1.SH.SPARQLAskValidator);
|
|
87
|
+
}
|
|
88
|
+
if (this.store.has(graphUris, null, ontologies_1.rdf.type, ontologies_1.sh.SPARQLSelectValidator, false)) {
|
|
89
|
+
result.add(ontologies_1.SH.SPARQLSelectValidator);
|
|
90
|
+
}
|
|
91
|
+
return Array.from(result);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get all target classes, nodes or properties of a given shape in the repository.
|
|
95
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
96
|
+
* @param shape The URI or blank id of the shape.
|
|
97
|
+
* @param options Optional query parameters.
|
|
98
|
+
* @returns A list of all targeted reesources in the repository.
|
|
99
|
+
*/
|
|
100
|
+
getShapeTargets(graphUris, shape, options) {
|
|
101
|
+
const result = new Set();
|
|
102
|
+
// Add the shape definition itself if it is a class.
|
|
103
|
+
for (let q of this.store.match(graphUris, shape, ontologies_1.rdf.type, ontologies_1.rdfs.Class, true)) {
|
|
104
|
+
result.add(q.subject.value);
|
|
105
|
+
}
|
|
106
|
+
for (let q of this.store.match(graphUris, shape, ontologies_1.sh.targetClass, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
107
|
+
result.add(q.object.value);
|
|
108
|
+
}
|
|
109
|
+
for (let q of this.store.match(graphUris, shape, ontologies_1.sh.targetNode, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
110
|
+
result.add(q.object.value);
|
|
111
|
+
}
|
|
112
|
+
for (let q of this.store.match(graphUris, shape, ontologies_1.sh.path, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
113
|
+
result.add(q.object.value);
|
|
82
114
|
}
|
|
83
115
|
return Array.from(result);
|
|
84
116
|
}
|
|
@@ -91,23 +123,139 @@ class ShapeRepository extends individual_repository_1.IndividualRepository {
|
|
|
91
123
|
*/
|
|
92
124
|
hasShapes(graphUris, subjectUri, options) {
|
|
93
125
|
const s = n3.DataFactory.namedNode(subjectUri);
|
|
94
|
-
for (let q of this.store.match(graphUris, s, ontologies_1.rdf.type, ontologies_1.
|
|
126
|
+
for (let q of this.store.match(graphUris, s, ontologies_1.rdf.type, ontologies_1.sh.Shape)) {
|
|
95
127
|
if (!this.skip(graphUris, q.subject, options, { includeBlankNodes: true })) {
|
|
96
128
|
return true;
|
|
97
129
|
}
|
|
98
130
|
}
|
|
99
|
-
for (let q of this.store.match(graphUris, null, ontologies_1.
|
|
131
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.sh.targetClass, s)) {
|
|
100
132
|
if (!this.skip(graphUris, q.subject, options, { includeBlankNodes: true })) {
|
|
101
133
|
return true;
|
|
102
134
|
}
|
|
103
135
|
}
|
|
104
|
-
for (let q of this.store.match(graphUris, null, ontologies_1.
|
|
136
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.sh.path, s)) {
|
|
105
137
|
if (!this.skip(graphUris, q.subject, options, { includeBlankNodes: true })) {
|
|
106
138
|
return true;
|
|
107
139
|
}
|
|
108
140
|
}
|
|
109
141
|
return false;
|
|
110
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Get the SHACL datatype of a given property.
|
|
145
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
146
|
+
* @param subjectUri The URI of the subject.
|
|
147
|
+
* @param options Optional query parameters.
|
|
148
|
+
* @returns A datatype URI on success, `xsd:anyURI` otherwise.
|
|
149
|
+
*/
|
|
150
|
+
getDatatype(graphUris, subjectUri, options) {
|
|
151
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.sh.path, n3.DataFactory.namedNode(subjectUri), options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
152
|
+
for (let x of this.store.match(graphUris, q.subject, ontologies_1.sh.datatype, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
153
|
+
return x.object.value;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get the SHACL cardinality constraints of a given property.
|
|
159
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
160
|
+
* @param subjectUri The URI of the subject.
|
|
161
|
+
* @param options Optional query parameters.
|
|
162
|
+
* @returns An object with the minimum and maximum cardinalities; values are `-1` if not found.
|
|
163
|
+
*/
|
|
164
|
+
getCardinalites(graphUris, subjectUri, options) {
|
|
165
|
+
let minCount = -1;
|
|
166
|
+
let maxCount = -1;
|
|
167
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.sh.path, n3.DataFactory.namedNode(subjectUri), options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
168
|
+
for (let x of this.store.match(graphUris, q.subject, ontologies_1.sh.minCount, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
169
|
+
minCount = parseInt(x.object.value);
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
for (let x of this.store.match(graphUris, q.subject, ontologies_1.sh.maxCount, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
173
|
+
maxCount = parseInt(x.object.value);
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return { minCount, maxCount };
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get the RDF property path representation of the given SHACL property path. This method parses the SHACL property path and
|
|
181
|
+
* returns the RDF property path as a combination of nodes and strings.
|
|
182
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
183
|
+
* @param subject The URI or blank id of the node referred to by sh:path.
|
|
184
|
+
* @param options Optional query parameters.
|
|
185
|
+
* @returns A flattened list of all path components, either as URIs or as strings.
|
|
186
|
+
*/
|
|
187
|
+
getPropertyPathTokens(graphUris, subject) {
|
|
188
|
+
const visitedNodes = new Set();
|
|
189
|
+
/**
|
|
190
|
+
* Parse the given subject node and return the path components.
|
|
191
|
+
* @param subject The currently parsed focus node.
|
|
192
|
+
* @param level The nesting level of the current path.
|
|
193
|
+
* @param separator The separator to use to separate path components.
|
|
194
|
+
* @param i The index of the current node in a list.
|
|
195
|
+
* @returns The sub path of the current node.
|
|
196
|
+
*/
|
|
197
|
+
const parse = (subject, level, separator = '/', i = 0) => {
|
|
198
|
+
if (visitedNodes.has(subject.value)) {
|
|
199
|
+
return [];
|
|
200
|
+
}
|
|
201
|
+
visitedNodes.add(subject.value);
|
|
202
|
+
if (subject.termType === 'NamedNode') {
|
|
203
|
+
// If we have a terminal node, we add it to the path.
|
|
204
|
+
return [subject];
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// Determine if we are looking at an item in a collection.
|
|
208
|
+
const first = this.store.match(graphUris, subject, ontologies_1.rdf.first, null, false).next().value;
|
|
209
|
+
if (first) {
|
|
210
|
+
// Note: We increase the nesting level as nested nodes in paths need to be wrapped in parentheses.
|
|
211
|
+
const path = parse(first.object, level + 1);
|
|
212
|
+
const rest = this.store.match(graphUris, subject, ontologies_1.rdf.rest, null, false).next().value;
|
|
213
|
+
if (rest && rest.object.value !== ontologies_1.rdf.nil.id) {
|
|
214
|
+
// The first item of the list sees the complete recursively parsed sub path.
|
|
215
|
+
const tail = parse(rest.object, level, separator, i + 1);
|
|
216
|
+
// If there is no tail we return the current item's path.
|
|
217
|
+
if (tail.length === 0) {
|
|
218
|
+
return path;
|
|
219
|
+
}
|
|
220
|
+
// For nested paths, we wrap the path in parentheses if it contains more than one item.
|
|
221
|
+
if (i === 0 && level > 0) {
|
|
222
|
+
return ['(', ...path, separator, ...tail, ')'];
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
return [...path, separator, ...tail];
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return path;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
// Blank nodes that are not lists contain SHACL path predicates.
|
|
232
|
+
for (let q of this.store.match(graphUris, subject, null, null, false)) {
|
|
233
|
+
switch (q.predicate.value) {
|
|
234
|
+
case ontologies_1.sh.inversePath.id: {
|
|
235
|
+
return ['^', ...parse(q.object, level)];
|
|
236
|
+
}
|
|
237
|
+
case ontologies_1.sh.zeroOrOnePath.id: {
|
|
238
|
+
return [...parse(q.object, level), '?'];
|
|
239
|
+
}
|
|
240
|
+
case ontologies_1.sh.zeroOrMorePath.id: {
|
|
241
|
+
return [...parse(q.object, level), '*'];
|
|
242
|
+
}
|
|
243
|
+
case ontologies_1.sh.oneOrMorePath.id: {
|
|
244
|
+
return [...parse(q.object, level), '+'];
|
|
245
|
+
}
|
|
246
|
+
case ontologies_1.sh.alternativePath.id: {
|
|
247
|
+
return parse(q.object, level, '|');
|
|
248
|
+
}
|
|
249
|
+
default:
|
|
250
|
+
throw new Error(`Unsupported path predicate: ${q.predicate.value}`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
throw new Error(`Unsupported path subject: ${subject}`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
return parse(subject, 0);
|
|
258
|
+
}
|
|
111
259
|
}
|
|
112
260
|
exports.ShapeRepository = ShapeRepository;
|
|
113
261
|
//# sourceMappingURL=shape-repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shape-repository.js","sourceRoot":"","sources":["../../src/rdf/shape-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,8CAAkD;AAGlD,mEAA+D;
|
|
1
|
+
{"version":3,"file":"shape-repository.js","sourceRoot":"","sources":["../../src/rdf/shape-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,8CAAkD;AAGlD,mEAA+D;AAG/D;;GAEG;AACH,MAAa,eAAgB,SAAQ,4CAAoB;IACrD,YAAY,KAAY,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3C;;;;;OAKG;IACH,SAAS,CAAC,SAAwC,EAAE,UAAmB,EAAE,OAAgC;QACrG,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