@kanonak-protocol/types 4.13.0 → 4.14.0
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.
|
@@ -67,14 +67,6 @@ export interface ResourceResolver {
|
|
|
67
67
|
* Clears cache for a specific document.
|
|
68
68
|
*/
|
|
69
69
|
clearCache(documentKey: string): void;
|
|
70
|
-
/**
|
|
71
|
-
* Checks if a class is a subclass of another class (direct or transitive)
|
|
72
|
-
*/
|
|
73
|
-
isSubclassOfAsync(className: string, parentClassName: string, document: KanonakDocument): Promise<boolean>;
|
|
74
|
-
/**
|
|
75
|
-
* Checks if a property is a subproperty of another property (direct or transitive)
|
|
76
|
-
*/
|
|
77
|
-
isSubpropertyOfAsync(propertyName: string, parentPropertyName: string, document: KanonakDocument): Promise<boolean>;
|
|
78
70
|
}
|
|
79
71
|
/**
|
|
80
72
|
* Classifies Kanonak resources by their semantic type (Class, Property, Instance, etc.). This is the canonical source of truth for resource type classification. Uses resolved KanonakUri, NOT document-scoped aliases.
|
|
@@ -3,6 +3,17 @@ import { KanonakDocument } from '../../../../document/models/types';
|
|
|
3
3
|
import { KanonakUri } from '../../../../object/uris/types';
|
|
4
4
|
import { IRepositoryValidationRule } from '../../../../object/validation/rules/repository/index';
|
|
5
5
|
import { OntologyValidationError } from '../../../../object/validation/types';
|
|
6
|
+
/**
|
|
7
|
+
* Validates that a property's declared kind matches the nature of its range: a
|
|
8
|
+
* DatatypeProperty must range over a datatype (xsd type, rdfs.Literal, or a
|
|
9
|
+
* datatype-derived class), an ObjectProperty over a plain class. The nature is
|
|
10
|
+
* decided by walking the range's subClassOf chain (a datatype-derived class is
|
|
11
|
+
* datatype-valued even though rdfs.Datatype is a kind of rdfs.Class).
|
|
12
|
+
*/
|
|
13
|
+
export interface PropertyKindRangeConsistencyRule extends IRepositoryValidationRule {
|
|
14
|
+
readonly ruleName: string;
|
|
15
|
+
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
16
|
+
}
|
|
6
17
|
/**
|
|
7
18
|
* Validates that references to entities or properties are unambiguous. When multiple imports define the same entity/property name, namespace aliases MUST be used to disambiguate (e.g., 'people.name' vs 'heroes.name'). When only one source defines an entity, aliases are optional. Design Philosophy: - Aliases are document-scoped only (not transitive) - Aliases are required ONLY when ambiguity exists - Aliases are optional when references are unambiguous
|
|
8
19
|
*/
|
|
@@ -24,13 +35,6 @@ export interface ClassHierarchyCycleRule extends IRepositoryValidationRule {
|
|
|
24
35
|
readonly ruleName: string;
|
|
25
36
|
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
26
37
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Validates that properties used on Class and Property definitions are actually defined. When a class or property definition uses a property (e.g., "icon: ✅"), this rule ensures that the property "icon" is defined as an ObjectProperty or DatatypeProperty either locally or in imported namespaces.
|
|
29
|
-
*/
|
|
30
|
-
export interface DefinitionPropertyReferenceRule extends IRepositoryValidationRule {
|
|
31
|
-
readonly ruleName: string;
|
|
32
|
-
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
33
|
-
}
|
|
34
38
|
export interface ImportErrorDetails {
|
|
35
39
|
message: string;
|
|
36
40
|
suggestion: string;
|
|
@@ -57,13 +61,6 @@ export interface NamespaceImportCycleRule extends IRepositoryValidationRule {
|
|
|
57
61
|
readonly ruleName: string;
|
|
58
62
|
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
59
63
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Validates that namespaces for ObjectProperty range classes are imported
|
|
62
|
-
*/
|
|
63
|
-
export interface ObjectPropertyImportRule extends IRepositoryValidationRule {
|
|
64
|
-
readonly ruleName: string;
|
|
65
|
-
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
66
|
-
}
|
|
67
64
|
/**
|
|
68
65
|
* Validates that ALL ObjectProperty values point to existing entities. Uses TypeResolver to determine which properties are ObjectProperties (explicit or inferred from range).
|
|
69
66
|
*/
|
|
@@ -104,13 +101,6 @@ export interface PropertyRangeRequiredRule extends IRepositoryValidationRule {
|
|
|
104
101
|
readonly ruleName: string;
|
|
105
102
|
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
106
103
|
}
|
|
107
|
-
/**
|
|
108
|
-
* Validates that instance property values match their declared property types and ranges. Prevents setting complex objects on DatatypeProperties and ensures ObjectProperty values are valid.
|
|
109
|
-
*/
|
|
110
|
-
export interface PropertyValueTypeRule extends IRepositoryValidationRule {
|
|
111
|
-
readonly ruleName: string;
|
|
112
|
-
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
113
|
-
}
|
|
114
104
|
/**
|
|
115
105
|
* Validates that subClassOf references point to existing classes
|
|
116
106
|
*/
|
|
@@ -139,10 +129,3 @@ export interface UnresolvedReferenceRule extends IRepositoryValidationRule {
|
|
|
139
129
|
readonly ruleName: string;
|
|
140
130
|
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
141
131
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Validates that XSD namespace is imported when DatatypeProperty uses XSD types
|
|
144
|
-
*/
|
|
145
|
-
export interface XsdImportRule extends IRepositoryValidationRule {
|
|
146
|
-
readonly ruleName: string;
|
|
147
|
-
validateAsync(document: KanonakDocument, repository: IKanonakDocumentRepository): Promise<Array<OntologyValidationError>>;
|
|
148
|
-
}
|