@oml/language 0.18.0 → 0.19.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.
- package/out/oml/generated/ast.d.ts +178 -8
- package/out/oml/generated/ast.js +140 -0
- package/out/oml/generated/ast.js.map +1 -1
- package/out/oml/generated/grammar.js +1073 -375
- package/out/oml/generated/grammar.js.map +1 -1
- package/out/oml/oml-index.d.ts +35 -0
- package/out/oml/oml-index.js +185 -1
- package/out/oml/oml-index.js.map +1 -1
- package/out/oml/oml-serializer.js +14 -9
- package/out/oml/oml-serializer.js.map +1 -1
- package/out/oml/oml-update.js +60 -9
- package/out/oml/oml-update.js.map +1 -1
- package/out/oml/oml-validator.d.ts +9 -1
- package/out/oml/oml-validator.js +224 -3
- package/out/oml/oml-validator.js.map +1 -1
- package/package.json +1 -1
- package/src/oml/generated/ast.ts +198 -7
- package/src/oml/generated/grammar.ts +1073 -375
- package/src/oml/oml-index.ts +208 -1
- package/src/oml/oml-serializer.ts +15 -9
- package/src/oml/oml-update.ts +70 -9
- package/src/oml/oml-validator.ts +232 -5
- package/src/oml/oml.langium +39 -7
package/src/oml/generated/ast.ts
CHANGED
|
@@ -49,6 +49,7 @@ export type OmlKeywordNames =
|
|
|
49
49
|
| "concept"
|
|
50
50
|
| "description"
|
|
51
51
|
| "differentFrom"
|
|
52
|
+
| "dimension"
|
|
52
53
|
| "domain"
|
|
53
54
|
| "entity"
|
|
54
55
|
| "exactly"
|
|
@@ -67,13 +68,16 @@ export type OmlKeywordNames =
|
|
|
67
68
|
| "maxExclusive"
|
|
68
69
|
| "maxInclusive"
|
|
69
70
|
| "maxLength"
|
|
71
|
+
| "measures"
|
|
70
72
|
| "min"
|
|
71
73
|
| "minExclusive"
|
|
72
74
|
| "minInclusive"
|
|
73
75
|
| "minLength"
|
|
76
|
+
| "multiplier"
|
|
74
77
|
| "oneOf"
|
|
75
78
|
| "pattern"
|
|
76
79
|
| "property"
|
|
80
|
+
| "quantity"
|
|
77
81
|
| "range"
|
|
78
82
|
| "ref"
|
|
79
83
|
| "reflexive"
|
|
@@ -85,9 +89,11 @@ export type OmlKeywordNames =
|
|
|
85
89
|
| "scalar"
|
|
86
90
|
| "self"
|
|
87
91
|
| "some"
|
|
92
|
+
| "symbol"
|
|
88
93
|
| "symmetric"
|
|
89
94
|
| "to"
|
|
90
95
|
| "transitive"
|
|
96
|
+
| "unit"
|
|
91
97
|
| "uses"
|
|
92
98
|
| "vocabulary"
|
|
93
99
|
| "{"
|
|
@@ -96,7 +102,7 @@ export type OmlKeywordNames =
|
|
|
96
102
|
export type OmlTokenNames = OmlTerminalNames | OmlKeywordNames;
|
|
97
103
|
|
|
98
104
|
export interface Annotation extends langium.AstNode {
|
|
99
|
-
readonly $container: AnnotationProperty | Aspect | BuiltIn | Concept | ConceptInstance | Description | DescriptionBundle | ForwardRelation | RelationEntity | RelationInstance | ReverseRelation | Rule | Scalar | ScalarProperty | UnreifiedRelation | Vocabulary | VocabularyBundle;
|
|
105
|
+
readonly $container: AnnotationProperty | Aspect | BuiltIn | Concept | ConceptInstance | Description | DescriptionBundle | ForwardRelation | Quantity | QuantityProperty | RelationEntity | RelationInstance | ReverseRelation | Rule | Scalar | ScalarProperty | Unit | UnreifiedRelation | Vocabulary | VocabularyBundle;
|
|
100
106
|
readonly $type: 'Annotation';
|
|
101
107
|
literalValues: Array<Literal>;
|
|
102
108
|
property: langium.Reference<AnnotationProperty>;
|
|
@@ -387,11 +393,13 @@ export function isDecimal(item: unknown): item is Decimal {
|
|
|
387
393
|
export interface DecimalLiteral extends langium.AstNode {
|
|
388
394
|
readonly $container: Annotation | Argument | LiteralEnumerationAxiom | PropertyValueAssertion | PropertyValueRestrictionAxiom | ScalarEquivalenceAxiom;
|
|
389
395
|
readonly $type: 'DecimalLiteral';
|
|
396
|
+
unit?: langium.Reference<Unit>;
|
|
390
397
|
value: Decimal;
|
|
391
398
|
}
|
|
392
399
|
|
|
393
400
|
export const DecimalLiteral = {
|
|
394
401
|
$type: 'DecimalLiteral',
|
|
402
|
+
unit: 'unit',
|
|
395
403
|
value: 'value'
|
|
396
404
|
} as const;
|
|
397
405
|
|
|
@@ -497,11 +505,13 @@ export function isDouble(item: unknown): item is Double {
|
|
|
497
505
|
export interface DoubleLiteral extends langium.AstNode {
|
|
498
506
|
readonly $container: Annotation | Argument | LiteralEnumerationAxiom | PropertyValueAssertion | PropertyValueRestrictionAxiom | ScalarEquivalenceAxiom;
|
|
499
507
|
readonly $type: 'DoubleLiteral';
|
|
508
|
+
unit?: langium.Reference<Unit>;
|
|
500
509
|
value: Double;
|
|
501
510
|
}
|
|
502
511
|
|
|
503
512
|
export const DoubleLiteral = {
|
|
504
513
|
$type: 'DoubleLiteral',
|
|
514
|
+
unit: 'unit',
|
|
505
515
|
value: 'value'
|
|
506
516
|
} as const;
|
|
507
517
|
|
|
@@ -642,11 +652,13 @@ export function isInteger(item: unknown): item is Integer {
|
|
|
642
652
|
export interface IntegerLiteral extends langium.AstNode {
|
|
643
653
|
readonly $container: Annotation | Argument | LiteralEnumerationAxiom | PropertyValueAssertion | PropertyValueRestrictionAxiom | ScalarEquivalenceAxiom;
|
|
644
654
|
readonly $type: 'IntegerLiteral';
|
|
655
|
+
unit?: langium.Reference<Unit>;
|
|
645
656
|
value: Integer;
|
|
646
657
|
}
|
|
647
658
|
|
|
648
659
|
export const IntegerLiteral = {
|
|
649
660
|
$type: 'IntegerLiteral',
|
|
661
|
+
unit: 'unit',
|
|
650
662
|
value: 'value'
|
|
651
663
|
} as const;
|
|
652
664
|
|
|
@@ -766,7 +778,7 @@ export function isPropertyCardinalityRestrictionAxiom(item: unknown): item is Pr
|
|
|
766
778
|
}
|
|
767
779
|
|
|
768
780
|
export interface PropertyEquivalenceAxiom extends langium.AstNode {
|
|
769
|
-
readonly $container: AnnotationProperty | ScalarProperty | UnreifiedRelation;
|
|
781
|
+
readonly $container: AnnotationProperty | QuantityProperty | ScalarProperty | UnreifiedRelation;
|
|
770
782
|
readonly $type: 'PropertyEquivalenceAxiom';
|
|
771
783
|
superTerms: Array<langium.Reference<Property>>;
|
|
772
784
|
}
|
|
@@ -885,6 +897,56 @@ export function isPropertyValueRestrictionAxiom(item: unknown): item is Property
|
|
|
885
897
|
return reflection.isInstance(item, PropertyValueRestrictionAxiom.$type);
|
|
886
898
|
}
|
|
887
899
|
|
|
900
|
+
export interface Quantity extends langium.AstNode {
|
|
901
|
+
readonly $container: Vocabulary;
|
|
902
|
+
readonly $type: 'Quantity';
|
|
903
|
+
dimension?: string;
|
|
904
|
+
name?: string;
|
|
905
|
+
ownedAnnotations: Array<Annotation>;
|
|
906
|
+
ref?: langium.Reference<Quantity>;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
export const Quantity = {
|
|
910
|
+
$type: 'Quantity',
|
|
911
|
+
dimension: 'dimension',
|
|
912
|
+
name: 'name',
|
|
913
|
+
ownedAnnotations: 'ownedAnnotations',
|
|
914
|
+
ref: 'ref'
|
|
915
|
+
} as const;
|
|
916
|
+
|
|
917
|
+
export function isQuantity(item: unknown): item is Quantity {
|
|
918
|
+
return reflection.isInstance(item, Quantity.$type);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
export interface QuantityProperty extends langium.AstNode {
|
|
922
|
+
readonly $container: Vocabulary;
|
|
923
|
+
readonly $type: 'QuantityProperty';
|
|
924
|
+
domains: Array<langium.Reference<Entity>>;
|
|
925
|
+
functional: boolean;
|
|
926
|
+
kind: Array<langium.Reference<Quantity>>;
|
|
927
|
+
name?: string;
|
|
928
|
+
ownedAnnotations: Array<Annotation>;
|
|
929
|
+
ownedEquivalences: Array<PropertyEquivalenceAxiom>;
|
|
930
|
+
ownedSpecializations: Array<SpecializationAxiom>;
|
|
931
|
+
ref?: langium.Reference<QuantityProperty>;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
export const QuantityProperty = {
|
|
935
|
+
$type: 'QuantityProperty',
|
|
936
|
+
domains: 'domains',
|
|
937
|
+
functional: 'functional',
|
|
938
|
+
kind: 'kind',
|
|
939
|
+
name: 'name',
|
|
940
|
+
ownedAnnotations: 'ownedAnnotations',
|
|
941
|
+
ownedEquivalences: 'ownedEquivalences',
|
|
942
|
+
ownedSpecializations: 'ownedSpecializations',
|
|
943
|
+
ref: 'ref'
|
|
944
|
+
} as const;
|
|
945
|
+
|
|
946
|
+
export function isQuantityProperty(item: unknown): item is QuantityProperty {
|
|
947
|
+
return reflection.isInstance(item, QuantityProperty.$type);
|
|
948
|
+
}
|
|
949
|
+
|
|
888
950
|
export interface QuotedLiteral extends langium.AstNode {
|
|
889
951
|
readonly $container: Annotation | Argument | LiteralEnumerationAxiom | PropertyValueAssertion | PropertyValueRestrictionAxiom | ScalarEquivalenceAxiom;
|
|
890
952
|
readonly $type: 'QuotedLiteral';
|
|
@@ -1177,7 +1239,7 @@ export function isScalarProperty(item: unknown): item is ScalarProperty {
|
|
|
1177
1239
|
return reflection.isInstance(item, ScalarProperty.$type);
|
|
1178
1240
|
}
|
|
1179
1241
|
|
|
1180
|
-
export type SemanticProperty = Relation | ScalarProperty;
|
|
1242
|
+
export type SemanticProperty = QuantityProperty | Relation | ScalarProperty;
|
|
1181
1243
|
|
|
1182
1244
|
export const SemanticProperty = {
|
|
1183
1245
|
$type: 'SemanticProperty'
|
|
@@ -1187,7 +1249,7 @@ export function isSemanticProperty(item: unknown): item is SemanticProperty {
|
|
|
1187
1249
|
return reflection.isInstance(item, SemanticProperty.$type);
|
|
1188
1250
|
}
|
|
1189
1251
|
|
|
1190
|
-
export type SpecializableProperty = AnnotationProperty | ScalarProperty | UnreifiedRelation;
|
|
1252
|
+
export type SpecializableProperty = AnnotationProperty | QuantityProperty | ScalarProperty | UnreifiedRelation;
|
|
1191
1253
|
|
|
1192
1254
|
export const SpecializableProperty = {
|
|
1193
1255
|
$type: 'SpecializableProperty'
|
|
@@ -1208,7 +1270,7 @@ export function isSpecializableTerm(item: unknown): item is SpecializableTerm {
|
|
|
1208
1270
|
}
|
|
1209
1271
|
|
|
1210
1272
|
export interface SpecializationAxiom extends langium.AstNode {
|
|
1211
|
-
readonly $container: AnnotationProperty | Aspect | Concept | RelationEntity | Scalar | ScalarProperty | UnreifiedRelation;
|
|
1273
|
+
readonly $container: AnnotationProperty | Aspect | Concept | QuantityProperty | RelationEntity | Scalar | ScalarProperty | UnreifiedRelation;
|
|
1212
1274
|
readonly $type: 'SpecializationAxiom';
|
|
1213
1275
|
superTerm: langium.Reference<Term>;
|
|
1214
1276
|
}
|
|
@@ -1232,7 +1294,7 @@ export function isStatement(item: unknown): item is Statement {
|
|
|
1232
1294
|
return reflection.isInstance(item, Statement.$type);
|
|
1233
1295
|
}
|
|
1234
1296
|
|
|
1235
|
-
export type Term = Property | RelationBase | SpecializableTerm;
|
|
1297
|
+
export type Term = Property | Quantity | RelationBase | SpecializableTerm | Unit;
|
|
1236
1298
|
|
|
1237
1299
|
export const Term = {
|
|
1238
1300
|
$type: 'Term'
|
|
@@ -1294,6 +1356,31 @@ export function isUnaryPredicate(item: unknown): item is UnaryPredicate {
|
|
|
1294
1356
|
return reflection.isInstance(item, UnaryPredicate.$type);
|
|
1295
1357
|
}
|
|
1296
1358
|
|
|
1359
|
+
export interface Unit extends langium.AstNode {
|
|
1360
|
+
readonly $container: Vocabulary;
|
|
1361
|
+
readonly $type: 'Unit';
|
|
1362
|
+
kinds: Array<langium.Reference<Quantity>>;
|
|
1363
|
+
multiplier: Array<Decimal>;
|
|
1364
|
+
name?: string;
|
|
1365
|
+
ownedAnnotations: Array<Annotation>;
|
|
1366
|
+
ref?: langium.Reference<Unit>;
|
|
1367
|
+
symbol: Array<string>;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
export const Unit = {
|
|
1371
|
+
$type: 'Unit',
|
|
1372
|
+
kinds: 'kinds',
|
|
1373
|
+
multiplier: 'multiplier',
|
|
1374
|
+
name: 'name',
|
|
1375
|
+
ownedAnnotations: 'ownedAnnotations',
|
|
1376
|
+
ref: 'ref',
|
|
1377
|
+
symbol: 'symbol'
|
|
1378
|
+
} as const;
|
|
1379
|
+
|
|
1380
|
+
export function isUnit(item: unknown): item is Unit {
|
|
1381
|
+
return reflection.isInstance(item, Unit.$type);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1297
1384
|
export interface UnreifiedRelation extends langium.AstNode {
|
|
1298
1385
|
readonly $container: Vocabulary;
|
|
1299
1386
|
readonly $type: 'UnreifiedRelation';
|
|
@@ -1405,7 +1492,7 @@ export function isVocabularyMember(item: unknown): item is VocabularyMember {
|
|
|
1405
1492
|
return reflection.isInstance(item, VocabularyMember.$type);
|
|
1406
1493
|
}
|
|
1407
1494
|
|
|
1408
|
-
export type VocabularyStatement = BuiltIn | Rule | SpecializableTerm;
|
|
1495
|
+
export type VocabularyStatement = BuiltIn | Quantity | Rule | SpecializableTerm | Unit;
|
|
1409
1496
|
|
|
1410
1497
|
export const VocabularyStatement = {
|
|
1411
1498
|
$type: 'VocabularyStatement'
|
|
@@ -1465,6 +1552,8 @@ export type OmlAstType = {
|
|
|
1465
1552
|
PropertySelfRestrictionAxiom: PropertySelfRestrictionAxiom
|
|
1466
1553
|
PropertyValueAssertion: PropertyValueAssertion
|
|
1467
1554
|
PropertyValueRestrictionAxiom: PropertyValueRestrictionAxiom
|
|
1555
|
+
Quantity: Quantity
|
|
1556
|
+
QuantityProperty: QuantityProperty
|
|
1468
1557
|
QuotedLiteral: QuotedLiteral
|
|
1469
1558
|
Relation: Relation
|
|
1470
1559
|
RelationBase: RelationBase
|
|
@@ -1487,6 +1576,7 @@ export type OmlAstType = {
|
|
|
1487
1576
|
TypeAssertion: TypeAssertion
|
|
1488
1577
|
TypePredicate: TypePredicate
|
|
1489
1578
|
UnaryPredicate: UnaryPredicate
|
|
1579
|
+
Unit: Unit
|
|
1490
1580
|
UnreifiedRelation: UnreifiedRelation
|
|
1491
1581
|
Vocabulary: Vocabulary
|
|
1492
1582
|
VocabularyBox: VocabularyBox
|
|
@@ -1746,6 +1836,10 @@ export class OmlAstReflection extends langium.AbstractAstReflection {
|
|
|
1746
1836
|
DecimalLiteral: {
|
|
1747
1837
|
name: DecimalLiteral.$type,
|
|
1748
1838
|
properties: {
|
|
1839
|
+
unit: {
|
|
1840
|
+
name: DecimalLiteral.unit,
|
|
1841
|
+
referenceType: Unit.$type
|
|
1842
|
+
},
|
|
1749
1843
|
value: {
|
|
1750
1844
|
name: DecimalLiteral.value
|
|
1751
1845
|
}
|
|
@@ -1829,6 +1923,10 @@ export class OmlAstReflection extends langium.AbstractAstReflection {
|
|
|
1829
1923
|
DoubleLiteral: {
|
|
1830
1924
|
name: DoubleLiteral.$type,
|
|
1831
1925
|
properties: {
|
|
1926
|
+
unit: {
|
|
1927
|
+
name: DoubleLiteral.unit,
|
|
1928
|
+
referenceType: Unit.$type
|
|
1929
|
+
},
|
|
1832
1930
|
value: {
|
|
1833
1931
|
name: DoubleLiteral.value
|
|
1834
1932
|
}
|
|
@@ -1923,6 +2021,10 @@ export class OmlAstReflection extends langium.AbstractAstReflection {
|
|
|
1923
2021
|
IntegerLiteral: {
|
|
1924
2022
|
name: IntegerLiteral.$type,
|
|
1925
2023
|
properties: {
|
|
2024
|
+
unit: {
|
|
2025
|
+
name: IntegerLiteral.unit,
|
|
2026
|
+
referenceType: Unit.$type
|
|
2027
|
+
},
|
|
1926
2028
|
value: {
|
|
1927
2029
|
name: IntegerLiteral.value
|
|
1928
2030
|
}
|
|
@@ -2109,6 +2211,65 @@ export class OmlAstReflection extends langium.AbstractAstReflection {
|
|
|
2109
2211
|
},
|
|
2110
2212
|
superTypes: [PropertyRestrictionAxiom.$type]
|
|
2111
2213
|
},
|
|
2214
|
+
Quantity: {
|
|
2215
|
+
name: Quantity.$type,
|
|
2216
|
+
properties: {
|
|
2217
|
+
dimension: {
|
|
2218
|
+
name: Quantity.dimension
|
|
2219
|
+
},
|
|
2220
|
+
name: {
|
|
2221
|
+
name: Quantity.name
|
|
2222
|
+
},
|
|
2223
|
+
ownedAnnotations: {
|
|
2224
|
+
name: Quantity.ownedAnnotations,
|
|
2225
|
+
defaultValue: []
|
|
2226
|
+
},
|
|
2227
|
+
ref: {
|
|
2228
|
+
name: Quantity.ref,
|
|
2229
|
+
referenceType: Quantity.$type
|
|
2230
|
+
}
|
|
2231
|
+
},
|
|
2232
|
+
superTypes: [Term.$type, VocabularyStatement.$type]
|
|
2233
|
+
},
|
|
2234
|
+
QuantityProperty: {
|
|
2235
|
+
name: QuantityProperty.$type,
|
|
2236
|
+
properties: {
|
|
2237
|
+
domains: {
|
|
2238
|
+
name: QuantityProperty.domains,
|
|
2239
|
+
defaultValue: [],
|
|
2240
|
+
referenceType: Entity.$type
|
|
2241
|
+
},
|
|
2242
|
+
functional: {
|
|
2243
|
+
name: QuantityProperty.functional,
|
|
2244
|
+
defaultValue: false
|
|
2245
|
+
},
|
|
2246
|
+
kind: {
|
|
2247
|
+
name: QuantityProperty.kind,
|
|
2248
|
+
defaultValue: [],
|
|
2249
|
+
referenceType: Quantity.$type
|
|
2250
|
+
},
|
|
2251
|
+
name: {
|
|
2252
|
+
name: QuantityProperty.name
|
|
2253
|
+
},
|
|
2254
|
+
ownedAnnotations: {
|
|
2255
|
+
name: QuantityProperty.ownedAnnotations,
|
|
2256
|
+
defaultValue: []
|
|
2257
|
+
},
|
|
2258
|
+
ownedEquivalences: {
|
|
2259
|
+
name: QuantityProperty.ownedEquivalences,
|
|
2260
|
+
defaultValue: []
|
|
2261
|
+
},
|
|
2262
|
+
ownedSpecializations: {
|
|
2263
|
+
name: QuantityProperty.ownedSpecializations,
|
|
2264
|
+
defaultValue: []
|
|
2265
|
+
},
|
|
2266
|
+
ref: {
|
|
2267
|
+
name: QuantityProperty.ref,
|
|
2268
|
+
referenceType: QuantityProperty.$type
|
|
2269
|
+
}
|
|
2270
|
+
},
|
|
2271
|
+
superTypes: [SemanticProperty.$type, SpecializableProperty.$type]
|
|
2272
|
+
},
|
|
2112
2273
|
QuotedLiteral: {
|
|
2113
2274
|
name: QuotedLiteral.$type,
|
|
2114
2275
|
properties: {
|
|
@@ -2507,6 +2668,36 @@ export class OmlAstReflection extends langium.AbstractAstReflection {
|
|
|
2507
2668
|
},
|
|
2508
2669
|
superTypes: [Predicate.$type]
|
|
2509
2670
|
},
|
|
2671
|
+
Unit: {
|
|
2672
|
+
name: Unit.$type,
|
|
2673
|
+
properties: {
|
|
2674
|
+
kinds: {
|
|
2675
|
+
name: Unit.kinds,
|
|
2676
|
+
defaultValue: [],
|
|
2677
|
+
referenceType: Quantity.$type
|
|
2678
|
+
},
|
|
2679
|
+
multiplier: {
|
|
2680
|
+
name: Unit.multiplier,
|
|
2681
|
+
defaultValue: []
|
|
2682
|
+
},
|
|
2683
|
+
name: {
|
|
2684
|
+
name: Unit.name
|
|
2685
|
+
},
|
|
2686
|
+
ownedAnnotations: {
|
|
2687
|
+
name: Unit.ownedAnnotations,
|
|
2688
|
+
defaultValue: []
|
|
2689
|
+
},
|
|
2690
|
+
ref: {
|
|
2691
|
+
name: Unit.ref,
|
|
2692
|
+
referenceType: Unit.$type
|
|
2693
|
+
},
|
|
2694
|
+
symbol: {
|
|
2695
|
+
name: Unit.symbol,
|
|
2696
|
+
defaultValue: []
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2699
|
+
superTypes: [Term.$type, VocabularyStatement.$type]
|
|
2700
|
+
},
|
|
2510
2701
|
UnreifiedRelation: {
|
|
2511
2702
|
name: UnreifiedRelation.$type,
|
|
2512
2703
|
properties: {
|