@faubulous/mentor-rdf 2.2.0 → 2.2.2
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/dist/index.js +149 -58
- package/dist/index.js.map +3 -3
- package/dist/rdf/reasoners/rdfs-reasoner.d.ts +38 -0
- package/dist/rdf/utils.d.ts +7 -2
- package/package.json +1 -1
|
@@ -9,10 +9,35 @@ export declare class RdfsReasoner extends SkosReasoner {
|
|
|
9
9
|
protected classes: Set<string>;
|
|
10
10
|
protected properties: Set<string>;
|
|
11
11
|
protected individuals: Set<rdfjs.Quad_Subject>;
|
|
12
|
+
/**
|
|
13
|
+
* The super properties of each property, as asserted with `rdfs:subPropertyOf`.
|
|
14
|
+
*/
|
|
15
|
+
private readonly _superProperties;
|
|
16
|
+
/**
|
|
17
|
+
* The ranges asserted for each property.
|
|
18
|
+
*/
|
|
19
|
+
private readonly _ranges;
|
|
20
|
+
/**
|
|
21
|
+
* The domains asserted for each property.
|
|
22
|
+
*/
|
|
23
|
+
private readonly _domains;
|
|
12
24
|
constructor(targetUriGenerator?: GraphUriGenerator);
|
|
13
25
|
protected isIgnoredNode(term: rdfjs.Quad_Subject | rdfjs.Quad_Object): boolean;
|
|
14
26
|
protected isClass(id: string): boolean;
|
|
15
27
|
protected afterInference(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Infers the ranges and domains that properties inherit from their super properties
|
|
30
|
+
* (OWL 2 RL rules scm-rng2 and scm-dom2), following `rdfs:subPropertyOf` chains.
|
|
31
|
+
*/
|
|
32
|
+
private _inferInheritedRangesAndDomains;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the transitive super properties of a property, nearest first. Cycles in the
|
|
35
|
+
* property hierarchy are followed only once.
|
|
36
|
+
* @param property The IRI or blank node id of a property.
|
|
37
|
+
* @param superProperties The direct super properties of the property.
|
|
38
|
+
* @returns The IRIs of all super properties, excluding the property itself.
|
|
39
|
+
*/
|
|
40
|
+
private _getAncestorProperties;
|
|
16
41
|
protected resetState(): void;
|
|
17
42
|
applyInference(quad: rdfjs.Quad): void;
|
|
18
43
|
protected assertClass(subject: rdfjs.Quad_Subject): void;
|
|
@@ -25,4 +50,17 @@ export declare class RdfsReasoner extends SkosReasoner {
|
|
|
25
50
|
*/
|
|
26
51
|
protected assertPropertyFromUsage(predicate: rdfjs.Quad_Predicate): void;
|
|
27
52
|
protected inferPropertyAxioms(quad: rdfjs.Quad): void;
|
|
53
|
+
/**
|
|
54
|
+
* Records that a property is a sub property of another property.
|
|
55
|
+
* @param property The sub property.
|
|
56
|
+
* @param superProperty The super property.
|
|
57
|
+
*/
|
|
58
|
+
private _addSuperProperty;
|
|
59
|
+
/**
|
|
60
|
+
* Adds a value to the list stored under a key.
|
|
61
|
+
* @param map The map of lists.
|
|
62
|
+
* @param key The key of the list.
|
|
63
|
+
* @param value The value to add.
|
|
64
|
+
*/
|
|
65
|
+
private _addToList;
|
|
28
66
|
}
|
package/dist/rdf/utils.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import * as rdfjs from "@rdfjs/types";
|
|
2
|
-
import * as rdflib from "rdflib";
|
|
2
|
+
import type * as rdflib from "rdflib";
|
|
3
3
|
/**
|
|
4
4
|
* Converts an rdflib term to an RDFJS term.
|
|
5
5
|
* @param term The rdflib term to convert.
|
|
6
6
|
* @returns The corresponding RDFJS term.
|
|
7
7
|
*/
|
|
8
8
|
export declare const toRdfjsTerm: (term: rdflib.Node) => rdfjs.Term;
|
|
9
|
+
/**
|
|
10
|
+
* The rdflib module. It is loaded on demand, so its functions are passed in.
|
|
11
|
+
*/
|
|
12
|
+
export type Rdflib = typeof rdflib;
|
|
9
13
|
/**
|
|
10
14
|
* Converts an RDFJS term to an rdflib term adding compareTerm methods required by rdflib serializers.
|
|
11
15
|
* @param term The RDFJS term to convert.
|
|
16
|
+
* @param rdflib The rdflib module.
|
|
12
17
|
* @returns The corresponding rdflib term.
|
|
13
18
|
*/
|
|
14
|
-
export declare const toRdflibTerm: (term: rdfjs.Term) => rdflib.Literal | rdflib.NamedNode | rdflib.BlankNode;
|
|
19
|
+
export declare const toRdflibTerm: (term: rdfjs.Term, rdflib: Rdflib) => rdflib.Literal | rdflib.NamedNode | rdflib.BlankNode;
|