@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
package/out/ontologies/src.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.xsd = exports.skos = exports.
|
|
3
|
+
exports.xsd = exports.skos = exports.skos_xl = exports.sh = exports.rdfs = exports.rdfa = exports.rdf = exports.owl = void 0;
|
|
4
4
|
exports.owl = `@prefix dc: <http://purl.org/dc/elements/1.1/> .
|
|
5
5
|
@prefix grddl: <http://www.w3.org/2003/g/data-view#> .
|
|
6
6
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
@@ -919,7 +919,7 @@ rdfs:Datatype a rdfs:Class ;
|
|
|
919
919
|
|
|
920
920
|
<http://www.w3.org/2000/01/rdf-schema#> rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .
|
|
921
921
|
`;
|
|
922
|
-
exports.
|
|
922
|
+
exports.sh = `# W3C Shapes Constraint Language (SHACL) Vocabulary
|
|
923
923
|
# Version from 2017-07-20
|
|
924
924
|
|
|
925
925
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
@@ -2584,6 +2584,76 @@ sh:JSValidator
|
|
|
2584
2584
|
rdfs:subClassOf sh:Validator ;
|
|
2585
2585
|
rdfs:isDefinedBy sh: .
|
|
2586
2586
|
`;
|
|
2587
|
+
exports.skos_xl = `@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
2588
|
+
@prefix dct: <http://purl.org/dc/terms/> .
|
|
2589
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
2590
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
2591
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
2592
|
+
|
|
2593
|
+
<http://www.w3.org/2008/05/skos-xl> a owl:Ontology ;
|
|
2594
|
+
dct:creator "Alistair Miles" , "Sean Bechhofer" ;
|
|
2595
|
+
rdfs:seeAlso <http://www.w3.org/2008/05/skos> ;
|
|
2596
|
+
owl:imports <http://www.w3.org/2004/02/skos/core> ;
|
|
2597
|
+
dct:title "SKOS XL Vocabulary"@en ;
|
|
2598
|
+
dct:contributor "Participants in W3C's Semantic Web Deployment Working Group." ;
|
|
2599
|
+
dct:description "An RDF vocabulary extending SKOS and allowing the description and linking of lexical entities."@en .
|
|
2600
|
+
|
|
2601
|
+
<http://www.w3.org/2008/05/skos-xl#Label> rdfs:label "Label"@en ;
|
|
2602
|
+
rdfs:isDefinedBy <http://www.w3.org/2008/05/skos-xl> ;
|
|
2603
|
+
skos:definition "A special class of lexical entities."@en ;
|
|
2604
|
+
a owl:Class ;
|
|
2605
|
+
owl:disjointWith skos:Concept , skos:Collection , skos:ConceptScheme ;
|
|
2606
|
+
rdfs:subClassOf _:node17168m7qhx2 .
|
|
2607
|
+
|
|
2608
|
+
_:node17168m7qhx2 a owl:Restriction ;
|
|
2609
|
+
owl:onProperty <http://www.w3.org/2008/05/skos-xl#literalForm> ;
|
|
2610
|
+
owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#nonNegativeInteger> .
|
|
2611
|
+
|
|
2612
|
+
<http://www.w3.org/2008/05/skos-xl#literalForm> rdfs:label "literal form"@en ;
|
|
2613
|
+
rdfs:isDefinedBy <http://www.w3.org/2008/05/skos-xl> ;
|
|
2614
|
+
skos:definition "The property skosxl:literalForm is used to give the literal form of an skosxl:Label."@en ;
|
|
2615
|
+
rdfs:comment "If two instances of the class skosxl:Label have the same literal form, they are not necessarily the same resource."@en ;
|
|
2616
|
+
a owl:DatatypeProperty ;
|
|
2617
|
+
rdfs:domain <http://www.w3.org/2008/05/skos-xl#Label> ;
|
|
2618
|
+
rdfs:comment "The range of skosxl:literalForm is the class of RDF plain literals."@en ;
|
|
2619
|
+
a rdf:Property .
|
|
2620
|
+
|
|
2621
|
+
<http://www.w3.org/2008/05/skos-xl#prefLabel> rdfs:label "preferred label"@en ;
|
|
2622
|
+
rdfs:isDefinedBy <http://www.w3.org/2008/05/skos-xl> ;
|
|
2623
|
+
skos:definition "The property skosxl:prefLabel is used to associate an skosxl:Label with a skos:Concept. The property is analogous to skos:prefLabel."@en ;
|
|
2624
|
+
rdfs:seeAlso skos:prefLabel ;
|
|
2625
|
+
a owl:ObjectProperty ;
|
|
2626
|
+
rdfs:range <http://www.w3.org/2008/05/skos-xl#Label> ;
|
|
2627
|
+
rdfs:comment "If C skosxl:prefLabel L and L skosxl:literalForm V, then X skos:prefLabel V."@en ;
|
|
2628
|
+
a rdf:Property .
|
|
2629
|
+
|
|
2630
|
+
<http://www.w3.org/2008/05/skos-xl#altLabel> rdfs:label "alternative label"@en ;
|
|
2631
|
+
rdfs:isDefinedBy <http://www.w3.org/2008/05/skos-xl> ;
|
|
2632
|
+
skos:definition "The property skosxl:altLabel is used to associate an skosxl:Label with a skos:Concept. The property is analogous to skos:altLabel."@en ;
|
|
2633
|
+
rdfs:seeAlso skos:altLabel ;
|
|
2634
|
+
a owl:ObjectProperty ;
|
|
2635
|
+
rdfs:range <http://www.w3.org/2008/05/skos-xl#Label> ;
|
|
2636
|
+
rdfs:comment "If C skosxl:altLabel L and L skosxl:literalForm V, then X skos:altLabel V."@en ;
|
|
2637
|
+
a rdf:Property .
|
|
2638
|
+
|
|
2639
|
+
<http://www.w3.org/2008/05/skos-xl#hiddenLabel> rdfs:label "hidden label"@en ;
|
|
2640
|
+
rdfs:isDefinedBy <http://www.w3.org/2008/05/skos-xl> ;
|
|
2641
|
+
skos:definition "The property skosxl:hiddenLabel is used to associate an skosxl:Label with a skos:Concept. The property is analogous to skos:hiddenLabel."@en ;
|
|
2642
|
+
rdfs:seeAlso skos:hiddenLabel ;
|
|
2643
|
+
a owl:ObjectProperty ;
|
|
2644
|
+
rdfs:range <http://www.w3.org/2008/05/skos-xl#Label> ;
|
|
2645
|
+
rdfs:comment "If C skosxl:hiddenLabel L and L skosxl:literalForm V, then C skos:hiddenLabel V."@en ;
|
|
2646
|
+
a rdf:Property .
|
|
2647
|
+
|
|
2648
|
+
<http://www.w3.org/2008/05/skos-xl#labelRelation> rdfs:label "label relation"@en ;
|
|
2649
|
+
rdfs:isDefinedBy <http://www.w3.org/2008/05/skos-xl> ;
|
|
2650
|
+
skos:definition "The property skosxl:labelRelation is used for representing binary ('direct') relations between instances of the class skosxl:Label."@en ;
|
|
2651
|
+
skos:scopeNote "skosxl:labelRelation is not intended to be used directly, but rather as the basis for a design pattern which can be refined for more specific labeling scenarios."@en ;
|
|
2652
|
+
a owl:ObjectProperty ;
|
|
2653
|
+
rdfs:domain <http://www.w3.org/2008/05/skos-xl#Label> ;
|
|
2654
|
+
rdfs:range <http://www.w3.org/2008/05/skos-xl#Label> ;
|
|
2655
|
+
a owl:SymmetricProperty , rdf:Property .
|
|
2656
|
+
`;
|
|
2587
2657
|
exports.skos = `@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
2588
2658
|
@prefix dc: <http://purl.org/dc/terms/> .
|
|
2589
2659
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src.js","sourceRoot":"","sources":["../../src/ontologies/src.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgoDjB,CAAC;AAEW,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEtB,CAAC;AAEW,QAAA,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4CAqRwB,CAAC;AAEhC,QAAA,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uKA+EoJ,CAAC"}
|
package/out/ontologies/xsd.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as n3 from "n3";
|
|
2
|
+
/** Namespace URI of the XSD vocabulary. */
|
|
3
|
+
export declare const _XSD = "http://www.w3.org/2001/XMLSchema#";
|
|
2
4
|
export declare const XSD: {
|
|
3
5
|
/** anyURI represents an Internationalized Resource Identifier Reference (IRI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be an IRI Reference). This type should be used when the value fulfills the role of an IRI, as defined in [RFC 3987] or its successor(s) in the IETF Standards Track. */
|
|
4
6
|
anyURI: string;
|
|
@@ -48,6 +50,8 @@ export declare const XSD: {
|
|
|
48
50
|
/** unsignedByte is ·derived· from unsignedShort by setting the value of ·maxInclusive· to be 255. The ·base type· of unsignedByte is unsignedShort. */
|
|
49
51
|
usignedByte: string;
|
|
50
52
|
};
|
|
53
|
+
/** Namespace URI of the xsd vocabulary. */
|
|
54
|
+
export declare const _xsd: n3.NamedNode<"http://www.w3.org/2001/XMLSchema#">;
|
|
51
55
|
export declare const xsd: {
|
|
52
56
|
/** anyURI represents an Internationalized Resource Identifier Reference (IRI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be an IRI Reference). This type should be used when the value fulfills the role of an IRI, as defined in [RFC 3987] or its successor(s) in the IETF Standards Track. */
|
|
53
57
|
anyURI: n3.NamedNode<"http://www.w3.org/2001/XMLSchema#anyURI">;
|
package/out/ontologies/xsd.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.xsd = exports.XSD = void 0;
|
|
3
|
+
exports.xsd = exports._xsd = exports.XSD = exports._XSD = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const n3 = tslib_1.__importStar(require("n3"));
|
|
6
|
+
/** Namespace URI of the XSD vocabulary. */
|
|
7
|
+
exports._XSD = 'http://www.w3.org/2001/XMLSchema#';
|
|
6
8
|
exports.XSD = {
|
|
7
9
|
/** anyURI represents an Internationalized Resource Identifier Reference (IRI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be an IRI Reference). This type should be used when the value fulfills the role of an IRI, as defined in [RFC 3987] or its successor(s) in the IETF Standards Track. */
|
|
8
10
|
'anyURI': 'http://www.w3.org/2001/XMLSchema#anyURI',
|
|
@@ -52,6 +54,8 @@ exports.XSD = {
|
|
|
52
54
|
/** unsignedByte is ·derived· from unsignedShort by setting the value of ·maxInclusive· to be 255. The ·base type· of unsignedByte is unsignedShort. */
|
|
53
55
|
'usignedByte': 'http://www.w3.org/2001/XMLSchema#usignedByte',
|
|
54
56
|
};
|
|
57
|
+
/** Namespace URI of the xsd vocabulary. */
|
|
58
|
+
exports._xsd = new n3.NamedNode('http://www.w3.org/2001/XMLSchema#');
|
|
55
59
|
exports.xsd = {
|
|
56
60
|
/** anyURI represents an Internationalized Resource Identifier Reference (IRI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be an IRI Reference). This type should be used when the value fulfills the role of an IRI, as defined in [RFC 3987] or its successor(s) in the IETF Standards Track. */
|
|
57
61
|
'anyURI': new n3.NamedNode('http://www.w3.org/2001/XMLSchema#anyURI'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xsd.js","sourceRoot":"","sources":["../../src/ontologies/xsd.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;
|
|
1
|
+
{"version":3,"file":"xsd.js","sourceRoot":"","sources":["../../src/ontologies/xsd.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AAEzB,2CAA2C;AAC9B,QAAA,IAAI,GAAG,mCAAmC,CAAC;AAE3C,QAAA,GAAG,GAAG;IAClB,iWAAiW;IACjW,QAAQ,EAAE,yCAAyC;IACnD,4OAA4O;IAC5O,cAAc,EAAE,+CAA+C;IAC/D,yDAAyD;IACzD,SAAS,EAAE,0CAA0C;IACrD,qJAAqJ;IACrJ,MAAM,EAAE,uCAAuC;IAC/C,gZAAgZ;IAChZ,MAAM,EAAE,uCAAuC;IAC/C,4MAA4M;IAC5M,UAAU,EAAE,2CAA2C;IACvD,4eAA4e;IAC5e,SAAS,EAAE,0CAA0C;IACrD,+RAA+R;IAC/R,QAAQ,EAAE,yCAAyC;IACnD,2LAA2L;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,EAAE,CAAC,SAAS,CAAC,gDAAgD,CAAC;IACnF,mLAAmL;IACnL,cAAc,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,+CAA+C,CAAC;IACjF,wJAAwJ;IACxJ,aAAa,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,8CAA8C,CAAC;CAC/E,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Store } from "./store";
|
|
2
|
-
import { DefinitionQueryOptions,
|
|
2
|
+
import { QueryOptions, DefinitionQueryOptions, TypedInstanceQueryOptions } from "./resource-repository";
|
|
3
3
|
import { ConceptRepository } from "./concept-repository";
|
|
4
4
|
/**
|
|
5
5
|
* A repository for retrieving classes from graphs.
|
|
@@ -48,12 +48,46 @@ export declare class ClassRepository extends ConceptRepository {
|
|
|
48
48
|
*/
|
|
49
49
|
getSubClasses(graphUris: string | string[] | undefined, subjectUri?: string, options?: DefinitionQueryOptions): string[];
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Recursively traverse all sub classes of a given class and invoke a callback.
|
|
52
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
53
|
+
* @param superClass The super class to start the traversal from.
|
|
54
|
+
* @param callback A function to call for each sub class. If the function returns `false`, the traversal stops.
|
|
55
|
+
* @param options Optional query parameters.
|
|
56
|
+
* @param visited A set of visited URIs.
|
|
57
|
+
* @returns `true` if the traversal was completed, `false` if it was stopped by the callback.
|
|
58
|
+
*/
|
|
59
|
+
private _traverseSubClasses;
|
|
60
|
+
/**
|
|
61
|
+
* Get all sub classes of a given class, including indirect sub classes.
|
|
52
62
|
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
53
63
|
* @param subjectUri URI of a class.
|
|
54
|
-
* @param classUri URI of a class.
|
|
55
64
|
* @param options Optional query parameters.
|
|
56
|
-
* @returns
|
|
65
|
+
* @returns An array of all sub classes of the given class.
|
|
66
|
+
*/
|
|
67
|
+
getAllSubClasses(graphUris: string | string[] | undefined, subjectUri: string, options?: DefinitionQueryOptions): string[];
|
|
68
|
+
/**
|
|
69
|
+
* Indicate if there are instances of a given class or any of its sub classes.
|
|
70
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
71
|
+
* @param typeUri URI of the class.
|
|
72
|
+
* @param options Optional query parameters.
|
|
73
|
+
* @returns `true` if the class has instances, `false` otherwise.
|
|
74
|
+
*/
|
|
75
|
+
hasSubjectsOfType(graphUris: string | string[] | undefined, typeUri: string, options?: DefinitionQueryOptions & TypedInstanceQueryOptions): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Get all subjects of a given class in the repository.
|
|
78
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
79
|
+
* @param typeUri URI of the class.
|
|
80
|
+
* @param options Optional query parameters.
|
|
81
|
+
* @returns A list of all shapes in the repository.
|
|
82
|
+
*/
|
|
83
|
+
getSubjectsOfType(graphUris: string | string[] | undefined, typeUri: string, options?: DefinitionQueryOptions & TypedInstanceQueryOptions): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Indicate if a given class is direct or indirect (inferred) sub class of another class.
|
|
86
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
87
|
+
* @param subjectUri URI of the sub class.
|
|
88
|
+
* @param classUri URI of the super class.
|
|
89
|
+
* @param options Optional query parameters.
|
|
90
|
+
* @returns `true` if the class is a sub class of the other class, false otherwise.
|
|
57
91
|
*/
|
|
58
92
|
isSubClassOf(graphUris: string | string[] | undefined, subjectUri: string, classUri: string, options?: DefinitionQueryOptions): boolean;
|
|
59
93
|
/**
|
|
@@ -19,9 +19,8 @@ class ClassRepository extends concept_repository_1.ConceptRepository {
|
|
|
19
19
|
getClasses(graphUris, options) {
|
|
20
20
|
const result = new Set();
|
|
21
21
|
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.rdfs.Class, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
result.add(s.value);
|
|
22
|
+
if (!this.skip(graphUris, q.subject, options)) {
|
|
23
|
+
result.add(q.subject.value);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
return Array.from(result);
|
|
@@ -37,9 +36,8 @@ class ClassRepository extends concept_repository_1.ConceptRepository {
|
|
|
37
36
|
const result = new Set();
|
|
38
37
|
const s = n3.DataFactory.namedNode(subjectUri);
|
|
39
38
|
for (let q of this.store.match(graphUris, s, ontologies_1.rdfs.subClassOf, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
result.add(o.value);
|
|
39
|
+
if (!this.skip(graphUris, q.object, options)) {
|
|
40
|
+
result.add(q.object.value);
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
return Array.from(result);
|
|
@@ -73,8 +71,8 @@ class ClassRepository extends concept_repository_1.ConceptRepository {
|
|
|
73
71
|
*/
|
|
74
72
|
hasSubClasses(graphUris, subjectUri, options) {
|
|
75
73
|
const o = n3.DataFactory.namedNode(subjectUri);
|
|
76
|
-
for (let
|
|
77
|
-
if (!this.skip(graphUris,
|
|
74
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdfs.subClassOf, o)) {
|
|
75
|
+
if (!this.skip(graphUris, q.subject, options)) {
|
|
78
76
|
return true;
|
|
79
77
|
}
|
|
80
78
|
}
|
|
@@ -90,9 +88,8 @@ class ClassRepository extends concept_repository_1.ConceptRepository {
|
|
|
90
88
|
const result = new Set();
|
|
91
89
|
const o = n3.DataFactory.namedNode(subjectUri);
|
|
92
90
|
for (let q of this.store.match(graphUris, null, ontologies_1.rdfs.subClassOf, o, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
result.add(s.value);
|
|
91
|
+
if (!this.skip(graphUris, q.subject, options)) {
|
|
92
|
+
result.add(q.subject.value);
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
return Array.from(result);
|
|
@@ -102,12 +99,97 @@ class ClassRepository extends concept_repository_1.ConceptRepository {
|
|
|
102
99
|
}
|
|
103
100
|
}
|
|
104
101
|
/**
|
|
105
|
-
*
|
|
102
|
+
* Recursively traverse all sub classes of a given class and invoke a callback.
|
|
103
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
104
|
+
* @param superClass The super class to start the traversal from.
|
|
105
|
+
* @param callback A function to call for each sub class. If the function returns `false`, the traversal stops.
|
|
106
|
+
* @param options Optional query parameters.
|
|
107
|
+
* @param visited A set of visited URIs.
|
|
108
|
+
* @returns `true` if the traversal was completed, `false` if it was stopped by the callback.
|
|
109
|
+
*/
|
|
110
|
+
_traverseSubClasses(graphUris, superClass, callback, options, visited = new Set()) {
|
|
111
|
+
// Enumerate all sub classes of the given super class.
|
|
112
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdfs.subClassOf, superClass, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
113
|
+
// If it is not skipped and has not been visited yet, we call the callback function.
|
|
114
|
+
if (!this.skip(graphUris, q.subject, options) && !visited.has(q.subject.value)) {
|
|
115
|
+
visited.add(q.subject.value);
|
|
116
|
+
// If the callback returns false, we stop the traversal.
|
|
117
|
+
if (callback(q.subject)) {
|
|
118
|
+
this._traverseSubClasses(graphUris, q.subject, callback, options, visited);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get all sub classes of a given class, including indirect sub classes.
|
|
106
129
|
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
107
130
|
* @param subjectUri URI of a class.
|
|
108
|
-
* @param classUri URI of a class.
|
|
109
131
|
* @param options Optional query parameters.
|
|
110
|
-
* @returns
|
|
132
|
+
* @returns An array of all sub classes of the given class.
|
|
133
|
+
*/
|
|
134
|
+
getAllSubClasses(graphUris, subjectUri, options) {
|
|
135
|
+
const result = new Set();
|
|
136
|
+
this._traverseSubClasses(graphUris, n3.DataFactory.namedNode(subjectUri), s => { result.add(s.value); return true; }, options);
|
|
137
|
+
return Array.from(result);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Indicate if there are instances of a given class or any of its sub classes.
|
|
141
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
142
|
+
* @param typeUri URI of the class.
|
|
143
|
+
* @param options Optional query parameters.
|
|
144
|
+
* @returns `true` if the class has instances, `false` otherwise.
|
|
145
|
+
*/
|
|
146
|
+
hasSubjectsOfType(graphUris, typeUri, options) {
|
|
147
|
+
// TODO: Optimize implementation.
|
|
148
|
+
return this.getSubjectsOfType(graphUris, typeUri, options).length > 0;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get all subjects of a given class in the repository.
|
|
152
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
153
|
+
* @param typeUri URI of the class.
|
|
154
|
+
* @param options Optional query parameters.
|
|
155
|
+
* @returns A list of all shapes in the repository.
|
|
156
|
+
*/
|
|
157
|
+
getSubjectsOfType(graphUris, typeUri, options) {
|
|
158
|
+
const result = new Set();
|
|
159
|
+
if ((options === null || options === void 0 ? void 0 : options.includeSubTypes) === false) {
|
|
160
|
+
// 1. Get all subclasses of the given type from the repository -> ClassRepository.
|
|
161
|
+
const subclasses = new Set(this.getAllSubClasses(graphUris, typeUri));
|
|
162
|
+
// 2. Then get all triples that have a rdf:type predicate.
|
|
163
|
+
// a) if the object matches the given type, add it to the result.
|
|
164
|
+
// b) if the object is a subclass of the given type, remove it from the result.
|
|
165
|
+
const filtered = new Set();
|
|
166
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
167
|
+
if (q.object.value == typeUri && !this.skip(graphUris, q.subject, options)) {
|
|
168
|
+
result.add(q.subject.value);
|
|
169
|
+
}
|
|
170
|
+
else if (subclasses.has(q.object.value)) {
|
|
171
|
+
filtered.add(q.subject.value);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return Array.from(result).filter(x => !filtered.has(x));
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
// TODO: This does not explicitly check the sublcasses. Implement a unit test.
|
|
178
|
+
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, new n3.NamedNode(typeUri), options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
179
|
+
if (!this.skip(graphUris, q.subject, options)) {
|
|
180
|
+
result.add(q.subject.value);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return Array.from(result);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Indicate if a given class is direct or indirect (inferred) sub class of another class.
|
|
188
|
+
* @param graphUris URIs of the graphs to search, `undefined` for the default graph.
|
|
189
|
+
* @param subjectUri URI of the sub class.
|
|
190
|
+
* @param classUri URI of the super class.
|
|
191
|
+
* @param options Optional query parameters.
|
|
192
|
+
* @returns `true` if the class is a sub class of the other class, false otherwise.
|
|
111
193
|
*/
|
|
112
194
|
isSubClassOf(graphUris, subjectUri, classUri, options) {
|
|
113
195
|
return this.getRootClassPath(graphUris, subjectUri, options).includes(classUri);
|
|
@@ -226,7 +308,7 @@ class ClassRepository extends concept_repository_1.ConceptRepository {
|
|
|
226
308
|
hasIndividuals(graphUris, classUri, options) {
|
|
227
309
|
const s = n3.DataFactory.namedNode(classUri);
|
|
228
310
|
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, s, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
229
|
-
if (q.subject
|
|
311
|
+
if (!this.skip(graphUris, q.subject, options)) {
|
|
230
312
|
return true;
|
|
231
313
|
}
|
|
232
314
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-repository.js","sourceRoot":"","sources":["../../src/rdf/class-repository.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
@@ -21,11 +21,11 @@ class IndividualRepository extends property_repository_1.PropertyRepository {
|
|
|
21
21
|
const result = new Set();
|
|
22
22
|
const subject = subjectUri ? new n3.NamedNode(subjectUri) : null;
|
|
23
23
|
for (const q of this.store.match(graphUris, subject, ontologies_1.rdf.type, ontologies_1.owl.NamedIndividual)) {
|
|
24
|
-
|
|
25
|
-
if (this.skip(graphUris, s, options)) {
|
|
24
|
+
if (this.skip(graphUris, q.subject, options)) {
|
|
26
25
|
continue;
|
|
27
26
|
}
|
|
28
|
-
|
|
27
|
+
// Note: We do not include inferred types here.
|
|
28
|
+
for (const p of this.store.match(graphUris, q.subject, ontologies_1.rdf.type, null, false)) {
|
|
29
29
|
if (p.object.equals(ontologies_1.owl.NamedIndividual)) {
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
@@ -43,12 +43,11 @@ class IndividualRepository extends property_repository_1.PropertyRepository {
|
|
|
43
43
|
getIndividuals(graphUris, typeUri, options) {
|
|
44
44
|
const result = new Set();
|
|
45
45
|
for (const q of this.store.match(graphUris, null, ontologies_1.rdf.type, ontologies_1.owl.NamedIndividual)) {
|
|
46
|
-
|
|
47
|
-
if (this.skip(graphUris, s, options)) {
|
|
46
|
+
if (this.skip(graphUris, q.subject, options)) {
|
|
48
47
|
continue;
|
|
49
48
|
}
|
|
50
|
-
if (!typeUri || this.isInstanceOfType(graphUris,
|
|
51
|
-
result.add(
|
|
49
|
+
if (!typeUri || this.isInstanceOfType(graphUris, q.subject.value, typeUri)) {
|
|
50
|
+
result.add(q.subject.value);
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
return Array.from(result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"individual-repository.js","sourceRoot":"","sources":["../../src/rdf/individual-repository.ts"],"names":[],"mappings":";;;;AAAA,+CAAyB;AACzB,8CAAyC;AAEzC,+DAA2D;AAG3D;;GAEG;AACH,MAAa,oBAAqB,SAAQ,wCAAkB;IACxD,YAAY,KAAY,IAAI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,CAAC,CAAC;QAEvC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,gBAAG,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;YAClE,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;YAEnB,IAAI,CAAC,CAAC,QAAQ,IAAI,WAAW,EAAE;gBAC3B,SAAS;aACZ;YAED,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;gBACrE,OAAO,IAAI,CAAC;aACf;SACJ;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA9ED,oDA8EC"}
|
|
@@ -86,9 +86,9 @@ export declare class PropertyRepository extends ClassRepository {
|
|
|
86
86
|
/**
|
|
87
87
|
* Get the range of a given property.
|
|
88
88
|
* @param propertyUri URI of a property.
|
|
89
|
-
* @returns The URI of the range of the given property. If no range is specified,
|
|
89
|
+
* @returns The URI of the range of the given property. If no range is specified, `undefined` is returned.
|
|
90
90
|
*/
|
|
91
|
-
getRange(graphUris: string | string[] | undefined, propertyUri: string): string;
|
|
91
|
+
getRange(graphUris: string | string[] | undefined, propertyUri: string): string | undefined;
|
|
92
92
|
/**
|
|
93
93
|
* Get all asserted and inferred property types.
|
|
94
94
|
* @param graphUris The URI of the graph or an array of graphs to search for property types.
|
|
@@ -28,11 +28,10 @@ class PropertyRepository extends class_repository_1.ClassRepository {
|
|
|
28
28
|
getProperties(graphUris, options) {
|
|
29
29
|
const result = new Set();
|
|
30
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
|
-
|
|
32
|
-
if (this.skip(graphUris, s, options)) {
|
|
31
|
+
if (this.skip(graphUris, q.subject, options)) {
|
|
33
32
|
continue;
|
|
34
33
|
}
|
|
35
|
-
result.add(
|
|
34
|
+
result.add(q.subject.value);
|
|
36
35
|
}
|
|
37
36
|
return Array.from(result);
|
|
38
37
|
}
|
|
@@ -46,13 +45,11 @@ class PropertyRepository extends class_repository_1.ClassRepository {
|
|
|
46
45
|
const result = new Set();
|
|
47
46
|
const type = new n3.NamedNode(typeUri);
|
|
48
47
|
for (let q of this.store.match(graphUris, null, ontologies_1.rdf.type, type, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
49
|
-
|
|
50
|
-
if (this.skip(graphUris, s, options)) {
|
|
48
|
+
if (this.skip(graphUris, q.subject, options)) {
|
|
51
49
|
continue;
|
|
52
50
|
}
|
|
53
51
|
let hasSuperProperty = false;
|
|
54
|
-
for (let q2 of this.store.match(graphUris,
|
|
55
|
-
const o2 = q2.object;
|
|
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)) {
|
|
56
53
|
// Note: We have not skipped the property so it is relevant for our result. However, if we want
|
|
57
54
|
// to include referenced properties, then we include the referenced super property instead of the
|
|
58
55
|
// current one.
|
|
@@ -60,7 +57,7 @@ class PropertyRepository extends class_repository_1.ClassRepository {
|
|
|
60
57
|
// We must assume that the referenced super property is of the same type as the given type or a super type of it.
|
|
61
58
|
result.add(q2.object.value);
|
|
62
59
|
}
|
|
63
|
-
else if (this.skip(graphUris,
|
|
60
|
+
else if (this.skip(graphUris, q2.object, options)) {
|
|
64
61
|
// If the super property is skipped, then we ignore it.
|
|
65
62
|
continue;
|
|
66
63
|
}
|
|
@@ -72,13 +69,13 @@ class PropertyRepository extends class_repository_1.ClassRepository {
|
|
|
72
69
|
}
|
|
73
70
|
if (typeUri === ontologies_1.RDF.Property && (options === null || options === void 0 ? void 0 : options.includeInferred) === false) {
|
|
74
71
|
// In the case of rdf:Property, we do not want to include properties that have a more specific type.
|
|
75
|
-
const t = Array.from(this.store.match(graphUris,
|
|
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);
|
|
76
73
|
if (new Set(t).size == 1) {
|
|
77
|
-
result.add(
|
|
74
|
+
result.add(q.subject.value);
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
77
|
else {
|
|
81
|
-
result.add(
|
|
78
|
+
result.add(q.subject.value);
|
|
82
79
|
}
|
|
83
80
|
}
|
|
84
81
|
return Array.from(result);
|
|
@@ -93,11 +90,10 @@ class PropertyRepository extends class_repository_1.ClassRepository {
|
|
|
93
90
|
const result = [];
|
|
94
91
|
const s = n3.DataFactory.namedNode(subjectUri);
|
|
95
92
|
for (let q of this.store.match(graphUris, s, ontologies_1.rdfs.subPropertyOf, null, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
96
|
-
|
|
97
|
-
if (this.skip(graphUris, o, options)) {
|
|
93
|
+
if (this.skip(graphUris, q.object, options)) {
|
|
98
94
|
continue;
|
|
99
95
|
}
|
|
100
|
-
result.push(
|
|
96
|
+
result.push(q.object.value);
|
|
101
97
|
}
|
|
102
98
|
return result;
|
|
103
99
|
}
|
|
@@ -133,8 +129,8 @@ class PropertyRepository extends class_repository_1.ClassRepository {
|
|
|
133
129
|
*/
|
|
134
130
|
hasSubProperties(graphUris, subjectUri, options) {
|
|
135
131
|
const o = n3.DataFactory.namedNode(subjectUri);
|
|
136
|
-
for (let
|
|
137
|
-
if (!this.skip(graphUris,
|
|
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)) {
|
|
138
134
|
return true;
|
|
139
135
|
}
|
|
140
136
|
}
|
|
@@ -151,11 +147,10 @@ class PropertyRepository extends class_repository_1.ClassRepository {
|
|
|
151
147
|
const result = new Set();
|
|
152
148
|
const o = n3.DataFactory.namedNode(subjectUri);
|
|
153
149
|
for (let q of this.store.match(graphUris, null, ontologies_1.rdfs.subPropertyOf, o, options === null || options === void 0 ? void 0 : options.includeInferred)) {
|
|
154
|
-
|
|
155
|
-
if (this.skip(graphUris, s, options)) {
|
|
150
|
+
if (this.skip(graphUris, q.subject, options)) {
|
|
156
151
|
continue;
|
|
157
152
|
}
|
|
158
|
-
result.add(
|
|
153
|
+
result.add(q.subject.value);
|
|
159
154
|
}
|
|
160
155
|
return Array.from(result);
|
|
161
156
|
}
|
|
@@ -222,14 +217,14 @@ class PropertyRepository extends class_repository_1.ClassRepository {
|
|
|
222
217
|
/**
|
|
223
218
|
* Get the range of a given property.
|
|
224
219
|
* @param propertyUri URI of a property.
|
|
225
|
-
* @returns The URI of the range of the given property. If no range is specified,
|
|
220
|
+
* @returns The URI of the range of the given property. If no range is specified, `undefined` is returned.
|
|
226
221
|
*/
|
|
227
222
|
getRange(graphUris, propertyUri) {
|
|
228
223
|
const s = n3.DataFactory.namedNode(propertyUri);
|
|
229
224
|
for (let q of this.store.match(graphUris, s, this.rangePredicate, null)) {
|
|
230
225
|
return q.object.value;
|
|
231
226
|
}
|
|
232
|
-
return
|
|
227
|
+
return undefined;
|
|
233
228
|
}
|
|
234
229
|
/**
|
|
235
230
|
* Get all asserted and inferred property types.
|