Skip to content

Commit f119fe5

Browse files
DibyamAgrawalDibyam-Agrawalsanketshevkargithub-actions[bot]
authored
feat: vocabulary support for namespace scoped decorators (reopened) (#1004)
* feat: vocab support for namespace terms Signed-off-by: Dibyam Agrawal <[email protected]> * feat: handled edge cases Signed-off-by: Dibyam Agrawal <[email protected]> * feat: updated test cases Signed-off-by: Dibyam Agrawal <[email protected]> * feat: reused existing function Signed-off-by: Dibyam Agrawal <[email protected]> * feat: moved code under feature flag Signed-off-by: Dibyam Agrawal <[email protected]> * feat: updated change log Signed-off-by: Dibyam Agrawal <[email protected]> * fix: updated version in change log Signed-off-by: Dibyam Agrawal <[email protected]> * chore(aliasing): tests import aliasing (#977) * chore(aliasing): tests import aliasing Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): add new tests Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): add new tests Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): add new tests Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): upgrade glob to v11 to fix rimraf issue in concerto-types Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): update coverage scollection script for globe upgarde Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): update coverage scollection script for globe upgarde Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): update coverage scollection script for globe upgarde Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): update coverage scollection script for globe upgarde Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): concerto-metamodel bump Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): new test Signed-off-by: sanketshevkar <[email protected]> * fix(aliasing): fix test data Signed-off-by: sanketshevkar <[email protected]> --------- Signed-off-by: sanketshevkar <[email protected]> Signed-off-by: Dibyam Agrawal <[email protected]> * chore(actions): publish v3.20.3 to npm (#978) Signed-off-by: GitHub <[email protected]> Co-authored-by: sanketshevkar <[email protected]> Signed-off-by: Dibyam Agrawal <[email protected]> * chore(dcs): expose canMigrate and migrateTo methods from DecoratorManager (#979) Signed-off-by: sanketshevkar <[email protected]> Signed-off-by: Dibyam Agrawal <[email protected]> * chore(actions): publish v3.20.4 to npm (#980) Signed-off-by: GitHub <[email protected]> Co-authored-by: sanketshevkar <[email protected]> Signed-off-by: Dibyam Agrawal <[email protected]> * fix: updated test case Signed-off-by: Dibyam Agrawal <[email protected]> * fix: updated change log Signed-off-by: Dibyam Agrawal <[email protected]> * fix: fixed test case Signed-off-by: Dibyam Agrawal <[email protected]> * feat: added feature flag option in vocabulary manager to enable namespace target Signed-off-by: Dibyam Agrawal <[email protected]> * fix: updated modelutil import Signed-off-by: Dibyam Agrawal <[email protected]> * feat: updated auto generated code on build Signed-off-by: Dibyam Agrawal <[email protected]> * feat: moved all code behind feature flag Signed-off-by: Dibyam Agrawal <[email protected]> * chore: updated change log Signed-off-by: Dibyam Agrawal <[email protected]> * fix: fixed test case Signed-off-by: Dibyam Agrawal <[email protected]> * feat: added test case Signed-off-by: Dibyam Agrawal <[email protected]> * fix: updated test data Signed-off-by: Dibyam Agrawal <[email protected]> * fix: code refactored Signed-off-by: Dibyam Agrawal <[email protected]> * fix: reverted changes in metamodel file Signed-off-by: Dibyam Agrawal <[email protected]> * fix: reverted changes in concerto metamodel file Signed-off-by: Dibyam Agrawal <[email protected]> * feat: removed extra code Signed-off-by: Dibyam Agrawal <[email protected]> * feat: added validation for term keys Signed-off-by: Dibyam Agrawal <[email protected]> * feat: added test cases Signed-off-by: Dibyam Agrawal <[email protected]> --------- Signed-off-by: Dibyam Agrawal <[email protected]> Signed-off-by: sanketshevkar <[email protected]> Signed-off-by: GitHub <[email protected]> Co-authored-by: Dibyam Agrawal <[email protected]> Co-authored-by: Sanket Shevkar <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sanketshevkar <[email protected]>
1 parent 85edbd2 commit f119fe5

21 files changed

+769
-14
lines changed

packages/concerto-core/api.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ class DecoratorManager {
6161
+ object migrateTo(decoratorCommandSet,string)
6262
+ boolean canMigrate(decoratorCommandSet,DCS_VERSION)
6363
+ ModelManager decorateModels(ModelManager,decoratorCommandSet,object?,boolean?,boolean?,boolean?,boolean?,boolean?)
64-
+ ExtractDecoratorsResult extractDecorators(ModelManager,object,boolean,string)
65-
+ ExtractDecoratorsResult extractVocabularies(ModelManager,object,boolean,string)
66-
+ ExtractDecoratorsResult extractNonVocabDecorators(ModelManager,object,boolean,string)
64+
+ ExtractDecoratorsResult extractDecorators(ModelManager,object,boolean,string,boolean)
65+
+ ExtractDecoratorsResult extractVocabularies(ModelManager,object,boolean,string,boolean)
66+
+ ExtractDecoratorsResult extractNonVocabDecorators(ModelManager,object,boolean,string,boolean)
6767
+ void validateCommand(ModelManager,command)
6868
+ Boolean falsyOrEqual(string||,string[])
6969
+ void applyDecorator(decorated,string,newDecorator)
7070
+ void executeCommand(string,declaration,command,property?,object?,boolean?)
7171
+ void executePropertyCommand(property,command)
72+
+ Boolean isNamespaceTargetEnabled(boolean?)
7273
}
7374
+ string[] intersect()
7475
+ boolean isUnversionedNamespaceEqual()

packages/concerto-core/changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
# Note that the latest public API is documented using JSDocs and is available in api.txt.
2525
#
2626

27+
Version 3.20.5 {3be18f4d17eb0e65e9a9ffc369231bf6} 2025-02-03
28+
- vocabulary support for namespace scoped decorators
2729

2830
Version 3.20.4 {335406876b7005f0a2e6f9ca3e0d0dbf} 2025-01-21
2931
- expose canMigrate and MigrateTo methods from decorator manager

packages/concerto-core/lib/decoratorextractor.js

Lines changed: 135 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ class DecoratorExtractor {
4242
* @param {string} dcs_version - version string
4343
* @param {Object} sourceModelAst - the ast of source models
4444
* @param {int} [action=DecoratorExtractor.Action.EXTRACT_ALL] - the action to be performed
45+
* @param {object} [options] - decorator extractor options
46+
* @param {boolean} [options.enableDcsNamespaceTarget] - flag to control applying namespace targeted decorators on top of the namespace instead of all declarations in that namespace
4547
*/
46-
constructor(removeDecoratorsFromModel, locale, dcs_version, sourceModelAst, action = DecoratorExtractor.Action.EXTRACT_ALL) {
48+
constructor(removeDecoratorsFromModel, locale, dcs_version, sourceModelAst, action = DecoratorExtractor.Action.EXTRACT_ALL, options) {
4749
this.extractionDictionary = {};
4850
this.removeDecoratorsFromModel = removeDecoratorsFromModel;
4951
this.locale = locale;
52+
this.enableDcsNamespaceTarget = options?.enableDcsNamespaceTarget? true : false;
5053
this.dcs_version = dcs_version;
5154
this.sourceModelAst = sourceModelAst;
5255
this.updatedModelAst = sourceModelAst;
@@ -156,6 +159,66 @@ class DecoratorExtractor {
156159
}
157160
return vocabData;
158161
}
162+
/**
163+
* Transforms the collected vocabularies into proper vocabulary command sets
164+
* @param {Array<Object>} vocabObject - the collection of collected vocabularies
165+
* @param {string} namespace - the current namespace
166+
* @param {Array<Object>} vocabData - the collection of existing vocabularies command sets
167+
* @returns {Array<Object>} - the collection of vocabularies command sets
168+
* @private
169+
*/
170+
transformVocabularyDecoratorsV2(vocabObject, namespace, vocabData){
171+
if (Object.keys(vocabObject).length > 0 ){
172+
let strVoc = '';
173+
strVoc = strVoc + `locale: ${this.locale}\n`;
174+
strVoc = strVoc + `namespace: ${namespace}\n`;
175+
if (vocabObject.namespace && Object.keys(vocabObject.namespace).length > 0 ){
176+
if (vocabObject.namespace.term){
177+
strVoc += `term: ${vocabObject.namespace.term}\n`;
178+
}
179+
let otherProps = Object.keys(vocabObject.namespace).filter((str)=>str !== 'term');
180+
otherProps.forEach(key =>{
181+
strVoc += `${key}: ${vocabObject.namespace[key]}\n`;
182+
});
183+
}
184+
if (vocabObject.declarations && Object.keys(vocabObject.declarations).length > 0 ){
185+
strVoc = strVoc + 'declarations:\n';
186+
Object.keys(vocabObject.declarations).forEach(decl =>{
187+
if (vocabObject.declarations[decl].term){
188+
strVoc += ` - ${decl}: ${vocabObject.declarations[decl].term}\n`;
189+
}
190+
const otherProps = Object.keys(vocabObject.declarations[decl]).filter((str)=>str !== 'term' && str !== 'propertyVocabs');
191+
//If a declaration does not have any Term decorator, then add Term_ decorators to yaml
192+
if(otherProps.length > 0){
193+
if (!vocabObject.declarations[decl].term){
194+
strVoc += ` - ${decl}: ${decl}\n`;
195+
}
196+
otherProps.forEach(key =>{
197+
strVoc += ` ${key}: ${vocabObject.declarations[decl][key]}\n`;
198+
});
199+
}
200+
if (vocabObject.declarations[decl].propertyVocabs && Object.keys(vocabObject.declarations[decl].propertyVocabs).length > 0){
201+
if (!vocabObject.declarations[decl].term && otherProps.length === 0){
202+
strVoc += ` - ${decl}: ${decl}\n`;
203+
}
204+
strVoc += ' properties:\n';
205+
Object.keys(vocabObject.declarations[decl].propertyVocabs).forEach(prop =>{
206+
strVoc += ` - ${prop}: ${vocabObject.declarations[decl].propertyVocabs[prop].term || ''}\n`;
207+
const otherProps = Object.keys(vocabObject.declarations[decl].propertyVocabs[prop]).filter((str)=>str !== 'term');
208+
otherProps.forEach(key =>{
209+
strVoc += ` ${key}: ${vocabObject.declarations[decl].propertyVocabs[prop][key]}\n`;
210+
});
211+
});
212+
}
213+
});
214+
}
215+
else{
216+
strVoc = strVoc + 'declarations: []\n';
217+
}
218+
vocabData.push(strVoc);
219+
}
220+
return vocabData;
221+
}
159222
/**
160223
* Constructs Target object for a given model
161224
* @param {string} namespace - the current namespace
@@ -256,6 +319,75 @@ class DecoratorExtractor {
256319
}
257320
return dictVoc;
258321
}
322+
/**
323+
* @param {Object} vocabObject - the collection of collected vocabularies
324+
* @param {Object} vocabTarget - the declaration object
325+
* @param {Object} dcs - the current dcs json to be parsed
326+
* @returns {Object} - the collection of collected vocabularies with current dcs
327+
* @private
328+
*/
329+
parseVocabulariesV2(vocabObject, vocabTarget, dcs){
330+
//If the vocabTarget declaration is empty, then it is a namespace level vocabulary
331+
if(vocabTarget.declaration === ''){
332+
vocabObject.namespace = vocabObject.namespace || {};
333+
if (dcs.name === 'Term'){
334+
vocabObject.namespace.term = dcs.arguments[0].value;
335+
}
336+
else {
337+
const extensionKey = dcs.name.split('Term_')[1];
338+
if(extensionKey === 'namespace' || extensionKey === 'locale' || extensionKey === 'declarations'){
339+
throw new Error(`Invalid vocabulary key: ${extensionKey}. The key should not be one of the reserved keys: namespace, locale, declarations`);
340+
}
341+
vocabObject.namespace[extensionKey] = dcs.arguments[0].value;
342+
}
343+
return vocabObject;
344+
}
345+
vocabObject.declarations = vocabObject.declarations || {};
346+
vocabObject.declarations[vocabTarget.declaration] = vocabObject.declarations[vocabTarget.declaration] || { propertyVocabs: {} };
347+
if (vocabTarget.property !== ''){
348+
if (!vocabObject.declarations[vocabTarget.declaration].propertyVocabs[vocabTarget.property]){
349+
vocabObject.declarations[vocabTarget.declaration].propertyVocabs[vocabTarget.property] = {};
350+
}
351+
if (dcs.name === 'Term'){
352+
vocabObject.declarations[vocabTarget.declaration].propertyVocabs[vocabTarget.property].term = dcs.arguments[0].value;
353+
}
354+
else {
355+
const extensionKey = dcs.name.split('Term_')[1];
356+
if(extensionKey === vocabTarget.property){
357+
throw new Error(`Invalid vocabulary key: "${extensionKey}". The key should not be the name of the current property.`);
358+
}
359+
vocabObject.declarations[vocabTarget.declaration].propertyVocabs[vocabTarget.property][extensionKey] = dcs.arguments[0].value;
360+
}
361+
}
362+
else if (vocabTarget.mapElement !== ''){
363+
if (!vocabObject.declarations[vocabTarget.declaration].propertyVocabs[vocabTarget.mapElement]){
364+
vocabObject.declarations[vocabTarget.declaration].propertyVocabs[vocabTarget.mapElement] = {};
365+
}
366+
if (dcs.name === 'Term'){
367+
vocabObject.declarations[vocabTarget.declaration].propertyVocabs[vocabTarget.mapElement].term = dcs.arguments[0].value;
368+
}
369+
else {
370+
const extensionKey = dcs.name.split('Term_')[1];
371+
if(extensionKey === vocabTarget.mapElement){
372+
throw new Error(`Invalid vocabulary key: "${extensionKey}". The key should not be the name of the current property.`);
373+
}
374+
vocabObject.declarations[vocabTarget.declaration].propertyVocabs[vocabTarget.mapElement][extensionKey] = dcs.arguments[0].value;
375+
}
376+
}
377+
else {
378+
if (dcs.name === 'Term'){
379+
vocabObject.declarations[vocabTarget.declaration].term = dcs.arguments[0].value;
380+
}
381+
else {
382+
const extensionKey = dcs.name.split('Term_')[1];
383+
if(extensionKey === 'properties' || extensionKey === vocabTarget.declaration){
384+
throw new Error(`Invalid vocabulary key: "${extensionKey}". The key cannot be a reserved word such as "properties" or the name of the current declaration.`);
385+
}
386+
vocabObject.declarations[vocabTarget.declaration][extensionKey] = dcs.arguments[0].value;
387+
}
388+
}
389+
return vocabObject;
390+
}
259391
/**
260392
* parses the extracted decorators and generates arrays of decorator command set and vocabularies
261393
*
@@ -278,15 +410,15 @@ class DecoratorExtractor {
278410
dcsObjects = this.parseNonVocabularyDecorators(dcsObjects, dcs, this.dcs_version, target);
279411
}
280412
if (isVocab && this.action !== DecoratorExtractor.Action.EXTRACT_NON_VOCAB){
281-
vocabObject = this.parseVocabularies(vocabObject, obj, dcs);
413+
vocabObject = this.enableDcsNamespaceTarget ? this.parseVocabulariesV2(vocabObject, obj, dcs) : this.parseVocabularies(vocabObject, obj, dcs);
282414
}
283415
});
284416
});
285417
if(this.action !== DecoratorExtractor.Action.EXTRACT_VOCAB){
286418
decoratorData = this.transformNonVocabularyDecorators(dcsObjects, namespace, decoratorData);
287419
}
288420
if(this.action !== DecoratorExtractor.Action.EXTRACT_NON_VOCAB){
289-
vocabData = this.transformVocabularyDecorators(vocabObject, namespace, vocabData);
421+
vocabData = this.enableDcsNamespaceTarget ? this.transformVocabularyDecoratorsV2(vocabObject, namespace, vocabData) : this.transformVocabularyDecorators(vocabObject, namespace, vocabData);
290422
}
291423
});
292424
return {

packages/concerto-core/lib/decoratormanager.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,16 +466,18 @@ class DecoratorManager {
466466
* @param {object} options - decorator models options
467467
* @param {boolean} options.removeDecoratorsFromModel - flag to strip out decorators from models
468468
* @param {string} options.locale - locale for extracted vocabulary set
469+
* @param {boolean} options.enableDcsNamespaceTarget - flag to control applying namespace targeted decorators on top of the namespace instead of all declarations in that namespace
469470
* @returns {ExtractDecoratorsResult} - a new model manager with the decorations removed and a list of extracted decorator jsons and vocab yamls
470471
*/
471472
static extractDecorators(modelManager,options) {
472473
options = {
473474
removeDecoratorsFromModel: false,
474475
locale:'en',
476+
enableDcsNamespaceTarget: false,
475477
...options
476478
};
477479
const sourceAst = modelManager.getAst(true, true);
478-
const decoratorExtrator = new DecoratorExtractor(options.removeDecoratorsFromModel, options.locale, DCS_VERSION, sourceAst, DecoratorExtractor.Action.EXTRACT_ALL);
480+
const decoratorExtrator = new DecoratorExtractor(options.removeDecoratorsFromModel, options.locale, DCS_VERSION, sourceAst, DecoratorExtractor.Action.EXTRACT_ALL, {enableDcsNamespaceTarget: this.isNamespaceTargetEnabled(options.enableDcsNamespaceTarget)});
479481
const collectionResp = decoratorExtrator.extract();
480482
return {
481483
modelManager: collectionResp.updatedModelManager,
@@ -489,16 +491,18 @@ class DecoratorManager {
489491
* @param {object} options - decorator models options
490492
* @param {boolean} options.removeDecoratorsFromModel - flag to strip out vocab decorators from models
491493
* @param {string} options.locale - locale for extracted vocabulary set
494+
* @param {boolean} options.enableDcsNamespaceTarget - flag to control applying namespace targeted decorators on top of the namespace instead of all declarations in that namespace
492495
* @returns {ExtractDecoratorsResult} - a new model manager with/without the decorators and vocab yamls
493496
*/
494497
static extractVocabularies(modelManager,options) {
495498
options = {
496499
removeDecoratorsFromModel: false,
497500
locale:'en',
501+
enableDcsNamespaceTarget: false,
498502
...options
499503
};
500504
const sourceAst = modelManager.getAst(true, true);
501-
const decoratorExtrator = new DecoratorExtractor(options.removeDecoratorsFromModel, options.locale, DCS_VERSION, sourceAst, DecoratorExtractor.Action.EXTRACT_VOCAB);
505+
const decoratorExtrator = new DecoratorExtractor(options.removeDecoratorsFromModel, options.locale, DCS_VERSION, sourceAst, DecoratorExtractor.Action.EXTRACT_VOCAB, {enableDcsNamespaceTarget: this.isNamespaceTargetEnabled(options.enableDcsNamespaceTarget)});
502506
const collectionResp = decoratorExtrator.extract();
503507
return {
504508
modelManager: collectionResp.updatedModelManager,
@@ -511,16 +515,18 @@ class DecoratorManager {
511515
* @param {object} options - decorator models options
512516
* @param {boolean} options.removeDecoratorsFromModel - flag to strip out non-vocab decorators from models
513517
* @param {string} options.locale - locale for extracted vocabulary set
518+
* @param {boolean} options.enableDcsNamespaceTarget - flag to control applying namespace targeted decorators on top of the namespace instead of all declarations in that namespace
514519
* @returns {ExtractDecoratorsResult} - a new model manager with/without the decorators and a list of extracted decorator jsons
515520
*/
516521
static extractNonVocabDecorators(modelManager,options) {
517522
options = {
518523
removeDecoratorsFromModel: false,
519524
locale:'en',
525+
enableDcsNamespaceTarget: false,
520526
...options
521527
};
522528
const sourceAst = modelManager.getAst(true);
523-
const decoratorExtrator = new DecoratorExtractor(options.removeDecoratorsFromModel, options.locale, DCS_VERSION, sourceAst, DecoratorExtractor.Action.EXTRACT_NON_VOCAB);
529+
const decoratorExtrator = new DecoratorExtractor(options.removeDecoratorsFromModel, options.locale, DCS_VERSION, sourceAst, DecoratorExtractor.Action.EXTRACT_NON_VOCAB, {enableDcsNamespaceTarget: this.isNamespaceTargetEnabled(options.enableDcsNamespaceTarget)});
524530
const collectionResp = decoratorExtrator.extract();
525531
return {
526532
modelManager: collectionResp.updatedModelManager,
@@ -791,7 +797,6 @@ class DecoratorManager {
791797
/**
792798
* Checks if enableDcsNamespaceTarget or ENABLE_DCS_TARGET_NAMESPACE is enabled or not
793799
* and print deprecation warning if not enabled and return boolean value as well
794-
* @private
795800
* @param {boolean} [enableDcsNamespaceTarget] - flag to control applying namespace targeted decorators on top of the namespace instead of all declarations in that namespace
796801
* @returns {Boolean} true if either of the flags is enabled
797802
*/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["locale: en\nnamespace: [email protected]\nterm: my Namespace\nDesc: my Namespace desc\ndeclarations:\n - mapName: Map Name\n properties:\n - KEY: some key\n desc: some key description\n - Person: Person Class\n desc: Person Class Description\n properties:\n - firstName: HI\n - bio: some\n cus: con\n"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["locale: en\nnamespace: [email protected]\nterm: my Namespace\nDesc: my Namespace desc\ndeclarations: []\n"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["locale: en\nnamespace: [email protected]\ndeclarations:\n - mapName: mapName\n properties:\n - KEY: some key\n desc: some key description\n - VALUE: some value\n desc: some value description\n - Person: Person\n desc: Person Class Description\n properties:\n - firstName: HI\n - bio: some\n cus: con\n"]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@Term("my Namespace")
2+
@Term_Desc("my Namespace desc")
3+
@deco("testing namespace")
4+
5+
@deco
6+
enum Dummy {
7+
@one
8+
o One
9+
}
10+
@scc
11+
scalar SSN extends String default="000-00-0000"
12+
13+
@M1
14+
@Term_participantName("some value")
15+
participant participantName identified by participantKey {
16+
@M3
17+
o String participantKey
18+
}
19+
20+
@Dummy("term1",2)
21+
asset assetName identified by assetKey {
22+
o String assetKey
23+
}
24+
25+
@Term("Map Name")
26+
map mapName {
27+
@Term("some key")
28+
@Term_desc("some key description")
29+
@deco(1)
30+
o String
31+
o String
32+
}
33+
34+
@Term("Person Class")
35+
@Term_desc("Person Class Description")
36+
@Editable
37+
concept Person {
38+
@Term("HI")
39+
@Custom
40+
@Form("inputType", "text")
41+
@New
42+
o String firstName
43+
@term("custom")
44+
@term_desc("custom desc")
45+
@Form("inputType", "text")
46+
@New
47+
o String lastName
48+
@Term("some")
49+
@Term_cus("con")
50+
@Form("inputType", "textArea")
51+
@New
52+
o String bio
53+
@Form("inputType", "text")
54+
@New
55+
o String ssn
56+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@Term("my Namespace")
2+
@Term_Desc("my Namespace desc")
3+
@Term_namespace("some value")
4+
@deco("testing namespace")
5+
6+
@deco
7+
enum Dummy {
8+
@one
9+
o One
10+
}
11+
@scc
12+
scalar SSN extends String default="000-00-0000"
13+
14+
@M1
15+
participant participantName identified by participantKey {
16+
@M3
17+
o String participantKey
18+
}
19+
20+
@Dummy("term1",2)
21+
asset assetName identified by assetKey {
22+
o String assetKey
23+
}
24+
25+
@Term("Map Name")
26+
map mapName {
27+
@Term("some key")
28+
@Term_desc("some key description")
29+
@deco(1)
30+
o String
31+
o String
32+
}
33+
34+
@Term("Person Class")
35+
@Term_desc("Person Class Description")
36+
@Editable
37+
concept Person {
38+
@Term("HI")
39+
@Custom
40+
@Form("inputType", "text")
41+
@New
42+
o String firstName
43+
@term("custom")
44+
@term_desc("custom desc")
45+
@Form("inputType", "text")
46+
@New
47+
o String lastName
48+
@Term("some")
49+
@Term_cus("con")
50+
@Form("inputType", "textArea")
51+
@New
52+
o String bio
53+
@Form("inputType", "text")
54+
@New
55+
o String ssn
56+
}

0 commit comments

Comments
 (0)