diff --git a/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/analytics.pure b/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/analytics.pure index e5ba71086b3..d34c163f627 100644 --- a/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/analytics.pure +++ b/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/analytics.pure @@ -95,8 +95,8 @@ Class meta::analytics::mapping::modelCoverage::MappedPropertyInfo qualifiers : MappedPropertyQualifier[*]; taggedValues: TaggedValueInfo[*]; stereotypes : StereotypeInfo[*]; - classPath: String[*]; // use * to make this optional - isQualifiedProp: Boolean[*]; // use * to make this optional, when it's false or undefined, it means it's not a qualified prop + classPath: String[0..1]; // use 0..1 to make this optional + isQualifiedProp: Boolean[0..1]; // use 0..1 to make this optional, when it's false or undefined, it means it's not a qualified prop } Class meta::analytics::mapping::modelCoverage::MappedProperty diff --git a/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/analyticsHelper.pure b/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/analyticsHelper.pure index 62e5e3bad70..5d868fae5f1 100644 --- a/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/analyticsHelper.pure +++ b/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/analyticsHelper.pure @@ -49,13 +49,23 @@ function meta::analytics::mapping::modelCoverage::getRealProperty(property:Abstr | $property); } +function <> meta::analytics::mapping::modelCoverage::buildTaggedValueInfo(taggedValue:TaggedValue[1]):TaggedValueInfo[1] +{ + ^TaggedValueInfo(tagOwner = $taggedValue.tag.profile->elementToPath(), tagValue = $taggedValue.tag.value, value = $taggedValue.value); +} + +function <> meta::analytics::mapping::modelCoverage::buildStereotypeInfo(stereotype: Stereotype[1]):StereotypeInfo[1] +{ + ^StereotypeInfo(profilePath = $stereotype.profile->elementToPath(), value = $stereotype.value); +} + function <> meta::analytics::mapping::modelCoverage::buildPropertyInfo(p:AbstractProperty[1]):PropertyInfo[1] { let name = $p->originalPropertyNameForEdgePointProperty()->toOne(); ^PropertyInfo( - taggedValues = $p.taggedValues->map(val | ^TaggedValueInfo(tagOwner = $val.tag.profile->elementToPath(), tagValue = $val.tag.value, value = $val.value)), + taggedValues = $p.taggedValues->map(val | buildTaggedValueInfo($val)), qualifiers = $p->buildQualifiers(), - stereotypes = $p.stereotypes->map(val | ^StereotypeInfo(profilePath = $val.profile->elementToPath(), value = $val.value)), + stereotypes = $p.stereotypes->map(val | buildStereotypeInfo($val)), name = $name, multiplicity = $p.multiplicity ); @@ -95,8 +105,8 @@ function meta::analytics::mapping::modelCoverage::getAllPropertyInfo(classMappin function <> meta::analytics::mapping::modelCoverage::buildClassInfo(class:Class[1]):ClassInfo[1] { ^ClassInfo( - taggedValues = $class.taggedValues->map(val | ^TaggedValueInfo(tagOwner = $val.tag.profile->elementToPath(), tagValue = $val.tag.value, value = $val.value)), - stereotypes = $class.stereotypes->map(val | ^StereotypeInfo(profilePath = $val.profile->elementToPath(), value = $val.value)), + taggedValues = $class.taggedValues->map(val | buildTaggedValueInfo($val)), + stereotypes = $class.stereotypes->map(val | buildStereotypeInfo($val)), qualifiedProperties = $class->qualifiedProperties()) } diff --git a/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/mappedEntityBuilder.pure b/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/mappedEntityBuilder.pure index fec02d444e5..18e8e7f9682 100644 --- a/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/mappedEntityBuilder.pure +++ b/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-pure/src/main/resources/core_analytics_mapping/modelCoverage/mappedEntityBuilder.pure @@ -75,31 +75,35 @@ function <> meta::analytics::mapping::modelCoverage::buildProper targetName:String[0..1], propertyInfo:PropertyInfo[1], config: AnalysisConfiguration[1], - isQualifiedProp: Boolean[*] + isQualifiedProp: Boolean[0..1] ): MappedProperty[1] { $type->match([ pt:PrimitiveType[1] | - ^MappedProperty(name = $propertyInfo.name, info = if($config.returnMappedPropertyInfo == true, - | ^MappedPropertyInfo( - type = $type->mapType(), - multiplicity = $propertyInfo.multiplicity, - taggedValues = $propertyInfo.taggedValues, - qualifiers = $propertyInfo.qualifiers, - isQualifiedProp = $isQualifiedProp, - stereotypes = $propertyInfo.stereotypes), + ^MappedProperty( + name = $propertyInfo.name, + info = if($config.returnMappedPropertyInfo == true, + | ^MappedPropertyInfo( + type = $type->mapType(), + multiplicity = $propertyInfo.multiplicity, + taggedValues = $propertyInfo.taggedValues, + qualifiers = $propertyInfo.qualifiers, + isQualifiedProp = $isQualifiedProp, + stereotypes = $propertyInfo.stereotypes), | [])), et:Enumeration[1] | ^EnumMappedProperty( - name = $propertyInfo.name, enumPath = $type->elementToPath(), info = if($config.returnMappedPropertyInfo == true, + name = $propertyInfo.name, + enumPath = $type->elementToPath(), + info = if($config.returnMappedPropertyInfo == true, | ^MappedPropertyInfo( - type = MappedPropertyType.Enumeration, - taggedValues = $propertyInfo.taggedValues, - qualifiers = $propertyInfo.qualifiers, - stereotypes = $propertyInfo.stereotypes, - classPath = $type->elementToPath(), - isQualifiedProp = $isQualifiedProp, - multiplicity = $propertyInfo.multiplicity), + type = MappedPropertyType.Enumeration, + taggedValues = $propertyInfo.taggedValues, + qualifiers = $propertyInfo.qualifiers, + stereotypes = $propertyInfo.stereotypes, + classPath = $type->elementToPath(), + isQualifiedProp = $isQualifiedProp, + multiplicity = $propertyInfo.multiplicity), | [])), ot:Any[1] | let subType = if ($p.genericType.rawType != $type, @@ -114,7 +118,7 @@ function <> meta::analytics::mapping::modelCoverage::buildProper subType = $subType, info = if($config.returnMappedPropertyInfo == true, | ^MappedPropertyInfo( - type = MappedPropertyType.Entity, + type = MappedPropertyType.Entity, multiplicity = $propertyInfo.multiplicity, taggedValues = $propertyInfo.taggedValues, qualifiers = $propertyInfo.qualifiers,