@faubulous/mentor-rdf 0.2.37 → 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 +97 -15
- package/out/rdf/class-repository.js.map +1 -1
- package/out/rdf/individual-repository.js +6 -7
- package/out/rdf/individual-repository.js.map +1 -1
- package/out/rdf/property-repository.d.ts +2 -2
- package/out/rdf/property-repository.js +16 -21
- package/out/rdf/property-repository.js.map +1 -1
- package/out/rdf/reasoners/rdfs-reasoner.d.ts +5 -4
- package/out/rdf/reasoners/rdfs-reasoner.js +15 -14
- package/out/rdf/reasoners/rdfs-reasoner.js.map +1 -1
- package/out/rdf/reasoners/reasoner.d.ts +5 -0
- package/out/rdf/reasoners/reasoner.js.map +1 -1
- package/out/rdf/reasoners/shacl-reasoner.d.ts +9 -1
- package/out/rdf/reasoners/shacl-reasoner.js +99 -12
- package/out/rdf/reasoners/shacl-reasoner.js.map +1 -1
- package/out/rdf/reasoners/skos-reasoner.d.ts +4 -3
- package/out/rdf/reasoners/skos-reasoner.js +13 -8
- package/out/rdf/reasoners/skos-reasoner.js.map +1 -1
- package/out/rdf/resource-repository.d.ts +24 -6
- package/out/rdf/resource-repository.js +41 -13
- package/out/rdf/resource-repository.js.map +1 -1
- package/out/rdf/shape-repository.d.ts +45 -6
- package/out/rdf/shape-repository.js +193 -38
- package/out/rdf/shape-repository.js.map +1 -1
- package/out/rdf/store.d.ts +31 -1
- package/out/rdf/store.js +56 -11
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-repository.js","sourceRoot":"","sources":["../../src/rdf/property-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,8CAAoD;AACpD,yDAAqD;AAIrD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,kCAAe;IAWnD,YAAY,KAAY;QAAI,KAAK,CAAC,KAAK,CAAC,CAAC;QAVzC;;WAEG;QACI,oBAAe,GAAG,iBAAI,CAAC,MAAM,CAAC;QAErC;;WAEG;QACI,mBAAc,GAAG,iBAAI,CAAC,KAAK,CAAC;IAEO,CAAC;IAE3C;;;;OAIG;IACH,aAAa,CAAC,SAAwC,EAAE,OAAgC;QACpF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;QAEjC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAG,CAAC,IAAI,EAAE,gBAAG,CAAC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAC,EAAE;YAC/F,
|
|
1
|
+
{"version":3,"file":"property-repository.js","sourceRoot":"","sources":["../../src/rdf/property-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,8CAAoD;AACpD,yDAAqD;AAIrD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,kCAAe;IAWnD,YAAY,KAAY;QAAI,KAAK,CAAC,KAAK,CAAC,CAAC;QAVzC;;WAEG;QACI,oBAAe,GAAG,iBAAI,CAAC,MAAM,CAAC;QAErC;;WAEG;QACI,mBAAc,GAAG,iBAAI,CAAC,KAAK,CAAC;IAEO,CAAC;IAE3C;;;;OAIG;IACH,aAAa,CAAC,SAAwC,EAAE,OAAgC;QACpF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;QAEjC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAG,CAAC,IAAI,EAAE,gBAAG,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,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAExF,KAAK,IAAI,CAAC,IAAI,UAAU,EAAE;YACtB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAS,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,gBAAG,CAAC,IAAI,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;gBAChB,KAAK,IAAI,CAAC,IAAI,KAAK,EAAE;oBACjB,sEAAsE;oBACtE,IAAI,CAAC,KAAK,gBAAG,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE;wBACvC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;qBACjB;iBACJ;aACJ;iBAAM;gBACH,iEAAiE;gBACjE,MAAM,CAAC,GAAG,CAAC,gBAAG,CAAC,QAAQ,CAAC,CAAC;aAC5B;SACJ;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACJ;AAlSD,gDAkSC"}
|
|
@@ -4,11 +4,12 @@ import { SkosReasoner } from "./skos-reasoner";
|
|
|
4
4
|
* A simple RDFS reasoner that expands the graph with inferred triples.
|
|
5
5
|
*/
|
|
6
6
|
export declare class RdfsReasoner extends SkosReasoner {
|
|
7
|
-
protected ontologies: Set<
|
|
8
|
-
protected classes: Set<
|
|
9
|
-
protected properties: Set<
|
|
10
|
-
protected invididuals: Set<n3.
|
|
7
|
+
protected ontologies: Set<string>;
|
|
8
|
+
protected classes: Set<string>;
|
|
9
|
+
protected properties: Set<string>;
|
|
10
|
+
protected invididuals: Set<n3.Term>;
|
|
11
11
|
protected isIgnoredNode(term: n3.Term): boolean;
|
|
12
|
+
protected isClass(id: string): boolean;
|
|
12
13
|
protected afterInference(): void;
|
|
13
14
|
applyInference(quad: n3.Quad): void;
|
|
14
15
|
protected assertClass(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
@@ -20,23 +20,24 @@ class RdfsReasoner extends skos_reasoner_1.SkosReasoner {
|
|
|
20
20
|
case ontologies_1.skos.ConceptScheme.id:
|
|
21
21
|
case ontologies_1.skos.Collection.id:
|
|
22
22
|
case ontologies_1.skos.OrderedCollection.id:
|
|
23
|
-
case ontologies_1.
|
|
24
|
-
case ontologies_1.
|
|
25
|
-
case ontologies_1.
|
|
23
|
+
case ontologies_1.sh.Shape.id:
|
|
24
|
+
case ontologies_1.sh.NodeShape.id:
|
|
25
|
+
case ontologies_1.sh.PropertyShape.id:
|
|
26
26
|
return true;
|
|
27
27
|
default:
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
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
|
+
}
|
|
31
37
|
afterInference() {
|
|
32
38
|
super.afterInference();
|
|
33
39
|
// After all axioms have been inferred, add the inferred individuals to the graph.
|
|
34
|
-
const individuals = [...this.invididuals].filter(x => !this.
|
|
35
|
-
!this.properties.has(x) &&
|
|
36
|
-
!this.ontologies.has(x) &&
|
|
37
|
-
!this.concepts.has(x) &&
|
|
38
|
-
!this.conceptSchemes.has(x) &&
|
|
39
|
-
!this.collections.has(x));
|
|
40
|
+
const individuals = [...this.invididuals].filter(x => !this.isClass(x.id));
|
|
40
41
|
for (let individual of individuals) {
|
|
41
42
|
this.store.addQuad(individual, ontologies_1.rdf.type, ontologies_1.owl.NamedIndividual, this.targetGraph);
|
|
42
43
|
}
|
|
@@ -50,7 +51,7 @@ class RdfsReasoner extends skos_reasoner_1.SkosReasoner {
|
|
|
50
51
|
this.invididuals.add(quad.subject);
|
|
51
52
|
}
|
|
52
53
|
if (quad.object.id == ontologies_1.owl.Ontology.id) {
|
|
53
|
-
this.ontologies.add(quad.subject);
|
|
54
|
+
this.ontologies.add(quad.subject.id);
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
this.inferClassAxioms(quad);
|
|
@@ -58,7 +59,7 @@ class RdfsReasoner extends skos_reasoner_1.SkosReasoner {
|
|
|
58
59
|
}
|
|
59
60
|
assertClass(subject) {
|
|
60
61
|
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.rdfs.Class, this.targetGraph);
|
|
61
|
-
this.classes.add(subject);
|
|
62
|
+
this.classes.add(subject.id);
|
|
62
63
|
}
|
|
63
64
|
inferClassAxioms(quad) {
|
|
64
65
|
let s = quad.subject;
|
|
@@ -71,7 +72,7 @@ class RdfsReasoner extends skos_reasoner_1.SkosReasoner {
|
|
|
71
72
|
case ontologies_1.rdf.type.id: {
|
|
72
73
|
if (o.equals(ontologies_1.rdfs.Class)) {
|
|
73
74
|
// No need to infer the class type, as it is already asserted.
|
|
74
|
-
this.classes.add(s);
|
|
75
|
+
this.classes.add(s.id);
|
|
75
76
|
}
|
|
76
77
|
else if (o.equals(ontologies_1.owl.Class)) {
|
|
77
78
|
this.assertClass(s);
|
|
@@ -114,7 +115,7 @@ class RdfsReasoner extends skos_reasoner_1.SkosReasoner {
|
|
|
114
115
|
}
|
|
115
116
|
assertProperty(subject) {
|
|
116
117
|
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.rdf.Property, this.targetGraph);
|
|
117
|
-
this.properties.add(subject);
|
|
118
|
+
this.properties.add(subject.id);
|
|
118
119
|
}
|
|
119
120
|
inferPropertyAxioms(quad) {
|
|
120
121
|
let s = quad.subject;
|
|
@@ -127,7 +128,7 @@ class RdfsReasoner extends skos_reasoner_1.SkosReasoner {
|
|
|
127
128
|
case ontologies_1.rdf.type.id: {
|
|
128
129
|
if (o.equals(ontologies_1.rdf.Property)) {
|
|
129
130
|
// No need to infer the property type, as it is already asserted.
|
|
130
|
-
this.properties.add(s);
|
|
131
|
+
this.properties.add(s.id);
|
|
131
132
|
}
|
|
132
133
|
return;
|
|
133
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rdfs-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/rdfs-reasoner.ts"],"names":[],"mappings":";;;AACA,
|
|
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;YACb,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;SACpB;IACL,CAAC;IAES,OAAO,CAAC,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AM,CAAC,gBAAG,CAAC,QAAQ,CAAC,EAAE;oBACxB,iEAAiE;oBACjE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;iBAC7B;gBAED,OAAO;aACV;YACD,KAAK,iBAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,KAAK,iBAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACjB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;gBAEvB,OAAO;aACV;SACJ;IACL,CAAC;CACJ;AArJD,oCAqJC"}
|
|
@@ -54,4 +54,9 @@ export declare abstract class ReasonerBase implements Reasoner {
|
|
|
54
54
|
protected beforeInference(): void;
|
|
55
55
|
protected afterInference(): void;
|
|
56
56
|
abstract applyInference(quad: n3.Quad): void;
|
|
57
|
+
/**
|
|
58
|
+
* Indicate if a given resource should *not* be inferred to be a owl:NamedIndividual.
|
|
59
|
+
* @param id A resource URI or blank node identifier.
|
|
60
|
+
*/
|
|
61
|
+
protected abstract isClass(id: string): boolean;
|
|
57
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/reasoner.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,iDAA4C;AAwB5C;;GAEG;AACH,MAAsB,YAAY;IAAlC;QACc,UAAK,GAAa,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;QAM3B,WAAM,GAAyC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/reasoner.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,iDAA4C;AAwB5C;;GAEG;AACH,MAAsB,YAAY;IAAlC;QACc,UAAK,GAAa,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;QAM3B,WAAM,GAAyC,EAAE,CAAC;IAwHtE,CAAC;IAtHU,oBAAoB,CAAC,G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B,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACpF,kFAAkF;YAClF,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SAClC;QAED,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAClD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAElD,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;YAC9D,IAAI,CAAC,GAAG,IAAe,CAAC;YAExB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAA;SACzB;QAED,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAES,eAAe,KAAK,CAAC;IAErB,cAAc,KAAK,CAAC;CASjC;AA/HD,oCA+HC"}
|
|
@@ -4,8 +4,16 @@ import { RdfsReasoner } from "./rdfs-reasoner";
|
|
|
4
4
|
* A simple SKOS reasoner that expands the graph with inferred triples.
|
|
5
5
|
*/
|
|
6
6
|
export declare class ShaclReasoner extends RdfsReasoner {
|
|
7
|
-
protected shapes: Set<
|
|
7
|
+
protected shapes: Set<string>;
|
|
8
|
+
protected validators: Set<string>;
|
|
9
|
+
protected parameterizables: Set<string>;
|
|
10
|
+
protected isClass(id: string): boolean;
|
|
8
11
|
applyInference(quad: n3.Quad): void;
|
|
9
12
|
protected assertShape(subject: n3.BlankNode | n3.NamedNode | n3.Variable, type?: n3.NamedNode): void;
|
|
13
|
+
protected assertValidator(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
14
|
+
protected assertParameterizable(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
15
|
+
protected isShapeType(subject: n3.Term): boolean;
|
|
16
|
+
protected isValidatorType(subject: n3.Term): boolean;
|
|
17
|
+
protected isParameterizableType(subject: n3.Term): boolean;
|
|
10
18
|
inferShapeAxioms(quad: n3.Quad): void;
|
|
11
19
|
}
|
|
@@ -10,17 +10,76 @@ class ShaclReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
12
|
this.shapes = new Set();
|
|
13
|
+
this.validators = new Set();
|
|
14
|
+
this.parameterizables = new Set();
|
|
15
|
+
}
|
|
16
|
+
isClass(id) {
|
|
17
|
+
return super.isClass(id) ||
|
|
18
|
+
this.shapes.has(id) ||
|
|
19
|
+
this.validators.has(id) ||
|
|
20
|
+
this.parameterizables.has(id);
|
|
13
21
|
}
|
|
14
22
|
applyInference(quad) {
|
|
15
23
|
super.applyInference(quad);
|
|
16
24
|
this.inferShapeAxioms(quad);
|
|
17
25
|
}
|
|
18
26
|
assertShape(subject, type) {
|
|
19
|
-
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);
|
|
20
28
|
if (type) {
|
|
21
29
|
this.store.addQuad(subject, ontologies_1.rdf.type, type, this.targetGraph);
|
|
22
30
|
}
|
|
23
|
-
this.shapes.add(subject);
|
|
31
|
+
this.shapes.add(subject.id);
|
|
32
|
+
}
|
|
33
|
+
assertValidator(subject) {
|
|
34
|
+
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.sh.Validator, this.targetGraph);
|
|
35
|
+
this.validators.add(subject.id);
|
|
36
|
+
}
|
|
37
|
+
assertParameterizable(subject) {
|
|
38
|
+
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.sh.Parameterizable, this.targetGraph);
|
|
39
|
+
this.parameterizables.add(subject.id);
|
|
40
|
+
}
|
|
41
|
+
isShapeType(subject) {
|
|
42
|
+
switch (subject.id) {
|
|
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: {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
default: {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
isParameterizableType(subject) {
|
|
68
|
+
switch (subject.id) {
|
|
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: {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
default: {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
24
83
|
}
|
|
25
84
|
inferShapeAxioms(quad) {
|
|
26
85
|
let s = quad.subject;
|
|
@@ -31,28 +90,56 @@ class ShaclReasoner extends rdfs_reasoner_1.RdfsReasoner {
|
|
|
31
90
|
}
|
|
32
91
|
switch (p.id) {
|
|
33
92
|
case ontologies_1.rdf.type.id: {
|
|
34
|
-
if (o.equals(ontologies_1.
|
|
93
|
+
if (o.equals(ontologies_1.sh.Shape)) {
|
|
35
94
|
// No need to infer the type, as it is already asserted.
|
|
36
|
-
this.shapes.add(s);
|
|
95
|
+
this.shapes.add(s.id);
|
|
37
96
|
}
|
|
38
|
-
else if (
|
|
97
|
+
else if (this.isShapeType(o)) {
|
|
39
98
|
this.assertShape(s, o);
|
|
40
99
|
}
|
|
100
|
+
else if (o.equals(ontologies_1.sh.Parameterizable)) {
|
|
101
|
+
// No need to infer the type, as it is already asserted.
|
|
102
|
+
this.parameterizables.add(s.id);
|
|
103
|
+
}
|
|
104
|
+
else if (this.isParameterizableType(o)) {
|
|
105
|
+
this.assertParameterizable(s);
|
|
106
|
+
}
|
|
107
|
+
else if (this.isValidatorType(o)) {
|
|
108
|
+
this.assertValidator(s);
|
|
109
|
+
}
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
case ontologies_1.sh.targetClass.id: {
|
|
113
|
+
this.assertShape(s, ontologies_1.sh.NodeShape);
|
|
114
|
+
this.assertClass(o);
|
|
41
115
|
return;
|
|
42
116
|
}
|
|
43
|
-
case ontologies_1.
|
|
44
|
-
this.assertShape(s, ontologies_1.
|
|
117
|
+
case ontologies_1.sh.class.id: {
|
|
118
|
+
this.assertShape(s, ontologies_1.sh.PropertyShape);
|
|
45
119
|
this.assertClass(o);
|
|
46
120
|
return;
|
|
47
121
|
}
|
|
48
|
-
case ontologies_1.
|
|
49
|
-
this.assertShape(s, ontologies_1.
|
|
122
|
+
case ontologies_1.sh.path.id: {
|
|
123
|
+
this.assertShape(s, ontologies_1.sh.PropertyShape);
|
|
50
124
|
this.assertProperty(o);
|
|
51
125
|
return;
|
|
52
126
|
}
|
|
53
|
-
case ontologies_1.
|
|
54
|
-
this.assertShape(s, ontologies_1.
|
|
55
|
-
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);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
case ontologies_1.sh.parameter.id: {
|
|
133
|
+
this.assertShape(o, ontologies_1.sh.Parameter);
|
|
134
|
+
this.assertParameterizable(s);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
case ontologies_1.sh.labelTemplate.id: {
|
|
138
|
+
this.assertParameterizable(s);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
case ontologies_1.sh.validator.id: {
|
|
142
|
+
this.assertValidator(o);
|
|
56
143
|
return;
|
|
57
144
|
}
|
|
58
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,I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,CAAC,aAAa,CAAC,CAAC;gBACtC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBACpB,OAAO;aACV;YACD,KAAK,eAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACb,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAE,CAAC,aAAa,CAAC,CAAC;gBACtC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;gBACvB,OAAO;aACV;YACD,KAAK,eAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACjB,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAE,CAAC,SAAS,CAAC,CAAC;gBAClC,IAAI,CAAC,WAAW,CAAC,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"}
|
|
@@ -4,12 +4,13 @@ import { ReasonerBase } from "./reasoner";
|
|
|
4
4
|
* A simple SKOS reasoner that expands the graph with inferred triples.
|
|
5
5
|
*/
|
|
6
6
|
export declare class SkosReasoner extends ReasonerBase {
|
|
7
|
-
protected concepts: Set<
|
|
8
|
-
protected conceptSchemes: Set<
|
|
9
|
-
protected collections: Set<
|
|
7
|
+
protected concepts: Set<string>;
|
|
8
|
+
protected conceptSchemes: Set<string>;
|
|
9
|
+
protected collections: Set<string>;
|
|
10
10
|
applyInference(quad: n3.Quad): void;
|
|
11
11
|
protected assertConcept(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
12
12
|
protected assertConceptScheme(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
13
|
+
protected isClass(id: string): boolean;
|
|
13
14
|
inferConceptAxioms(quad: n3.Quad): void;
|
|
14
15
|
protected assertCollection(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
15
16
|
protected assertOrderedCollection(subject: n3.BlankNode | n3.NamedNode | n3.Variable): void;
|
|
@@ -19,11 +19,16 @@ class SkosReasoner extends reasoner_1.ReasonerBase {
|
|
|
19
19
|
}
|
|
20
20
|
assertConcept(subject) {
|
|
21
21
|
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.skos.Concept, this.targetGraph);
|
|
22
|
-
this.concepts.add(subject);
|
|
22
|
+
this.concepts.add(subject.id);
|
|
23
23
|
}
|
|
24
24
|
assertConceptScheme(subject) {
|
|
25
25
|
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.skos.ConceptScheme, this.targetGraph);
|
|
26
|
-
this.conceptSchemes.add(subject);
|
|
26
|
+
this.conceptSchemes.add(subject.id);
|
|
27
|
+
}
|
|
28
|
+
isClass(id) {
|
|
29
|
+
return this.concepts.has(id) ||
|
|
30
|
+
this.conceptSchemes.has(id) ||
|
|
31
|
+
this.collections.has(id);
|
|
27
32
|
}
|
|
28
33
|
inferConceptAxioms(quad) {
|
|
29
34
|
let s = quad.subject;
|
|
@@ -36,11 +41,11 @@ class SkosReasoner extends reasoner_1.ReasonerBase {
|
|
|
36
41
|
case ontologies_1.rdf.type.id: {
|
|
37
42
|
if (o.equals(ontologies_1.skos.Concept)) {
|
|
38
43
|
// No need to infer the type, as it is already asserted.
|
|
39
|
-
this.concepts.add(s);
|
|
44
|
+
this.concepts.add(s.id);
|
|
40
45
|
}
|
|
41
46
|
else if (o.equals(ontologies_1.skos.ConceptScheme)) {
|
|
42
47
|
// No need to infer the type, as it is already asserted.
|
|
43
|
-
this.conceptSchemes.add(s);
|
|
48
|
+
this.conceptSchemes.add(s.id);
|
|
44
49
|
}
|
|
45
50
|
return;
|
|
46
51
|
}
|
|
@@ -63,12 +68,12 @@ class SkosReasoner extends reasoner_1.ReasonerBase {
|
|
|
63
68
|
}
|
|
64
69
|
assertCollection(subject) {
|
|
65
70
|
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.skos.Collection, this.targetGraph);
|
|
66
|
-
this.collections.add(subject);
|
|
71
|
+
this.collections.add(subject.id);
|
|
67
72
|
}
|
|
68
73
|
assertOrderedCollection(subject) {
|
|
69
74
|
this.store.addQuad(subject, ontologies_1.rdf.type, ontologies_1.skos.OrderedCollection, this.targetGraph);
|
|
70
75
|
// We do not make a distinction between collections and ordered collections here.
|
|
71
|
-
this.collections.add(subject);
|
|
76
|
+
this.collections.add(subject.id);
|
|
72
77
|
}
|
|
73
78
|
inferCollectionAxioms(quad) {
|
|
74
79
|
let s = quad.subject;
|
|
@@ -81,11 +86,11 @@ class SkosReasoner extends reasoner_1.ReasonerBase {
|
|
|
81
86
|
case ontologies_1.rdf.type.id: {
|
|
82
87
|
if (o.equals(ontologies_1.skos.Collection)) {
|
|
83
88
|
// No need to infer the type, as it is already asserted.
|
|
84
|
-
this.collections.add(s);
|
|
89
|
+
this.collections.add(s.id);
|
|
85
90
|
}
|
|
86
91
|
else if (o.equals(ontologies_1.skos.OrderedCollection)) {
|
|
87
92
|
// No need to infer the type, as it is already asserted.
|
|
88
|
-
this.collections.add(s);
|
|
93
|
+
this.collections.add(s.id);
|
|
89
94
|
}
|
|
90
95
|
return;
|
|
91
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skos-reasoner.js","sourceRoot":"","sources":["../../../src/rdf/reasoners/skos-reasoner.ts"],"names":[],"mappings":";;;AACA,iDAA6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wD;oBACxD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;iBAC9B;gBACD,OAAO;aACV;YACD,KAAK,iBAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACjB,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;gBACzB,OAAO;aACV;YACD,KAAK,iBAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBACrB,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;gBAChC,OAAO;aACV;SACJ;IACL,CAAC;CACJ;AA/GD,oCA+GC"}
|
|
@@ -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
|
/**
|
|
@@ -24,7 +23,7 @@ export interface DefinitionQueryOptions extends QueryOptions {
|
|
|
24
23
|
*/
|
|
25
24
|
notDefinedBy?: string[];
|
|
26
25
|
/**
|
|
27
|
-
* Indicate if terms what are not *defined* in the ontology should be included in the result (default:
|
|
26
|
+
* Indicate if terms what are not *defined* in the ontology should be included in the result (default: false).
|
|
28
27
|
*/
|
|
29
28
|
includeReferenced?: boolean;
|
|
30
29
|
/**
|
|
@@ -32,6 +31,15 @@ export interface DefinitionQueryOptions extends QueryOptions {
|
|
|
32
31
|
*/
|
|
33
32
|
includeBlankNodes?: boolean;
|
|
34
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Parameters for store queries that support filtering on the type of resource.
|
|
36
|
+
*/
|
|
37
|
+
export interface TypedInstanceQueryOptions extends QueryOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Indicate if instances of a subclasses of the type should be included in the result.
|
|
40
|
+
*/
|
|
41
|
+
includeSubTypes?: boolean;
|
|
42
|
+
}
|
|
35
43
|
/**
|
|
36
44
|
* A repository for retrieving resources from graphs.
|
|
37
45
|
*/
|
|
@@ -44,18 +52,19 @@ export declare class ResourceRepository {
|
|
|
44
52
|
/**
|
|
45
53
|
* Inidiates if a node should not be included in the result of a definition query.
|
|
46
54
|
* @param graphUris URIs of the graphs to search.
|
|
47
|
-
* @param
|
|
55
|
+
* @param subject The focus node.
|
|
48
56
|
* @param options Definition query options.
|
|
57
|
+
* @param optionDefaults Custom default values for the query options.
|
|
49
58
|
* @returns
|
|
50
59
|
*/
|
|
51
|
-
protected skip(graphUris: string | string[] | undefined,
|
|
60
|
+
protected skip(graphUris: string | string[] | undefined, subject: Quad_Subject | Quad_Object, options?: DefinitionQueryOptions, optionDefaults?: DefinitionQueryOptions): boolean;
|
|
52
61
|
/**
|
|
53
62
|
* Indicate if a given URI exists as the subject of a triple in the graph.
|
|
54
63
|
* @param graphUris URIs of the graphs to search.
|
|
55
64
|
* @param subjectUri URI of the subject to search for.
|
|
56
65
|
* @returns true if the URI is a subject, false otherwise.
|
|
57
66
|
*/
|
|
58
|
-
hasSubject(graphUris: string | string[] | undefined, subjectUri: string |
|
|
67
|
+
hasSubject(graphUris: string | string[] | undefined, subjectUri: string | Quad_Subject | Quad_Object): boolean;
|
|
59
68
|
/**
|
|
60
69
|
* Indicate if a node is explicitly defined by the given URI using the `rdfs:isDefinedBy` property, or implicitly by sharing the same namespace.
|
|
61
70
|
* @param graphUris URIs of the graphs to search.
|
|
@@ -63,5 +72,14 @@ export declare class ResourceRepository {
|
|
|
63
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.
|
|
64
73
|
* @returns `true` if the node is defined by the given URI, `false` otherwise.
|
|
65
74
|
*/
|
|
66
|
-
isDefinedBy(graphUris: string | string[] | undefined, node:
|
|
75
|
+
isDefinedBy(graphUris: string | string[] | undefined, node: Quad_Subject, definedBy: string | null): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Indicate if a resource has a given type in the graph.
|
|
78
|
+
* @param graphUris URIs of the graphs to search.
|
|
79
|
+
* @param subjectUri URI or blank node id of the subject to match.
|
|
80
|
+
* @param typeUri URI of the type to match.
|
|
81
|
+
* @param options Optional query parameters.
|
|
82
|
+
* @returns `true` if the resource has the type, `false` otherwise.
|
|
83
|
+
*/
|
|
84
|
+
hasType(graphUris: string | string[] | undefined, subjectUri: string, typeUri: string, options?: QueryOptions): boolean;
|
|
67
85
|
}
|
|
@@ -15,29 +15,31 @@ class ResourceRepository {
|
|
|
15
15
|
/**
|
|
16
16
|
* Inidiates if a node should not be included in the result of a definition query.
|
|
17
17
|
* @param graphUris URIs of the graphs to search.
|
|
18
|
-
* @param
|
|
18
|
+
* @param subject The focus node.
|
|
19
19
|
* @param options Definition query options.
|
|
20
|
+
* @param optionDefaults Custom default values for the query options.
|
|
20
21
|
* @returns
|
|
21
22
|
*/
|
|
22
|
-
skip(graphUris,
|
|
23
|
-
|
|
23
|
+
skip(graphUris, subject, options, optionDefaults = { includeBlankNodes: false, includeReferenced: false }) {
|
|
24
|
+
const opts = Object.assign(Object.assign({}, optionDefaults), options);
|
|
25
|
+
if (!opts.includeBlankNodes && subject.termType != "NamedNode") {
|
|
24
26
|
// We are only interested in named nodes.
|
|
25
27
|
return true;
|
|
26
28
|
}
|
|
27
|
-
if (!
|
|
29
|
+
if (!opts.includeReferenced && !this.hasSubject(graphUris, subject)) {
|
|
28
30
|
// Skip the node if it is not explicitly defined in the graph as a subject.
|
|
29
31
|
return true;
|
|
30
32
|
}
|
|
31
|
-
if ((
|
|
32
|
-
const isDefined = this.isDefinedBy(graphUris,
|
|
33
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.definedBy) !== undefined) {
|
|
34
|
+
const isDefined = this.isDefinedBy(graphUris, subject, opts.definedBy);
|
|
33
35
|
// Do not skip the node if it has a different namespace but is *explicitly* defined by the given URI.
|
|
34
|
-
if (
|
|
36
|
+
if (opts.definedBy === null && isDefined || opts.definedBy !== null && !isDefined) {
|
|
35
37
|
return true;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
|
-
else if ((
|
|
39
|
-
for (const source of
|
|
40
|
-
if (this.isDefinedBy(graphUris,
|
|
40
|
+
else if ((opts === null || opts === void 0 ? void 0 : opts.notDefinedBy) !== undefined) {
|
|
41
|
+
for (const source of opts.notDefinedBy) {
|
|
42
|
+
if (this.isDefinedBy(graphUris, subject, source)) {
|
|
41
43
|
return true;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -55,11 +57,13 @@ class ResourceRepository {
|
|
|
55
57
|
if (typeof subjectUri === "string") {
|
|
56
58
|
s = n3.DataFactory.namedNode(subjectUri);
|
|
57
59
|
}
|
|
58
|
-
else {
|
|
60
|
+
else if (subjectUri.termType !== "Literal") {
|
|
59
61
|
s = subjectUri;
|
|
60
62
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
if (s) {
|
|
64
|
+
for (let _ of this.store.match(graphUris, s, null, null, false)) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
return false;
|
|
65
69
|
}
|
|
@@ -100,6 +104,30 @@ class ResourceRepository {
|
|
|
100
104
|
return true;
|
|
101
105
|
}
|
|
102
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
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Indicate if a resource has a given type in the graph.
|
|
118
|
+
* @param graphUris URIs of the graphs to search.
|
|
119
|
+
* @param subjectUri URI or blank node id of the subject to match.
|
|
120
|
+
* @param typeUri URI of the type to match.
|
|
121
|
+
* @param options Optional query parameters.
|
|
122
|
+
* @returns `true` if the resource has the type, `false` otherwise.
|
|
123
|
+
*/
|
|
124
|
+
hasType(graphUris, subjectUri, typeUri, options) {
|
|
125
|
+
const o = n3.DataFactory.namedNode(typeUri);
|
|
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)) {
|
|
130
|
+
return true;
|
|
103
131
|
}
|
|
104
132
|
return false;
|
|
105
133
|
}
|