From 909cb8fe4498a2834a3327884d6b572e44455905 Mon Sep 17 00:00:00 2001 From: Pierre De Belen Date: Fri, 8 Nov 2024 14:39:28 -0500 Subject: [PATCH] Enable type arguments in Legend Engine Pure (#3234) * FixCast * Modify Variable to use genericType * Update Property and Function return types to GenericType * rebase * Fix Typo in GenericType * Update Protocol Pure classes * More Pure improvements --- .../ValueSpecificationDefaultVisitor.java | 44 +- .../autocomplete/handlers/FromHandler.java | 2 +- .../autocomplete/handlers/JoinHandler.java | 2 +- .../repl/dataCube/server/DataCubeHelpers.java | 8 +- .../dataCube/server/REPLServerHelpers.java | 2 +- .../server/handler/DataCubeQueryBuilder.java | 2 +- .../repl/dataCube/TestDataCubeHelpers.java | 10 +- .../ParameterizedValueSpecification.java | 44 +- ...tiveValueSpecificationToObjectVisitor.java | 44 +- .../FunctionParameterProcessor.java | 3 +- .../FunctionParametersNormalizer.java | 3 +- ...unctionParametersParametersValidation.java | 7 +- .../ParameterValidationContextExecutor.java | 3 +- .../TestParameterizedValueSpecification.java | 15 +- .../language/pure/compiler/api/Compile.java | 2 +- .../compiler/api/test/TestCompileApi.java | 10 +- .../language/pure/compiler/Compiler.java | 2 +- .../AssociationCompilerExtension.java | 15 +- .../ClassMappingFirstPassBuilder.java | 4 +- .../ClassMappingThirdPassBuilder.java | 2 +- .../compiler/toPureGraph/CompileContext.java | 103 +- .../FunctionCompilerExtension.java | 4 +- .../toPureGraph/HelperMappingBuilder.java | 42 +- .../toPureGraph/HelperModelBuilder.java | 35 +- .../HelperValueSpecificationBuilder.java | 25 +- .../compiler/toPureGraph/Milestoning.java | 62 +- ...kageableElementMilestoningPassBuilder.java | 5 +- .../toPureGraph/PropertyMappingBuilder.java | 7 +- .../pure/compiler/toPureGraph/PureModel.java | 2 +- .../toPureGraph/RelationTypeHelper.java | 4 +- .../ValueSpecificationBuilder.java | 64 +- .../ValueSpecificationBuilderForFuncExpr.java | 6 +- .../data/core/EmbeddedDataCompilerHelper.java | 2 +- .../toPureGraph/handlers/Handlers.java | 59 +- .../builder/FunctionExpressionBuilder.java | 4 +- .../handlers/inference/MostCommonType.java | 32 - .../test/ModelStoreTestConnectionFactory.java | 2 +- .../test/TestCompilationFromGrammar.java | 2 +- .../TestDomainCompilationFromGrammar.java | 2 +- .../api/test/TestGrammarToJsonApi.java | 30 +- .../from/antlr4/core/M3ParserGrammar.g4 | 12 +- .../pure/grammar/from/PureGrammarParser.java | 1 - .../ModelStoreDataParseTreeWalker.java | 14 +- .../from/domain/DateParseTreeWalker.java | 6 +- .../from/domain/DomainParseTreeWalker.java | 130 +- .../domain/GraphFetchTreeParseTreeWalker.java | 12 +- .../domain/NavigationParseTreeWalker.java | 14 +- .../domain/StrictTimeParseTreeWalker.java | 2 +- .../DEPRECATED_PureGrammarComposerCore.java | 90 +- .../to/HelperDomainGrammarComposer.java | 10 +- ...lperValueSpecificationGrammarComposer.java | 57 +- .../data/ModelStoreDataGrammarComposer.java | 44 +- .../test/parser/TestDomainGrammarParser.java | 41 + .../test/parser/TestMappingGrammarParser.java | 2 +- .../TestDomainGrammarArgumentsRoundtrip.java | 63 + ...impleMixedBooleanArithmeticConstraint.json | 28 +- .../protocol/pure/v1/ProcessHelper.java | 48 + .../packageableElement/domain/Function.java | 55 +- .../packageableElement/domain/Property.java | 58 +- .../domain/QualifiedProperty.java | 49 +- .../pure/v1/model/type/GenericType.java | 53 + .../PackageableType.java} | 17 +- .../protocol/pure/v1/model/type/Type.java | 29 + .../model/{ => type}/relationType/Column.java | 15 +- .../{ => type}/relationType/RelationType.java | 17 +- .../ValueSpecification.java | 46 +- .../ValueSpecificationVisitor.java | 44 +- .../v1/model/valueSpecification/Variable.java | 83 +- .../AbstractAppliedFunction.java | 4 +- .../application/AppliedFunction.java | 1 - .../application/AppliedProperty.java | 1 - .../AppliedQualifiedProperty.java | 4 +- .../{raw => deprecated}/Class.java | 3 +- .../{raw => deprecated}/Enum.java | 3 +- .../{raw => deprecated}/HackedClass.java | 4 +- .../{raw => deprecated}/HackedUnit.java | 4 +- .../{raw => deprecated}/MappingInstance.java | 3 +- .../{raw => deprecated}/PrimitiveType.java | 3 +- .../UnknownAppliedFunction.java | 4 +- .../{raw => deprecated}/Whatever.java | 5 +- .../raw/GenericTypeInstance.java | 53 - .../raw/{ => datatype}/CBoolean.java | 2 +- .../raw/{ => datatype}/CByteArray.java | 2 +- .../raw/{ => datatype}/CDate.java | 2 +- .../raw/{ => datatype}/CDateTime.java | 2 +- .../raw/{ => datatype}/CDecimal.java | 2 +- .../raw/{ => datatype}/CFloat.java | 2 +- .../raw/{ => datatype}/CInteger.java | 2 +- .../raw/{ => datatype}/CLatestDate.java | 2 +- .../raw/{ => datatype}/CStrictDate.java | 2 +- .../raw/{ => datatype}/CStrictTime.java | 2 +- .../raw/{ => datatype}/CString.java | 2 +- .../DataTypeValueSpecification.java | 4 +- .../raw/{ => datatype}/EnumValue.java | 2 +- .../PrimitiveValueSpecification.java | 3 +- .../raw/{ => datatype}/UnitInstance.java | 2 +- .../GenericTypeInstance.java | 84 + .../PackageableElementPtr.java | 3 +- .../test/TestCompatibilityAndMigration.java | 1258 ++++++--- .../test/resources/simpleFunctionAfter.json | 2439 ++++++++--------- .../protocol/vX_X_X/models/metamodel.pure | 28 +- .../vX_X_X/transfers/executionPlan.pure | 2 +- .../protocol/vX_X_X/transfers/metamodel.pure | 20 +- .../vX_X_X/transfers/valueSpecification.pure | 31 +- .../TestM2MGrammarCompileAndExecute.java | 2 +- .../assertion/TestTestAssertionEvaluator.java | 2 +- .../analytics/test/TestClassAnalyticsApi.java | 2 +- .../TestFunctionAnalyticsApi.java | 2 +- .../test/TestMappingAnalyticsApi.java | 2 +- ...eAnalyticsArtifactGenerationExtension.java | 10 +- .../test/TestDiagramAnalyticsApi.java | 10 +- .../elasticsearch_test_tds_schema.pure | 2 +- .../specification_generator.pure | 12 +- ...tiveValueSpecificationToObjectVisitor.java | 44 +- .../plugin/RelationalGraphFetchUtils.java | 16 +- .../MilestoningParseTreeWalker.java | 6 +- .../src/test/resources/expectedJson.json | 177 +- .../resources/expectedJsonWithInclude.json | 93 +- .../milestoning/BusinessMilestoning.java | 2 +- .../milestoning/ProcessingMilestoning.java | 2 +- .../valueSpecification/DatabaseInstance.java | 2 +- .../autogeneration/relationalToPure.pure | 8 +- .../ServiceCompilerExtensionImpl.java | 7 +- .../TestServiceCompilationFromGrammar.java | 12 +- .../ValueSpecificationToResultVisitor.java | 44 +- .../TestValueSpecificationBuilder.java | 44 +- .../engine/query/sql/api/SQLExecutor.java | 16 +- .../shared/FunctionSQLSourceProvider.java | 3 +- .../shared/utils/SQLProviderUtils.java | 4 +- 129 files changed, 3804 insertions(+), 2466 deletions(-) create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestDomainGrammarArgumentsRoundtrip.java create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/ProcessHelper.java create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/GenericType.java rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/{valueSpecification/raw/DeprecatedValueSpecification.java => type/PackageableType.java} (56%) create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/Type.java rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/{ => type}/relationType/Column.java (66%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/{ => type}/relationType/RelationType.java (62%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => application}/AbstractAppliedFunction.java (87%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{application => deprecated}/AppliedQualifiedProperty.java (95%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/Class.java (92%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/Enum.java (92%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/HackedClass.java (89%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/HackedUnit.java (90%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/MappingInstance.java (92%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/PrimitiveType.java (95%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{application => deprecated}/UnknownAppliedFunction.java (94%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/{raw => deprecated}/Whatever.java (88%) delete mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/GenericTypeInstance.java rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CBoolean.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CByteArray.java (97%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CDate.java (96%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CDateTime.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CDecimal.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CFloat.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CInteger.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CLatestDate.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CStrictDate.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CStrictTime.java (97%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/CString.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/DataTypeValueSpecification.java (87%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/EnumValue.java (98%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/PrimitiveValueSpecification.java (95%) rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => datatype}/UnitInstance.java (97%) create mode 100644 legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/GenericTypeInstance.java rename legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/{ => packageableElement}/PackageableElementPtr.java (94%) diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/ValueSpecificationDefaultVisitor.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/ValueSpecificationDefaultVisitor.java index c3692b40e2e..2b47bf24d9e 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/ValueSpecificationDefaultVisitor.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/ValueSpecificationDefaultVisitor.java @@ -19,33 +19,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; public class ValueSpecificationDefaultVisitor implements ValueSpecificationVisitor { diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/FromHandler.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/FromHandler.java index ad1e906ef6d..ae183f9131f 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/FromHandler.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/FromHandler.java @@ -20,7 +20,7 @@ import org.finos.legend.engine.language.pure.compiler.toPureGraph.PureModel; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.repl.autocomplete.Completer; import org.finos.legend.engine.repl.autocomplete.CompletionItem; import org.finos.legend.engine.repl.autocomplete.FunctionHandler; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/JoinHandler.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/JoinHandler.java index 1c318f4bd11..2e97e974455 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/JoinHandler.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/autocomplete/handlers/JoinHandler.java @@ -24,7 +24,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.repl.autocomplete.Completer; import org.finos.legend.engine.repl.autocomplete.CompletionItem; import org.finos.legend.engine.repl.autocomplete.FunctionHandler; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/DataCubeHelpers.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/DataCubeHelpers.java index 6c802da0fa4..9f1f477d9fe 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/DataCubeHelpers.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/DataCubeHelpers.java @@ -36,7 +36,9 @@ import org.finos.legend.engine.protocol.pure.v1.model.executionPlan.SingleExecutionPlan; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.pure.code.core.PureCoreExtensionLoader; @@ -192,7 +194,7 @@ public static Function wrapLambda(Lambda lambda) Function func = new Function(); func.name = REPL_RUN_FUNCTION_QUALIFIED_PATH.substring(REPL_RUN_FUNCTION_QUALIFIED_PATH.lastIndexOf("::") + 2); func._package = REPL_RUN_FUNCTION_QUALIFIED_PATH.substring(0, REPL_RUN_FUNCTION_QUALIFIED_PATH.lastIndexOf("::")); - func.returnType = M3Paths.Any; + func.returnGenericType = new GenericType(new PackageableType(M3Paths.Any)); func.returnMultiplicity = new Multiplicity(0, null); func.body = lambda.body; return func; @@ -208,7 +210,7 @@ public static Pair injectNewFunction(PureModelCo func.name = originalFunction.name; func._package = originalFunction._package; func.parameters = originalFunction.parameters; - func.returnType = originalFunction.returnType; + func.returnGenericType = originalFunction.returnGenericType; func.returnMultiplicity = originalFunction.returnMultiplicity; func.body = lambda != null ? lambda.body : func.body; // if no lambda is specified, we'll just use the original function diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/REPLServerHelpers.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/REPLServerHelpers.java index 22ccbe5464d..96cf4a10867 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/REPLServerHelpers.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/REPLServerHelpers.java @@ -35,7 +35,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpec; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpecArray; import org.finos.legend.engine.repl.client.Client; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/handler/DataCubeQueryBuilder.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/handler/DataCubeQueryBuilder.java index 94833b616a0..9debbe9347a 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/handler/DataCubeQueryBuilder.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/server/handler/DataCubeQueryBuilder.java @@ -23,7 +23,7 @@ import org.finos.legend.engine.language.pure.grammar.to.PureGrammarComposerContext; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.repl.autocomplete.CompletionResult; import org.finos.legend.engine.repl.dataCube.server.DataCubeHelpers; diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/test/java/org/finos/legend/engine/repl/dataCube/TestDataCubeHelpers.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/test/java/org/finos/legend/engine/repl/dataCube/TestDataCubeHelpers.java index bc75b1db240..3f6088e1a67 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/test/java/org/finos/legend/engine/repl/dataCube/TestDataCubeHelpers.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/test/java/org/finos/legend/engine/repl/dataCube/TestDataCubeHelpers.java @@ -240,7 +240,7 @@ private void testTypeahead(String expectedResult, String code, Lambda lambda, Pu public void testExtractRelationReturnTypeGroupBy() { String lambda = "|#>{test::TestDatabase.TEST0}#->filter(c | $c.FIRSTNAME != 'Doe')->groupBy(~[FIRSTNAME], ~[count: x | $x.FIRSTNAME : y | $y->count()])->from(test::test)"; - String expectedResult = "{\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"count\",\"type\":\"Integer\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"count\",\"type\":\"Integer\"}]}"; testExtractRelationReturnType(expectedResult, lambda, pureModelContextData); } @@ -248,7 +248,7 @@ public void testExtractRelationReturnTypeGroupBy() public void testExtractRelationReturnTypeCast() { String lambda = "|#>{test::TestDatabase.TEST0}#->filter(c | $c.FIRSTNAME != 'Doe')->from(test::test)->groupBy(~[FIRSTNAME], ~[count: x | $x.FIRSTNAME : y | $y->count()])->cast(@meta::pure::metamodel::relation::Relation<(hai:String,ba:Integer)>)"; - String expectedResult = "{\"columns\":[{\"name\":\"hai\",\"type\":\"String\"},{\"name\":\"ba\",\"type\":\"Integer\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"hai\",\"type\":\"String\"},{\"name\":\"ba\",\"type\":\"Integer\"}]}"; testExtractRelationReturnType(expectedResult, lambda, pureModelContextData); } @@ -256,7 +256,7 @@ public void testExtractRelationReturnTypeCast() public void testExtractRelationReturnTypeSimpleExtend() { String lambda = "|#>{test::TestDatabase.TEST0}#->extend(~newCol:c|'ok')"; - String expectedResult = "{\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"}]}"; testExtractRelationReturnType(expectedResult, lambda, pureModelContextData); } @@ -264,7 +264,7 @@ public void testExtractRelationReturnTypeSimpleExtend() public void testExtractRelationReturnTypeMultipleExtend() { String lambda = "|#>{test::TestDatabase.TEST0}#->extend(~[newCol:c|'ok', colX: c|$c.FIRSTNAME])"; - String expectedResult = "{\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"},{\"name\":\"colX\",\"type\":\"String\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"},{\"name\":\"colX\",\"type\":\"String\"}]}"; testExtractRelationReturnType(expectedResult, lambda, pureModelContextData); } @@ -272,7 +272,7 @@ public void testExtractRelationReturnTypeMultipleExtend() public void testExtractRelationReturnTypeWithDummySource() { String lambda = "|''->cast(@meta::pure::metamodel::relation::Relation<(FIRSTNAME:String,LASTNAME:String)>)->extend(~[newCol:c|'ok', colX: c|$c.FIRSTNAME])"; - String expectedResult = "{\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"},{\"name\":\"colX\",\"type\":\"String\"}]}"; + String expectedResult = "{\"_type\":\"relationType\",\"columns\":[{\"name\":\"FIRSTNAME\",\"type\":\"String\"},{\"name\":\"LASTNAME\",\"type\":\"String\"},{\"name\":\"newCol\",\"type\":\"String\"},{\"name\":\"colX\",\"type\":\"String\"}]}"; testExtractRelationReturnType(expectedResult, lambda, null); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/parameterization/ParameterizedValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/parameterization/ParameterizedValueSpecification.java index 99513a373f7..4f91da4d189 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/parameterization/ParameterizedValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/parameterization/ParameterizedValueSpecification.java @@ -21,33 +21,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import java.util.ArrayList; import java.util.HashMap; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/planHelper/PrimitiveValueSpecificationToObjectVisitor.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/planHelper/PrimitiveValueSpecificationToObjectVisitor.java index f9696e0815d..237b75858af 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/planHelper/PrimitiveValueSpecificationToObjectVisitor.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/planHelper/PrimitiveValueSpecificationToObjectVisitor.java @@ -19,33 +19,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.PureList; import java.io.ByteArrayInputStream; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/validation/FunctionParameterProcessor.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/validation/FunctionParameterProcessor.java index 029f53ea167..2b8cd796dac 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/validation/FunctionParameterProcessor.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-executionPlan-execution/legend-engine-executionPlan-execution/src/main/java/org/finos/legend/engine/plan/execution/validation/FunctionParameterProcessor.java @@ -19,6 +19,7 @@ import org.finos.legend.engine.plan.execution.result.ConstantResult; import org.finos.legend.engine.plan.execution.result.Result; import org.finos.legend.engine.protocol.pure.v1.model.executionPlan.nodes.ParameterValidationContext; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import java.util.List; @@ -64,7 +65,7 @@ private static void processStreamParameter(Variable param, List if (!missingExternalParameters.isEmpty()) { - throw new IllegalArgumentException("Missing external parameter(s): " + missingExternalParameters.collect(a -> a.name + ":" + a._class.path + "[" + renderMultiplicity(a.multiplicity) + "]").makeString(",")); + throw new IllegalArgumentException("Missing external parameter(s): " + missingExternalParameters.collect(a -> a.name + ":" + ((PackageableType) a.genericType.rawType).fullPath + "[" + renderMultiplicity(a.multiplicity) + "]").makeString(",")); } } @@ -72,7 +73,7 @@ private static void validateParameterValues(RichIterable externalParam public static ValidationResult validate(Variable var, List parameterValidationContext, Object value) { - FunctionParameterTypeValidator validator = FunctionParameterTypeValidator.externalParameterTypeValidator(var._class.path); + FunctionParameterTypeValidator validator = FunctionParameterTypeValidator.externalParameterTypeValidator(((PackageableType) var.genericType.rawType).fullPath); if (validator == null) { ValidationResult result = null; @@ -84,7 +85,7 @@ public static ValidationResult validate(Variable var, List parameterValueCompare(spec.getParameterValues().get(index), expectedParameters.get(index)))); assert (IntStream.range(0, spec.getVariables().size()).allMatch(index -> variableCompare(spec.getVariables().get(index), expectedVariables.get(index)))); @@ -86,7 +87,7 @@ public void testStringListIsNotParameterized() throws IOException expectedVariables.add(new Variable("GENERATEDL0L1", "Integer", Multiplicity.PURE_ONE)); String actualSpec = objectMapper.writeValueAsString(spec.getValueSpecification()); - Assert.assertEquals("{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"take\",\"parameters\":[{\"_type\":\"func\",\"function\":\"project\",\"parameters\":[{\"_type\":\"func\",\"function\":\"filter\",\"parameters\":[{\"_type\":\"func\",\"function\":\"getAll\",\"parameters\":[{\"_type\":\"packageableElementPtr\",\"fullPath\":\"domain::Example\"}]},{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"in\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"x\"}],\"property\":\"caseType\"},{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":3,\"upperBound\":3},\"values\":[{\"_type\":\"string\",\"value\":\"Case 3\"},{\"_type\":\"string\",\"value\":\"Case 2\"},{\"_type\":\"string\",\"value\":\"Case 1\"}]}]}],\"parameters\":[{\"_type\":\"var\",\"name\":\"x\"}]}]},{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"values\":[{\"_type\":\"lambda\",\"body\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"x\"}],\"property\":\"cases\"}],\"parameters\":[{\"_type\":\"var\",\"name\":\"x\"}]}]},{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"values\":[{\"_type\":\"string\",\"value\":\"Cases\"}]}]},{\"_type\":\"var\",\"class\":\"Integer\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"GENERATEDL0L1\"}]}],\"parameters\":[]}", actualSpec); + Assert.assertEquals("{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"take\",\"parameters\":[{\"_type\":\"func\",\"function\":\"project\",\"parameters\":[{\"_type\":\"func\",\"function\":\"filter\",\"parameters\":[{\"_type\":\"func\",\"function\":\"getAll\",\"parameters\":[{\"_type\":\"packageableElementPtr\",\"fullPath\":\"domain::Example\"}]},{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"in\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"x\"}],\"property\":\"caseType\"},{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":3,\"upperBound\":3},\"values\":[{\"_type\":\"string\",\"value\":\"Case 3\"},{\"_type\":\"string\",\"value\":\"Case 2\"},{\"_type\":\"string\",\"value\":\"Case 1\"}]}]}],\"parameters\":[{\"_type\":\"var\",\"name\":\"x\"}]}]},{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"values\":[{\"_type\":\"lambda\",\"body\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"x\"}],\"property\":\"cases\"}],\"parameters\":[{\"_type\":\"var\",\"name\":\"x\"}]}]},{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"values\":[{\"_type\":\"string\",\"value\":\"Cases\"}]}]},{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"GENERATEDL0L1\"}]}],\"parameters\":[]}", actualSpec); assert (IntStream.range(0, spec.getParameterValues().size()).allMatch(index -> parameterValueCompare(spec.getParameterValues().get(index), expectedParameters.get(index)))); assert (IntStream.range(0, spec.getVariables().size()).allMatch(index -> variableCompare(spec.getVariables().get(index), expectedVariables.get(index)))); @@ -102,7 +103,7 @@ private Boolean parameterValueCompare(ParameterValue a, ParameterValue b) private Boolean variableCompare(Variable a, Variable b) { - return a.name.equals(b.name) && a._class.path.equals(b._class.path) && a.multiplicity.equals(b.multiplicity); + return a.name.equals(b.name) && ((PackageableType) a.genericType.rawType).fullPath.equals(((PackageableType) a.genericType.rawType).fullPath) && a.multiplicity.equals(b.multiplicity); } private ParameterValue createParameterValue(String name, ValueSpecification value) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/main/java/org/finos/legend/engine/language/pure/compiler/api/Compile.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/main/java/org/finos/legend/engine/language/pure/compiler/api/Compile.java index 91add3ec413..452c3f598a1 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/main/java/org/finos/legend/engine/language/pure/compiler/api/Compile.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/main/java/org/finos/legend/engine/language/pure/compiler/api/Compile.java @@ -28,7 +28,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContext; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextPointer; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.shared.core.identity.Identity; import org.finos.legend.engine.shared.core.kerberos.ProfileManagerHelper; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/test/java/org/finos/legend/engine/language/pure/compiler/api/test/TestCompileApi.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/test/java/org/finos/legend/engine/language/pure/compiler/api/test/TestCompileApi.java index 09b36ef8b99..72265e40723 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/test/java/org/finos/legend/engine/language/pure/compiler/api/test/TestCompileApi.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler-http-api/src/test/java/org/finos/legend/engine/language/pure/compiler/api/test/TestCompileApi.java @@ -17,19 +17,17 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import net.javacrumbs.jsonunit.JsonAssert; -import org.finos.legend.engine.language.pure.compiler.Compiler; import org.finos.legend.engine.language.pure.compiler.api.Compile; import org.finos.legend.engine.language.pure.compiler.api.LambdaReturnTypeInput; -import org.finos.legend.engine.language.pure.compiler.toPureGraph.PureModel; import org.finos.legend.engine.language.pure.grammar.from.PureGrammarParser; import org.finos.legend.engine.language.pure.modelManager.ModelManager; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextText; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.Column; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.shared.core.ObjectMapperFactory; import org.finos.legend.engine.shared.core.deployment.DeploymentMode; -import org.finos.legend.engine.shared.core.identity.Identity; import org.junit.Assert; import org.junit.Test; @@ -113,9 +111,9 @@ public void testRelationType() throws JsonProcessingException lambdaReturnTypeInput.model = text; lambdaReturnTypeInput.lambda = lambda; String stringResult = objectMapper.writeValueAsString(compileApi.lambdaRelationType(lambdaReturnTypeInput, null, null).getEntity()); - org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType relationType = objectMapper.readValue(stringResult, RelationType.class); + RelationType relationType = objectMapper.readValue(stringResult, RelationType.class); Assert.assertEquals(1, relationType.columns.size()); - org.finos.legend.engine.protocol.pure.v1.model.relationType.Column column = relationType.columns.get(0); + Column column = relationType.columns.get(0); Assert.assertEquals("Person Name", column.name); Assert.assertEquals("String", column.type); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/Compiler.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/Compiler.java index 3dd7d648f7c..0d7d00c5f5d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/Compiler.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/Compiler.java @@ -66,7 +66,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation return (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation.RelationType) type; } - public static org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType getLambdaRelationType(Lambda lambda, PureModel pureModel) + public static org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType getLambdaRelationType(Lambda lambda, PureModel pureModel) { return RelationTypeHelper.convert(buildLambdaRelationType(lambda, pureModel)); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/AssociationCompilerExtension.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/AssociationCompilerExtension.java index 6dfd98921fd..fea0aecc162 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/AssociationCompilerExtension.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/AssociationCompilerExtension.java @@ -23,6 +23,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Association; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Class; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_relationship_Association_Impl; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement; @@ -74,8 +75,8 @@ private void associationSecondPass(Association srcAssociation, CompileContext co { String packageString = context.pureModel.buildPackageString(srcAssociation._package, srcAssociation.name); org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Association association = context.pureModel.getAssociation(packageString, srcAssociation.sourceInformation); - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class source = context.resolveClass(srcAssociation.properties.get(0).type, srcAssociation.properties.get(0).sourceInformation); - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class target = context.resolveClass(srcAssociation.properties.get(1).type, srcAssociation.properties.get(1).sourceInformation); + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class source = context.resolveClass(((PackageableType) srcAssociation.properties.get(0).genericType.rawType).fullPath, srcAssociation.properties.get(0).sourceInformation); + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class target = context.resolveClass(((PackageableType) srcAssociation.properties.get(1).genericType.rawType).fullPath, srcAssociation.properties.get(1).sourceInformation); String property0Ref = context.pureModel.addPrefixToTypeReference(HelperModelBuilder.getElementFullPath(source, context.pureModel.getExecutionSupport())); String property1Ref = context.pureModel.addPrefixToTypeReference(HelperModelBuilder.getElementFullPath(target, context.pureModel.getExecutionSupport())); @@ -106,7 +107,7 @@ private void associationSecondPass(Association srcAssociation, CompileContext co ListIterable> qualifiedProperties = ListIterate.collect(srcAssociation.qualifiedProperties, p -> { - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class cl = context.resolveGenericType(p.returnType, p.sourceInformation)._rawType() == source ? target : source; + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class cl = context.newGenericType(p.returnGenericType)._rawType() == source ? target : source; return HelperModelBuilder.processQualifiedPropertyFirstPass(context, association, org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement.getUserPathForPackageableElement(cl), ctx).valueOf(p); }); qualifiedProperties.forEach(q -> @@ -118,22 +119,22 @@ private void associationSecondPass(Association srcAssociation, CompileContext co } }); ctx.flushVariable("this"); - association._originalMilestonedProperties(ListIterate.collect(srcAssociation.originalMilestonedProperties, HelperModelBuilder.processProperty(context, context.pureModel.getGenericTypeFromIndex(srcAssociation.properties.get(0).type), association))) + association._originalMilestonedProperties(ListIterate.collect(srcAssociation.originalMilestonedProperties, HelperModelBuilder.processProperty(context, context.newGenericType(srcAssociation.properties.get(0).genericType), association))) ._properties(Lists.mutable.with(property1, property2)) ._qualifiedProperties(qualifiedProperties); } private void associationThirdPass(Association srcAssociation, CompileContext context) { - String property0Ref = context.pureModel.addPrefixToTypeReference(srcAssociation.properties.get(0).type); - String property1Ref = context.pureModel.addPrefixToTypeReference(srcAssociation.properties.get(1).type); + String property0Ref = context.pureModel.addPrefixToTypeReference(((PackageableType)srcAssociation.properties.get(0).genericType.rawType).fullPath); + String property1Ref = context.pureModel.addPrefixToTypeReference(((PackageableType)srcAssociation.properties.get(1).genericType.rawType).fullPath); org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Association association = context.pureModel.getAssociation(context.pureModel.buildPackageString(srcAssociation._package, srcAssociation.name), srcAssociation.sourceInformation); ProcessingContext ctx = new ProcessingContext("Association " + context.pureModel.buildPackageString(srcAssociation._package, srcAssociation.name) + " (third pass)"); ListIterate.collect(srcAssociation.qualifiedProperties, property -> { - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification thisVariable = HelperModelBuilder.createThisVariableForClass(context, srcAssociation.properties.get(0).type.equals(property.returnType) ? property1Ref : property0Ref); + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification thisVariable = HelperModelBuilder.createThisVariableForClass(context, ((PackageableType) srcAssociation.properties.get(0).genericType.rawType).fullPath.equals(((PackageableType)property.returnGenericType.rawType).fullPath) ? property1Ref : property0Ref); ctx.addInferredVariables("this", thisVariable); ctx.push("Qualified Property " + property.name); ListIterate.collect(property.parameters, expression -> expression.accept(new ValueSpecificationBuilder(context, org.eclipse.collections.api.factory.Lists.mutable.empty(), ctx))); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingFirstPassBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingFirstPassBuilder.java index 552c5bbd9c1..bf6fe7043d2 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingFirstPassBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingFirstPassBuilder.java @@ -30,6 +30,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.aggregationAware.AggregateSetImplementationContainer; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.aggregationAware.AggregationAwareClassMapping; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.mapping.PureInstanceClassMapping; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.pure.generated.Root_meta_external_store_model_PureInstanceSetImplementation_Impl; import org.finos.legend.pure.generated.Root_meta_pure_mapping_MergeOperationSetImplementation_Impl; @@ -119,7 +121,7 @@ public Pair> visit(Pu { Variable param = new Variable(); param.name = "src"; - param._class = new PackageableElementPointer(PackageableElementType.CLASS, classMapping.srcClass); + param.genericType = new GenericType(new PackageableType(classMapping.srcClass)); param.multiplicity = new Multiplicity(1, 1); params = Lists.mutable.with(param); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingThirdPassBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingThirdPassBuilder.java index df95ae27e62..77abf9c7e10 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingThirdPassBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ClassMappingThirdPassBuilder.java @@ -26,7 +26,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.mapping.PureInstanceClassMapping; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.mapping.PurePropertyMapping; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.shared.core.operational.Assert; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.pure.generated.core_pure_router_operations_router_operations; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/CompileContext.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/CompileContext.java index b42e890b265..11732d6c21a 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/CompileContext.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/CompileContext.java @@ -22,6 +22,7 @@ import org.eclipse.collections.api.map.MutableMap; import org.eclipse.collections.api.set.ImmutableSet; import org.eclipse.collections.api.tuple.Pair; +import org.eclipse.collections.impl.utility.ListIterate; import org.finos.legend.engine.language.pure.compiler.toPureGraph.extension.CompilerExtensions; import org.finos.legend.engine.language.pure.compiler.toPureGraph.extension.Processor; import org.finos.legend.engine.language.pure.compiler.toPureGraph.handlers.builder.FunctionExpressionBuilder; @@ -33,6 +34,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TagPtr; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.section.ImportAwareCodeSection; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.section.Section; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.shared.core.deployment.DeploymentMode; import org.finos.legend.engine.shared.core.identity.Identity; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; @@ -47,6 +50,8 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValue; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.ConcreteFunctionDefinition; +import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity; +import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enum; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enumeration; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Measure; @@ -57,7 +62,12 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification; import org.finos.legend.pure.m3.coreinstance.meta.pure.store.Store; import org.finos.legend.pure.m3.execution.ExecutionSupport; +import org.finos.legend.pure.m3.navigation.M3Paths; +import org.finos.legend.pure.m3.navigation.ProcessorSupport; +import org.finos.legend.pure.m3.navigation._class._Class; import org.finos.legend.pure.m3.navigation._package._Package; +import org.finos.legend.pure.m3.navigation.relation._Column; +import org.finos.legend.pure.m3.navigation.relation._RelationType; import org.slf4j.Logger; import java.util.List; @@ -540,23 +550,106 @@ private MutableMap searchImports(String name, Function public GenericType newGenericType(Type rawType) { - return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(rawType); + return newGenericType(rawType, this.pureModel); } public GenericType newGenericType(Type rawType, GenericType typeArgument) { - return newGenericType(rawType, Lists.fixedSize.with(typeArgument)); + return newGenericType(rawType, this.pureModel)._typeArguments(Lists.fixedSize.with(typeArgument)); } public GenericType newGenericType(Type rawType, RichIterable typeArguments) { - return newGenericType(rawType)._typeArguments(typeArguments); + return newGenericType(rawType, this.pureModel)._typeArguments(typeArguments); + } + + public GenericType newGenericType(Type rawType, RichIterable typeArguments, RichIterable multiplicityArguments) + { + return newGenericType(rawType, this.pureModel)._typeArguments(typeArguments)._multiplicityArguments(multiplicityArguments); + } + + public static org.finos.legend.engine.protocol.pure.v1.model.type.GenericType convertGenericType(GenericType genericType) + { + org.finos.legend.engine.protocol.pure.v1.model.type.Type rType; + if (genericType._rawType() instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation.RelationType) + { + rType = RelationTypeHelper.convert((org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relation.RelationType) genericType._rawType()); + } + else + { + rType = new PackageableType(org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement.getUserPathForPackageableElement(genericType._rawType())); + } + return new org.finos.legend.engine.protocol.pure.v1.model.type.GenericType(rType, genericType._typeArguments().collect(CompileContext::convertGenericType).toList()); + } + + public GenericType newGenericType(org.finos.legend.engine.protocol.pure.v1.model.type.GenericType genericType) + { + ProcessorSupport processorSupport = pureModel.getExecutionSupport().getProcessorSupport(); + GenericType gt = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass(M3Paths.GenericType)); + SourceInformation si = null; + org.finos.legend.engine.protocol.pure.v1.model.type.Type protocolType = genericType.rawType; + Type type = null; + if (protocolType instanceof PackageableType) + { + si = ((PackageableType) protocolType).sourceInformation; + type = this.resolveType(((PackageableType) protocolType).fullPath, si); + } + else if (protocolType instanceof RelationType) + { + si = ((RelationType) protocolType).sourceInformation; + type = _RelationType.build( + ListIterate.collect(((RelationType) protocolType).columns, x -> _Column.getColumnInstance(x.name, false, x.type, (Multiplicity) org.finos.legend.pure.m3.navigation.multiplicity.Multiplicity.newMultiplicity(0, 1, processorSupport), null, processorSupport)), + SourceInformationHelper.toM3SourceInformation(si), + processorSupport + ); + } + else + { + throw new EngineException(genericType.rawType.getClass() + " is not supported yet!", genericType.sourceInformation, EngineErrorType.COMPILATION); + } + + if (type instanceof Class) + { + if ((((Class) type)._typeParameters().size() != genericType.typeArguments.size())) + { + throw new EngineException("Missing type arguments for type: " + _Class.print(type), ((PackageableType) genericType.rawType).sourceInformation, EngineErrorType.COMPILATION); + } + if ((((Class) type)._multiplicityParameters().size() != genericType.multiplicityArguments.size())) + { + throw new EngineException("Missing multiplicity arguments for type: " + _Class.print(type), ((PackageableType) genericType.rawType).sourceInformation, EngineErrorType.COMPILATION); + } + } + return gt._rawType(type) + ._typeArguments(ListIterate.collect(genericType.typeArguments, this::newGenericType)) + ._multiplicityArguments(ListIterate.collect(genericType.multiplicityArguments, pureModel::getMultiplicity)); + } + + + public static GenericType newGenericType(Type rawType, PureModel pureModel) + { + return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, pureModel.getClass(M3Paths.GenericType)) + ._rawType(rawType); } + public static GenericType newGenericType(Type rawType, GenericType typeArgument, PureModel pureModel) + { + return newGenericType(rawType, pureModel)._typeArguments(Lists.fixedSize.with(typeArgument)); + } + + public static GenericType newGenericType(Type rawType, RichIterable typeArguments, PureModel pureModel) + { + return newGenericType(rawType, pureModel)._typeArguments(typeArguments); + } + + public static GenericType newGenericType(Type rawType, RichIterable typeArguments, RichIterable multiplicityArguments, PureModel pureModel) + { + return newGenericType(rawType, pureModel)._typeArguments(typeArguments)._multiplicityArguments(multiplicityArguments); + } + + public TaggedValue newTaggedValue(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.TaggedValue taggedValue) { - return new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::extension::TaggedValue")) + return new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, this.pureModel.getClass(M3Paths.TaggedValue)) ._tag(resolveTag(taggedValue.tag)) ._value(taggedValue.value); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/FunctionCompilerExtension.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/FunctionCompilerExtension.java index 640096c721c..5be8006cc83 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/FunctionCompilerExtension.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/FunctionCompilerExtension.java @@ -83,13 +83,13 @@ private PackageableElement functionFirstPass(Function function, CompileContext c context.pureModel.setNameAndPackage(targetFunc, functionSignature, function._package, function.sourceInformation) ._functionName(functionName) // function name to be used in the handler map -> meta::pure::functions::date::isAfterDay - ._classifierGenericType(context.newGenericType(context.pureModel.getType("meta::pure::metamodel::function::ConcreteFunctionDefinition"), PureModel.buildFunctionType(ListIterate.collect(function.parameters, p -> (VariableExpression) p.accept(new ValueSpecificationBuilder(context, Lists.mutable.empty(), ctx))), context.resolveGenericType(function.returnType, function.sourceInformation), context.pureModel.getMultiplicity(function.returnMultiplicity), context.pureModel))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType("meta::pure::metamodel::function::ConcreteFunctionDefinition"), PureModel.buildFunctionType(ListIterate.collect(function.parameters, p -> (VariableExpression) p.accept(new ValueSpecificationBuilder(context, Lists.mutable.empty(), ctx))), context.newGenericType(function.returnGenericType), context.pureModel.getMultiplicity(function.returnMultiplicity), context.pureModel))) ._stereotypes(ListIterate.collect(function.stereotypes, context::resolveStereotype)) ._taggedValues(ListIterate.collect(function.taggedValues, context::newTaggedValue)); HelperModelBuilder.processFunctionConstraints(function, context, targetFunc, ctx); context.pureModel.handlers.register(new UserDefinedFunctionHandler(context.pureModel, functionFullName, targetFunc, - ps -> new TypeAndMultiplicity(context.resolveGenericType(function.returnType, function.sourceInformation), context.pureModel.getMultiplicity(function.returnMultiplicity)), + ps -> new TypeAndMultiplicity(context.newGenericType(function.returnGenericType), context.pureModel.getMultiplicity(function.returnMultiplicity)), ps -> { List vs = ListIterate.collect(function.parameters, p -> p.accept(new ValueSpecificationBuilder(context, Lists.mutable.empty(), ctx))); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java index fd7c68ef5b9..210cb900b0c 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperMappingBuilder.java @@ -72,6 +72,7 @@ import org.finos.legend.pure.generated.Root_meta_pure_metamodel_type_generics_GenericType_Impl; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl; import org.finos.legend.pure.generated.Root_meta_pure_test_AtomicTest; +import org.finos.legend.pure.m2.dsl.mapping.M2MappingPaths; import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.AssociationImplementation; import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.InstanceSetImplementation; import org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping; @@ -93,6 +94,7 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.store.Store; import org.finos.legend.pure.m3.coreinstance.meta.pure.test.Test; +import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m3.navigation.PackageableElement.PackageableElement; import java.util.List; @@ -155,7 +157,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Enumeratio // process enum value mappings String id = getEnumerationMappingId(em); return new Root_meta_pure_mapping_EnumerationMapping_Impl<>(id, SourceInformationHelper.toM3SourceInformation(em.sourceInformation), null) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::mapping::EnumerationMapping"))._typeArguments(Lists.mutable.with(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::type::Any"))))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M2MappingPaths.EnumerationMapping), Lists.mutable.with(context.newGenericType(context.pureModel.getType(M3Paths.Any))))) ._name(id) ._parent(pureMapping) ._enumeration(context.resolveEnumeration(em.enumeration.path, em.enumeration.sourceInformation)) @@ -287,13 +289,13 @@ public static String getClassMappingId(ClassMapping cm, CompileContext context) return cm.id != null ? cm.id : HelperModelBuilder.getElementFullPath(context.resolveClass(cm._class, cm.classSourceInformation), context.pureModel.getExecutionSupport()).replaceAll("::", "_"); } - public static LambdaFunction processPurePropertyMappingTransform(PurePropertyMapping ppm, Lambda lambda, PropertyMappingsImplementation owner, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type inputVarType, CompileContext context, String mappingName) + public static LambdaFunction processPurePropertyMappingTransform(PurePropertyMapping ppm, Lambda lambda, PropertyMappingsImplementation owner, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type inputVarType, CompileContext context, String mappingName) { List expressions = lambda.body; VariableExpression lambdaParam = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression")) ._name("src") ._multiplicity(context.pureModel.getMultiplicity("one")) - ._genericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(inputVarType)); + ._genericType(context.newGenericType(inputVarType)); MutableList pureParameters = Lists.mutable.with(lambdaParam); ProcessingContext ctx = new ProcessingContext("Pure M2M Transform Lambda"); ctx.addInferredVariables("src", lambdaParam); @@ -301,12 +303,11 @@ public static LambdaFunction processPurePropertyMappingTransform(PurePropertyMap MutableList valueSpecifications = ListIterate.collect(expressions, p -> p.accept(new ValueSpecificationBuilder(context, openVariables, ctx))); MutableList cleanedOpenVariables = openVariables.distinct(); cleanedOpenVariables.removeAll(pureParameters.collect(e -> e._name())); - GenericType functionType = context.pureModel.buildFunctionType(pureParameters, valueSpecifications.getLast()._genericType(), valueSpecifications.getLast()._multiplicity(), context.pureModel); + GenericType functionType = PureModel.buildFunctionType(pureParameters, valueSpecifications.getLast()._genericType(), valueSpecifications.getLast()._multiplicity(), context.pureModel); String propertyName = owner._id() + "." + ppm.property.property; - String mappingPath = Root_meta_pure_functions_meta_elementToPath_PackageableElement_1__String_1_(owner._parent(), context.pureModel.getExecutionSupport()).replace("::", "_"); ctx.flushVariable("src"); - return new Root_meta_pure_metamodel_function_LambdaFunction_Impl(propertyName, SourceInformationHelper.toM3SourceInformation(lambda.sourceInformation), null) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction"))._typeArguments(Lists.mutable.with(functionType))) + return new Root_meta_pure_metamodel_function_LambdaFunction_Impl(propertyName, SourceInformationHelper.toM3SourceInformation(lambda.sourceInformation), null) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.LambdaFunction), Lists.mutable.with(functionType))) ._openVariables(cleanedOpenVariables) ._expressionSequence(valueSpecifications); } @@ -438,7 +439,7 @@ private static AggregationFunctionSpecification processAggregationFunction(Aggre if (aggregateFunction.aggregateFn.parameters.size() > 0) { Variable variable = aggregateFunction.aggregateFn.parameters.get(0); - variable._class = new PackageableElementPointer(PackageableElementType.CLASS, PackageableElement.getUserPathForPackageableElement(Handlers.funcReturnType(processed, context.pureModel)._rawType())); + variable.genericType = context.convertGenericType(Handlers.funcReturnType(processed, context.pureModel)); variable.multiplicity = new Multiplicity(1, 1); } afs._aggregateFn((LambdaFunction) ((InstanceValue) aggregateFunction.aggregateFn.accept(new ValueSpecificationBuilder(context, openVariables, processingContext)))._values().getFirst()); @@ -452,13 +453,14 @@ public static Property getMappedProperty(PropertyMapping propertyMapping, Compil // Local property mapping LocalMappingPropertyInfo localMappingPropertyInfo = propertyMapping.localMappingProperty; - GenericType sourceGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")); // Raw type will be populated when mapping class is built - GenericType targetGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) + GenericType sourceGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass(M3Paths.GenericType)); // Raw type will be populated when mapping class is built + GenericType targetGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass(M3Paths.GenericType)) ._rawType(context.resolveType(localMappingPropertyInfo.type, localMappingPropertyInfo.sourceInformation)); - GenericType propertyClassifierGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::Property")) - ._typeArguments(Lists.fixedSize.of(sourceGenericType, targetGenericType)) - ._multiplicityArgumentsAdd(context.pureModel.getMultiplicity(localMappingPropertyInfo.multiplicity)); + GenericType propertyClassifierGenericType = context.newGenericType( + context.pureModel.getType(M3Paths.Property), + Lists.fixedSize.of(sourceGenericType, targetGenericType), + Lists.fixedSize.of(context.pureModel.getMultiplicity(localMappingPropertyInfo.multiplicity)) + ); return new Root_meta_pure_metamodel_function_property_Property_Impl<>(propertyMapping.property.property, SourceInformationHelper.toM3SourceInformation(propertyMapping.sourceInformation), null) ._name(propertyMapping.property.property) @@ -487,14 +489,14 @@ public static void buildMappingClassOutOfLocalProperties(SetImplementation setIm final MappingClass mappingClass = new Root_meta_pure_mapping_MappingClass_Impl<>(mappingClassName); mappingClass._name(mappingClassName); - - GenericType classifierGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::type::Class")) - ._typeArguments(Lists.fixedSize.of(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(mappingClass))); + GenericType classifierGenericType = context.newGenericType( + context.pureModel.getType("meta::pure::metamodel::type::Class"), + Lists.fixedSize.of(context.newGenericType(mappingClass)) + ); mappingClass._classifierGenericType(classifierGenericType); - GenericType superType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(setImplementation._class()); - Generalization newGeneralization = new Root_meta_pure_metamodel_relationship_Generalization_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::relationship::Generalization"))._specific(mappingClass)._general(superType); + GenericType superType = context.newGenericType(setImplementation._class()); + Generalization newGeneralization = new Root_meta_pure_metamodel_relationship_Generalization_Impl("", null, context.pureModel.getClass(M3Paths.Generalization))._specific(mappingClass)._general(superType); mappingClass._generalizations(Lists.immutable.with(newGeneralization)); setImplementation._class()._specializationsAdd(newGeneralization); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperModelBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperModelBuilder.java index 42b0e1a9e7b..8fe96a9a4df 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperModelBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperModelBuilder.java @@ -23,6 +23,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Property; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.shared.core.identity.Identity; import org.finos.legend.engine.shared.core.operational.Assert; @@ -83,11 +84,11 @@ public static org.eclipse.collections.api.block.function.Function(property.name, SourceInformationHelper.toM3SourceInformation(property.sourceInformation), context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) ._name(property.name) ._defaultValue(defaultValue) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::Property"))._typeArguments(Lists.fixedSize.of(genericType, returnGenericType))._multiplicityArgumentsAdd(context.pureModel.getMultiplicity(property.multiplicity))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.Property), Lists.fixedSize.of(genericType, returnGenericType), Lists.fixedSize.of(context.pureModel.getMultiplicity(property.multiplicity)))) ._genericType(returnGenericType) ._multiplicity(context.pureModel.getMultiplicity(property.multiplicity)) ._stereotypes(ListIterate.collect(property.stereotypes, s -> context.resolveStereotype(s.profile, s.value, s.profileSourceInformation, s.sourceInformation))) @@ -136,7 +137,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespe public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification createVariableValueSpecification(CompileContext context, String variableName) { org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification ve = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression"))._name(variableName); - final GenericType genericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("Number")); + final GenericType genericType = context.newGenericType(context.pureModel.getType("Number")); ve._genericType(genericType); ve._multiplicity(context.pureModel.getMultiplicity(Multiplicity.PURE_ONE)); return ve; @@ -145,7 +146,7 @@ public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespe public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression createVariableForMapped(LambdaFunction mapFn, CompileContext context) { org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression ve = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression"))._name("mapped"); - final GenericType genericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(((Root_meta_pure_metamodel_type_FunctionType_Impl) mapFn._classifierGenericType()._typeArguments().getFirst()._rawType())._returnType._rawType()); + final GenericType genericType = context.newGenericType(((Root_meta_pure_metamodel_type_FunctionType_Impl) mapFn._classifierGenericType()._typeArguments().getFirst()._rawType())._returnType._rawType()); ve._genericType(genericType); Multiplicity multiplicity = new Multiplicity(); multiplicity.lowerBound = 0; @@ -168,12 +169,18 @@ public static org.eclipse.collections.api.block.function.Function(property.name, SourceInformationHelper.toM3SourceInformation(property.sourceInformation), null) ._name(property.name) ._functionName(property.name) - ._genericType(context.resolveGenericType(property.returnType, property.sourceInformation)) + ._genericType(context.newGenericType(property.returnGenericType)) ._multiplicity(context.pureModel.getMultiplicity(property.returnMultiplicity)) ._stereotypes(ListIterate.collect(property.stereotypes, s -> context.resolveStereotype(s.profile, s.value, s.profileSourceInformation, s.sourceInformation))) ._taggedValues(ListIterate.collect(property.taggedValues, t -> new Root_meta_pure_metamodel_extension_TaggedValue_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::extension::TaggedValue"))._tag(context.resolveTag(t.tag.profile, t.tag.value, t.tag.profileSourceInformation, t.sourceInformation))._value(t.value))) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty")) - ._typeArguments(Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVariable).withAll(ListIterate.collect(property.parameters, p -> (VariableExpression) p.accept(new ValueSpecificationBuilder(context, Lists.mutable.empty(), processingContext)))), context.resolveGenericType(property.returnType, property.sourceInformation), context.pureModel.getMultiplicity(property.returnMultiplicity), context.pureModel)))) + ._classifierGenericType( + context.newGenericType( + context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty"), + Lists.fixedSize.of( + PureModel.buildFunctionType(Lists.mutable.of(thisVariable).withAll(ListIterate.collect(property.parameters, p -> (VariableExpression) p.accept(new ValueSpecificationBuilder(context, Lists.mutable.empty(), processingContext)))), context.newGenericType(property.returnGenericType), context.pureModel.getMultiplicity(property.returnMultiplicity), context.pureModel) + ) + ) + ) ._owner(owner); }; } @@ -308,14 +315,14 @@ private static String terseSignatureSuffix(Function function) { String functionSignature = LazyIterate.collect(function.parameters, HelperModelBuilder::getParameterSignature).select(Objects::nonNull).makeString("__") // TODO: do we have to take care of void return type ~ Nil? - + "__" + getClassSignature(function.returnType) + "_" + getMultiplicitySignature(function.returnMultiplicity) + "_"; + + "__" + getClassSignature(((PackageableType) function.returnGenericType.rawType).fullPath) + "_" + getMultiplicitySignature(function.returnMultiplicity) + "_"; return function.parameters.isEmpty() ? functionSignature : ("_" + functionSignature); } private static String getParameterSignature(Variable p) { - return p._class != null ? getClassSignature(p._class.path) + "_" + getMultiplicitySignature(p.multiplicity) : null; + return p.genericType != null ? getClassSignature(((PackageableType) p.genericType.rawType).fullPath) + "_" + getMultiplicitySignature(p.multiplicity) : null; } private static String getClassSignature(String _class) @@ -417,7 +424,7 @@ public static AbstractProperty getOwnedAppliedProperty(org.finos.legend.pure. public static AbstractProperty getAllOwnedAppliedProperty(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PropertyOwner propertyOwner, String name, org.finos.legend.engine.protocol.pure.v1.model.SourceInformation sourceInformation, CompiledExecutionSupport executionSupport) { AbstractProperty prop = null; - if (propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class) + if (propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class) { org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class _class = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class) propertyOwner; prop = _class._properties().detect(p -> name.equals(p.getName())); @@ -439,7 +446,7 @@ else if (propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pur org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Association _association = (Association) propertyOwner; prop = _association._properties().detect(p -> name.equals(p.getName())); } - String propertyOwnerType = propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class ? "class" : "association"; + String propertyOwnerType = propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class ? "class" : "association"; Assert.assertTrue(prop != null, () -> "Can't find property '" + name + "' in " + propertyOwnerType + " '" + (getElementFullPath(propertyOwner, executionSupport)) + "'", sourceInformation, EngineErrorType.COMPILATION); return prop; } @@ -452,7 +459,7 @@ else if (propertyOwner instanceof org.finos.legend.pure.m3.coreinstance.meta.pur return getPropertyOrResolvedEdgePointProperty(context, _class, parameters, name, false, sourceInformation); } - public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property getPropertyOrResolvedEdgePointProperty(CompileContext context, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class _class, Optional> parameters, String name, boolean excludeQualified, org.finos.legend.engine.protocol.pure.v1.model.SourceInformation sourceInformation) + public static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property getPropertyOrResolvedEdgePointProperty(CompileContext context, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Class _class, Optional> parameters, String name, boolean excludeQualified, org.finos.legend.engine.protocol.pure.v1.model.SourceInformation sourceInformation) { AbstractProperty abstractProperty = HelperModelBuilder.getAppliedProperty(context, _class, parameters, name, excludeQualified, sourceInformation); if ((abstractProperty instanceof QualifiedProperty) && Milestoning.temporalStereotypes(((PackageableElement) abstractProperty._genericType()._rawType())._stereotypes()) != null) @@ -535,7 +542,7 @@ else if (excludeQualified) public static boolean isCompatibleDerivedPropertyWithParameters(QualifiedProperty o, List params) { - FunctionType rawType = (FunctionType) o._classifierGenericType()._typeArguments().getFirst()._rawType(); + FunctionType rawType = (FunctionType) o._classifierGenericType()._typeArguments().getFirst()._rawType(); return rawType._parameters().size() == params.size(); // && rawType._parameters().zip(params).allSatisfy(v1 -> v1.getOne()._name().equals(((Variable) v1.getTwo()).name)); // FIXME: we might need to be smarter about which property to choose (use types for example) @@ -546,7 +553,7 @@ public static boolean isCompatibleDerivedPropertyWithParameters(QualifiedPropert public static boolean isCompatibleDerivedProperty(QualifiedProperty o, org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.QualifiedProperty p) { - return o._name() == p.name && isCompatibleDerivedPropertyWithParameters(o, Lists.mutable.of(new Variable()).withAll(p.parameters)); + return o._name().equals(p.name) && isCompatibleDerivedPropertyWithParameters(o, Lists.mutable.of(new Variable()).withAll(p.parameters)); } public static String getTypeFullPath(Type type, CompiledExecutionSupport executionSupport) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperValueSpecificationBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperValueSpecificationBuilder.java index 2d6321a31a9..4b537ce499a 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperValueSpecificationBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/HelperValueSpecificationBuilder.java @@ -30,10 +30,10 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.PropertyGraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.SubTypeGraphFetchTree; @@ -45,7 +45,6 @@ import org.finos.legend.pure.generated.Root_meta_pure_graphFetch_RootGraphFetchTree_Impl; import org.finos.legend.pure.generated.Root_meta_pure_graphFetch_SubTypeGraphFetchTree_Impl; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_function_LambdaFunction_Impl; -import org.finos.legend.pure.generated.Root_meta_pure_metamodel_type_generics_GenericType_Impl; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_valuespecification_SimpleFunctionExpression_Impl; import org.finos.legend.pure.generated.Root_meta_pure_router_analytics_AnalyticsExecutionContext_Impl; @@ -68,6 +67,7 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpressionAccessor; +import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m3.navigation.relation._RelationType; import java.util.HashSet; @@ -134,7 +134,7 @@ public static LambdaFunction buildLambdaWithContext(String lambdaId, List(lambdaId) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction"))._typeArguments(FastList.newListWith(functionType))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.LambdaFunction), FastList.newListWith(functionType))) ._openVariables(cleanedOpenVariables) ._expressionSequence(valueSpecifications); @@ -266,15 +266,8 @@ else if (foundFunction instanceof QualifiedProperty) } appliedProperty.parameters.addAll(localParameters); automaLambdaparam.name = automapName; - Type inferredVariableType = inferredVariable._genericType()._rawType(); - if (inferredVariableType instanceof RelationType) - { - automaLambdaparam.relationType = RelationTypeHelper.convert((RelationType) inferredVariableType); - } - else - { - automaLambdaparam._class = new PackageableElementPointer(PackageableElementType.CLASS, HelperModelBuilder.getTypeFullPath(inferredVariableType, context.pureModel.getExecutionSupport())); - } + GenericType inferredVariableType = inferredVariable._genericType(); + automaLambdaparam.genericType = CompileContext.convertGenericType(inferredVariableType); automaLambdaparam.multiplicity = Multiplicity.PURE_ONE; automapLambda.body = Lists.mutable.of(appliedProperty); @@ -423,9 +416,7 @@ private static GraphFetchTree buildRootGraphFetchTree(RootGraphFetchTree rootGra ListIterable children = ListIterate.collect(rootGraphFetchTree.subTrees, subTree -> buildGraphFetchTree(subTree, context, _class, openVariables, processingContext)); ListIterable subTypeTrees = ListIterate.collect(rootGraphFetchTree.subTypeTrees, subTypeTree -> buildSubTypeGraphFetchTree((SubTypeGraphFetchTree) subTypeTree, context, _class, openVariables, processingContext)); Class classifier = context.pureModel.getClass("meta::pure::graphFetch::RootGraphFetchTree"); - GenericType genericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(classifier) - ._typeArguments(Lists.fixedSize.of(context.pureModel.getGenericType(_class))); + GenericType genericType = context.newGenericType(classifier, Lists.fixedSize.of(context.pureModel.getGenericType(_class))); return new Root_meta_pure_graphFetch_RootGraphFetchTree_Impl<>("", SourceInformationHelper.toM3SourceInformation(rootGraphFetchTree.sourceInformation), classifier) ._class(_class) ._classifierGenericType(genericType) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/Milestoning.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/Milestoning.java index b15aa2ae6b5..e62b913b443 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/Milestoning.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/Milestoning.java @@ -125,13 +125,10 @@ public static Iterable generateMilestoningProperties(Class generateMilestoningDateProperties(CompileContext context, MilestoningStereotype milestoningStereotype, Class owner) { GenericType dateGenericType = context.pureModel.getGenericType("Date"); - MutableList generatedMilestoningDateProperties = Lists.mutable.ofAll(milestoningStereotype.getTemporalDatePropertyNames()).collect(name -> new Root_meta_pure_metamodel_function_property_Property_Impl<>(name,null,context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) + MutableList generatedMilestoningDateProperties = Lists.mutable.ofAll(milestoningStereotype.getTemporalDatePropertyNames()).collect(name -> new Root_meta_pure_metamodel_function_property_Property_Impl<>(name, null, context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) ._name(name) ._genericType(dateGenericType) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::Property")) - ._typeArguments(Lists.fixedSize.of(owner._classifierGenericType(), dateGenericType)) - ._multiplicityArgumentsAdd(context.pureModel.getMultiplicity("zeroone"))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.Property), Lists.fixedSize.of(owner._classifierGenericType(), dateGenericType), Lists.fixedSize.of(context.pureModel.getMultiplicity("zeroone")))) ._multiplicity(context.pureModel.getMultiplicity("one")) ._stereotypes(Lists.fixedSize.of(generatedMilestoningStereotype(context, GeneratedMilestoningStereotype.generatedmilestoningdateproperty))) ._owner(owner)); @@ -141,13 +138,12 @@ private static MutableList generateMilestoningDateProperties(CompileCo private static Property generateMilestoningRangeProperty(CompileContext context, MilestoningStereotype milestoningStereotype, Class owner) { GenericType milestoningRangePropertyGenericType = context.resolveGenericType(milestoningStereotype.getMilestoningPropertyClassName()); - Property generatedMilestoningRangeProperty = new Root_meta_pure_metamodel_function_property_Property_Impl<>(MilestoningFunctions.MILESTONING,null,context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) + Property generatedMilestoningRangeProperty = new Root_meta_pure_metamodel_function_property_Property_Impl<>(MilestoningFunctions.MILESTONING, null, context.pureModel.getClass("meta::pure::metamodel::function::property::Property")) ._name(MilestoningFunctions.MILESTONING) ._genericType(milestoningRangePropertyGenericType) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::Property")) - ._typeArguments(Lists.fixedSize.of(owner._classifierGenericType(), milestoningRangePropertyGenericType)) - ._multiplicityArgumentsAdd(context.pureModel.getMultiplicity("zeroone"))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.Property), + Lists.fixedSize.of(owner._classifierGenericType(), milestoningRangePropertyGenericType), + Lists.fixedSize.of(context.pureModel.getMultiplicity("zeroone")))) ._multiplicity(context.pureModel.getMultiplicity("zeroone")) ._stereotypes(Lists.fixedSize.of(generatedMilestoningStereotype(context, GeneratedMilestoningStereotype.generatedmilestoningdateproperty))) ._owner(owner); @@ -221,9 +217,9 @@ private static MilestoningPropertyTransformation milestoningPropertyTransformati private static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property edgePointProperty(PropertyOwner owner, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property originalProperty, MutableList stereotypes, CompileContext context) { String edgePointPropertyName = MilestoningFunctions.getEdgePointPropertyName(originalProperty._name()); - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity multiplicity = new Root_meta_pure_metamodel_multiplicity_Multiplicity_Impl("",null,context.pureModel.getType(M3Paths.Multiplicity)) + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity multiplicity = new Root_meta_pure_metamodel_multiplicity_Multiplicity_Impl("", null, context.pureModel.getType(M3Paths.Multiplicity)) ._lowerBound(originalProperty._multiplicity()._lowerBound()) - ._upperBound(new Root_meta_pure_metamodel_multiplicity_MultiplicityValue_Impl("",null,context.pureModel.getType(M3Paths.MultiplicityValue))._value(-1L)); + ._upperBound(new Root_meta_pure_metamodel_multiplicity_MultiplicityValue_Impl("", null, context.pureModel.getType(M3Paths.MultiplicityValue))._value(-1L)); return newProperty(owner, originalProperty, edgePointPropertyName, multiplicity, stereotypes, context); } @@ -264,10 +260,8 @@ private static QualifiedProperty newSingleDateMilestoningQualifiedPropertyNoA GenericType functionType = PureModel.buildFunctionType(Lists.fixedSize.of(v_milestoning), context.pureModel.getGenericType("Boolean"), context.pureModel.getMultiplicity("one"), context.pureModel); - LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::function::LambdaFunction")) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction")) - ._typeArguments(Lists.mutable.with(functionType))) + LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass(M3Paths.LambdaFunction)) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.LambdaFunction), Lists.mutable.with(functionType))) ._openVariables(Lists.fixedSize.of("this")) ._expressionSequence(Lists.fixedSize.of(equalExpression)); @@ -290,9 +284,10 @@ private static QualifiedProperty newSingleDateMilestoningQualifiedPropertyNoA ._multiplicity(context.pureModel.getMultiplicity("zeromany")) ._parametersValues(Lists.fixedSize.of(filterLhs, filterInstanceValue)); - GenericType classifierGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty")) - ._typeArguments(Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar), qualifiedProperty._genericType(), originalProperty._multiplicity(), context.pureModel))); + GenericType classifierGenericType = context.newGenericType( + context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty"), + Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar), qualifiedProperty._genericType(), originalProperty._multiplicity(), context.pureModel)) + ); SimpleFunctionExpression finalExpression = filterExpression; if (originalProperty._multiplicity() == context.pureModel.getMultiplicity("one")) @@ -347,10 +342,8 @@ private static MutableList> newSingleDateMilestoningQualifi GenericType functionType = PureModel.buildFunctionType(Lists.fixedSize.of(v_milestoning), context.pureModel.getGenericType("Boolean"), context.pureModel.getMultiplicity("one"), context.pureModel); - LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::function::LambdaFunction")) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction")) - ._typeArguments(Lists.mutable.with(functionType))) + LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass(M3Paths.LambdaFunction)) + ._classifierGenericType(context.newGenericType(context.pureModel.getType(M3Paths.LambdaFunction), Lists.mutable.with(functionType))) ._openVariables(returnTypeMilestoningStereotype.getTemporalDatePropertyNames()) ._expressionSequence(Lists.fixedSize.of(equalExpression)); @@ -384,9 +377,10 @@ private static MutableList> newSingleDateMilestoningQualifi ._parametersValues(Lists.fixedSize.of(filterExpression)); } - GenericType classifierGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty")) - ._typeArguments(Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar).withAll(datesToCompare.collect(Pair::getOne)), qualifiedProperty._genericType(), originalProperty._multiplicity(), context.pureModel))); + GenericType classifierGenericType = context.newGenericType( + context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty"), + Lists.fixedSize.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar).withAll(datesToCompare.collect(Pair::getOne)), qualifiedProperty._genericType(), originalProperty._multiplicity(), context.pureModel)) + ); qualifiedProperty._classifierGenericType(classifierGenericType); qualifiedProperty._expressionSequence(Lists.fixedSize.of(finalExpression)); @@ -438,9 +432,11 @@ private static MutableList> generateMilestoningRangeQualifi ._parametersValues(Lists.mutable.of(temporalDatePropertyExp, inputStartDate)); LambdaFunction filterLambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::function::LambdaFunction")) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction")) - ._typeArguments(Lists.mutable.of(PureModel.buildFunctionType(Lists.mutable.of(v_milestoning), context.pureModel.getGenericType("Boolean"), context.pureModel.getMultiplicity("one"), context.pureModel)))) + ._classifierGenericType( + context.newGenericType( + context.pureModel.getType(M3Paths.LambdaFunction), + Lists.mutable.of(PureModel.buildFunctionType(Lists.mutable.of(v_milestoning), context.pureModel.getGenericType("Boolean"), context.pureModel.getMultiplicity("one"), context.pureModel)) + )) ._openVariables(Lists.mutable.of(temporalDatePropertyName)) ._expressionSequence(Lists.mutable.of(equalExpression)); @@ -464,9 +460,7 @@ private static MutableList> generateMilestoningRangeQualifi ._parametersValues(Lists.mutable.of(filterLhs, filterInstanceValue)); QualifiedProperty milestoningRangeQualifiedProperty = getQualifiedProperty(propertyOwner, originalProperty, qualifiedPropertyName, originalProperty._multiplicity(), stereotypes) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty")) - ._typeArguments(Lists.mutable.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar, inputStartDate, inputEndDate), originalProperty._genericType(), originalProperty._multiplicity(), context.pureModel)))) + ._classifierGenericType(context.newGenericType(context.pureModel.getType("meta::pure::metamodel::function::property::QualifiedProperty"), Lists.mutable.of(PureModel.buildFunctionType(Lists.mutable.of(thisVar, inputStartDate, inputEndDate), originalProperty._genericType(), originalProperty._multiplicity(), context.pureModel)))) ._expressionSequence(Lists.mutable.of(filterExpression)); generatedMilestoningRangeQualifiedProperty.add(milestoningRangeQualifiedProperty); @@ -476,7 +470,7 @@ private static MutableList> generateMilestoningRangeQualifi private static org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property newProperty(PropertyOwner owner, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property originalProperty, String name, org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity multiplicity, ListIterable stereotypes, CompileContext context) { - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property property = newAbstractProperty(owner, originalProperty, name, multiplicity, stereotypes, new Root_meta_pure_metamodel_function_property_Property_Impl(name,null,context.pureModel.getClass("meta::pure::metamodel::function::property::Property"))); + org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property property = newAbstractProperty(owner, originalProperty, name, multiplicity, stereotypes, new Root_meta_pure_metamodel_function_property_Property_Impl(name, null, context.pureModel.getClass("meta::pure::metamodel::function::property::Property"))); property._classifierGenericType(originalProperty._classifierGenericType()); return property; } @@ -510,7 +504,7 @@ private static Predicate isGeneratedMilestoningNonDateProperty() public static Boolean isGeneratedMilestoningQualifiedProperty(AbstractProperty p) { - return (p._stereotypes().anySatisfy(s -> s._value().equals(GeneratedMilestoningStereotype.generatedmilestoningproperty.name())) && (p instanceof QualifiedProperty)) ? true : false; + return (p._stereotypes().anySatisfy(s -> s._value().equals(GeneratedMilestoningStereotype.generatedmilestoningproperty.name())) && (p instanceof QualifiedProperty)) ? true : false; } public static Boolean isDateArgGeneratedMilestoningQualifiedProperty(AbstractProperty p) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PackageableElementMilestoningPassBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PackageableElementMilestoningPassBuilder.java index 681b9898e73..96f7f7a8829 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PackageableElementMilestoningPassBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PackageableElementMilestoningPassBuilder.java @@ -27,6 +27,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.Mapping; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.runtime.PackageableRuntime; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.section.SectionIndex; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property; @@ -68,8 +69,8 @@ public PackageableElement visit(Class srcClass) @Override public PackageableElement visit(Association srcAssociation) { - String property0Ref = this.context.pureModel.addPrefixToTypeReference(srcAssociation.properties.get(0).type); - String property1Ref = this.context.pureModel.addPrefixToTypeReference(srcAssociation.properties.get(1).type); + String property0Ref = this.context.pureModel.addPrefixToTypeReference(((PackageableType) srcAssociation.properties.get(0).genericType.rawType).fullPath); + String property1Ref = this.context.pureModel.addPrefixToTypeReference(((PackageableType) srcAssociation.properties.get(1).genericType.rawType).fullPath); String packageString = this.context.pureModel.buildPackageString(srcAssociation._package, srcAssociation.name); org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Association association = this.context.pureModel.getAssociation(packageString, srcAssociation.sourceInformation); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PropertyMappingBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PropertyMappingBuilder.java index ff8808a79a8..5843f045cfa 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PropertyMappingBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PropertyMappingBuilder.java @@ -48,6 +48,7 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression; +import org.finos.legend.pure.m3.navigation.M3Paths; import org.finos.legend.pure.m4.coreinstance.SourceInformation; import java.util.function.Function; @@ -149,11 +150,11 @@ public PropertyMapping visit(XStorePropertyMapping propertyMapping) org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity oneMultiplicity = this.context.pureModel.getMultiplicity("one"); org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression thisVariable = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression"))._name("this"); - thisVariable._genericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(thisClass)); + thisVariable._genericType(context.newGenericType(thisClass)); thisVariable._multiplicity(oneMultiplicity); org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression thatVariable = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::valuespecification::VariableExpression"))._name("that"); - thatVariable._genericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(thatClass)); + thatVariable._genericType(context.newGenericType(thatClass)); thatVariable._multiplicity(oneMultiplicity); MutableList pureParameters = FastList.newListWith(thisVariable, thatVariable); @@ -176,7 +177,7 @@ public PropertyMapping visit(XStorePropertyMapping propertyMapping) } LambdaFunction lambda = new Root_meta_pure_metamodel_function_LambdaFunction_Impl(parent._id() + "." + propertyMapping.property.property, new SourceInformation(mappingPath, 0, 0, 0, 0), null) - ._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(this.context.pureModel.getType("meta::pure::metamodel::function::LambdaFunction"))._typeArguments(FastList.newListWith(functionType))) + ._classifierGenericType(context.newGenericType(this.context.pureModel.getType(M3Paths.LambdaFunction), FastList.newListWith(functionType))) ._openVariables(cleanedOpenVariables) ._expressionSequence(valueSpecifications); diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java index 9464d8547bc..a31c23f9cbe 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/PureModel.java @@ -1181,7 +1181,7 @@ public GenericType getGenericType(String fullPath, SourceInformation sourceInfor public GenericType getGenericType(Type type) { - return this.typesGenericTypeIndex.getIfAbsentPut(buildTypeId(type), () -> new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(type)); + return this.typesGenericTypeIndex.getIfAbsentPut(buildTypeId(type), () -> CompileContext.newGenericType(type, this)); } public String buildTypeId(Type type) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationTypeHelper.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationTypeHelper.java index e98fdb65e18..dd991e38224 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationTypeHelper.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/RelationTypeHelper.java @@ -15,8 +15,8 @@ package org.finos.legend.engine.language.pure.compiler.toPureGraph; import org.eclipse.collections.impl.utility.ListIterate; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.Column; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.Column; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType; import org.finos.legend.pure.m3.navigation.ProcessorSupport; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java index bcef782fe83..aefc00d3eb2 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilder.java @@ -28,33 +28,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.AggregateValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.ExecutionContextInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.Pair; @@ -161,7 +161,6 @@ public ValueSpecification visit(PackageableElementPtr packageableElementPtr) // for backward compatibility, since some protocol versions use PackageableElementPtr for units return visit(new UnitType(packageableElementPtr.fullPath, packageableElementPtr.sourceInformation)); } - org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement packageableElement = this.context.resolvePackageableElement(packageableElementPtr.fullPath, packageableElementPtr.sourceInformation); return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", SourceInformationHelper.toM3SourceInformation(packageableElementPtr.sourceInformation), this.context.pureModel.getClass(M3Paths.InstanceValue)) ._genericType(packageableElement._classifierGenericType()) @@ -705,19 +704,11 @@ public ValueSpecification processClassInstance(PureList pureList) public ValueSpecification visit(Variable variable) { openVariables.add(variable.name); - if ((variable._class != null || variable.relationType != null) && variable.multiplicity != null) + if (variable.genericType != null && variable.multiplicity != null) { VariableExpression ve = new Root_meta_pure_metamodel_valuespecification_VariableExpression_Impl("", SourceInformationHelper.toM3SourceInformation(variable.sourceInformation), this.context.pureModel.getClass(M3Paths.VariableExpression)) ._name(variable.name); - GenericType genericType = - // Bad Hack to compensate the fact that 'generics' are not supported in the type system ... - variable.relationType != null && variable._class != null ? - new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType)) - ._rawType(context.pureModel.getClass(variable._class.path)) - ._typeArguments(Lists.immutable.with(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType))._rawType(RelationTypeHelper.convert(variable.relationType, this.context.pureModel.getExecutionSupport().getProcessorSupport(), null)))) : - variable.relationType != null ? - new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType))._rawType(RelationTypeHelper.convert(variable.relationType, this.context.pureModel.getExecutionSupport().getProcessorSupport(), null)) : - this.context.resolveGenericType(this.context.pureModel.addPrefixToTypeReference(variable._class.path), variable.sourceInformation); + GenericType genericType = context.newGenericType(variable.genericType); ve._genericType(genericType); ve._multiplicity(this.context.pureModel.getMultiplicity(variable.multiplicity)); processingContext.addInferredVariables(variable.name, ve); @@ -755,13 +746,8 @@ public ValueSpecification visit(MappingInstance mappingInstance) @Override public ValueSpecification visit(GenericTypeInstance genericTypeInstance) { - // Support casting to a relation - if (genericTypeInstance.typeArguments != null && !genericTypeInstance.typeArguments.isEmpty() && genericTypeInstance.typeArguments.get(0) instanceof ClassInstance && ((ClassInstance) genericTypeInstance.typeArguments.get(0)).type.equals("colSpecArray")) - { - return proccessColSpecArray((ColSpecArray) ((ClassInstance) genericTypeInstance.typeArguments.get(0)).value); - } return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", null, this.context.pureModel.getClass(M3Paths.InstanceValue)) - ._genericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType))._rawType(this.context.resolveType(genericTypeInstance.fullPath, genericTypeInstance.sourceInformation))) + ._genericType(context.newGenericType(genericTypeInstance.genericType)) ._multiplicity(this.context.pureModel.getMultiplicity("one")); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java index d42441339e3..6e158092d98 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/ValueSpecificationBuilderForFuncExpr.java @@ -19,6 +19,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.pure.generated.Root_meta_core_runtime_Runtime; import org.finos.legend.pure.generated.Root_meta_pure_metamodel_type_generics_GenericType_Impl; @@ -44,7 +45,7 @@ public ValueSpecificationBuilderForFuncExpr(CompileContext context, MutableList< } @Override - public ValueSpecification visit(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr packageableElementPtr) + public ValueSpecification visit(PackageableElementPtr packageableElementPtr) { if (packageableElementPtr.fullPath.contains("~")) { @@ -57,7 +58,8 @@ public ValueSpecification visit(org.finos.legend.engine.protocol.pure.v1.model.v if (packageableElement instanceof Root_meta_pure_runtime_PackageableRuntime) { Root_meta_core_runtime_Runtime resolvedRuntime = this.context.resolveRuntime(packageableElementPtr.fullPath); - GenericType runtimeGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType))._rawType(this.context.pureModel.getType("meta::core::runtime::Runtime")); + GenericType runtimeGenericType = new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.context.pureModel.getClass(M3Paths.GenericType)) + ._rawType(this.context.pureModel.getType("meta::core::runtime::Runtime")); return new Root_meta_pure_metamodel_valuespecification_InstanceValue_Impl("", SourceInformationHelper.toM3SourceInformation(packageableElementPtr.sourceInformation), this.context.pureModel.getClass(M3Paths.InstanceValue)) ._genericType(runtimeGenericType) ._multiplicity(this.context.pureModel.getMultiplicity("one")) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/data/core/EmbeddedDataCompilerHelper.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/data/core/EmbeddedDataCompilerHelper.java index ab1e0cf303a..a5540cb5203 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/data/core/EmbeddedDataCompilerHelper.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/data/core/EmbeddedDataCompilerHelper.java @@ -26,7 +26,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementType; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; import org.finos.legend.engine.protocol.pure.v1.model.data.*; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.pure.generated.*; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java index e71d0b2684a..362156381c5 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/Handlers.java @@ -33,8 +33,7 @@ import org.finos.legend.engine.language.pure.compiler.toPureGraph.handlers.inference.*; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; -import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; -import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; @@ -117,7 +116,6 @@ private static void updateTwoParamsLambdaDiffTypes(Object lambda, GenericType ne } } - private static void updateSimpleLambda(Object lambda, GenericType newGenericType, org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity m, CompileContext cc) { if (lambda instanceof Lambda) @@ -126,14 +124,10 @@ private static void updateSimpleLambda(Object lambda, GenericType newGenericType if (params.size() > 1) { Variable p = params.get(0); - GenericType gt = cc.pureModel.getGenericType(M3Paths.Relation); - updateVariableType(p, gt); - // Hack to compensate the fact that 'generics' are not supported in the type system ... we would like the relation (newGenericType) to be a typeArgument of Relation (i.e. Relation<(id:Integer)> - // we pack the 'relation' in the variable 'relationType' extra slot... - updateVariableType(p, newGenericType); + updateVariableType(p, cc.newGenericType(cc.pureModel.getType(M3Paths.Relation), Lists.fixedSize.of(newGenericType))); p.multiplicity = new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity(1, 1); Variable f = params.get(1); - updateVariableType(f, cc.pureModel.getGenericType("meta::pure::functions::relation::_Window")); + updateVariableType(f, cc.newGenericType(cc.pureModel.getType("meta::pure::functions::relation::_Window"), Lists.mutable.with(cc.pureModel.getGenericType(cc.pureModel.getType("meta::pure::metamodel::type::Any"))))); f.multiplicity = new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity(1, 1); } Variable variable = params.get(params.size() - 1); @@ -144,14 +138,7 @@ private static void updateSimpleLambda(Object lambda, GenericType newGenericType private static void updateVariableType(Variable variable, GenericType newGenericType) { - if (newGenericType._rawType() instanceof RelationType) - { - variable.relationType = RelationTypeHelper.convert((RelationType) newGenericType._rawType()); - } - else - { - variable._class = new PackageableElementPointer(PackageableElementType.CLASS, PackageableElement.getUserPathForPackageableElement(newGenericType._rawType())); - } + variable.genericType = CompileContext.convertGenericType(newGenericType); } @@ -171,10 +158,10 @@ private static void updateLambdaWithCol(GenericType gt2, org.finos.legend.engine private static void updateTDSRowLambda(List vars) { Variable variable = vars.get(0); - variable._class = new PackageableElementPointer(PackageableElementType.CLASS, "meta::pure::tds::TDSRow"); + variable.genericType = new org.finos.legend.engine.protocol.pure.v1.model.type.GenericType(new PackageableType("meta::pure::tds::TDSRow")); variable.multiplicity = new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity(1, 1); Variable variable2 = vars.get(1); - variable2._class = new PackageableElementPointer(PackageableElementType.CLASS, "meta::pure::tds::TDSRow"); + variable2.genericType = new org.finos.legend.engine.protocol.pure.v1.model.type.GenericType(new PackageableType("meta::pure::tds::TDSRow")); variable2.multiplicity = new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity(1, 1); } @@ -966,20 +953,13 @@ public Handlers(PureModel pureModel) ); // Inference in the context of the parent - register(m(m(h("meta::pure::tds::agg_String_1__FunctionDefinition_1__FunctionDefinition_1__AggregateValue_1_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::tds::AggregateValue")) - ._typeArguments(Lists.fixedSize.of(funcReturnType(ps.get(1)), funcReturnType(ps.get(2)))), - "one"), ps -> Lists.fixedSize.of(funcReturnType(ps.get(1)), funcReturnType(ps.get(2))), ps -> ps.size() == 3 && typeOne(ps.get(0), "String"))), + register(m(m(h("meta::pure::tds::agg_String_1__FunctionDefinition_1__FunctionDefinition_1__AggregateValue_1_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::tds::AggregateValue"), Lists.fixedSize.of(funcReturnType(ps.get(1)), funcReturnType(ps.get(2))), this.pureModel), "one"), ps -> Lists.fixedSize.of(funcReturnType(ps.get(1)), funcReturnType(ps.get(2))), ps -> ps.size() == 3 && typeOne(ps.get(0), "String"))), m(h("meta::pure::functions::collection::agg_FunctionDefinition_1__FunctionDefinition_1__AggregateValue_1_", false, ps -> res("meta::pure::functions::collection::AggregateValue", "one"), ps -> true)))); - register(m(m(h("meta::pure::tds::col_Function_1__String_1__String_1__BasicColumnSpecification_1_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::tds::BasicColumnSpecification")) - ._typeArguments(Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType())), + register(m(m(h("meta::pure::tds::col_Function_1__String_1__String_1__BasicColumnSpecification_1_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::tds::BasicColumnSpecification"), Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType()), pureModel), "one"), ps -> Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType()), ps -> ps.size() == 3)), - m(h("meta::pure::tds::col_Function_1__String_1__BasicColumnSpecification_1_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::tds::BasicColumnSpecification")) - ._typeArguments(Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType())), + m(h("meta::pure::tds::col_Function_1__String_1__BasicColumnSpecification_1_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::tds::BasicColumnSpecification"), Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType()), pureModel), "one"), ps -> Lists.fixedSize.of(funcType(ps.get(0)._genericType())._parameters().getOnly()._genericType()), ps -> true)))); // ---------------------------- @@ -1046,9 +1026,7 @@ public Handlers(PureModel pureModel) ) ); - register("meta::pure::functions::collection::pair_U_1__V_1__Pair_1_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::functions::collection::Pair")) - ._typeArguments(Lists.fixedSize.ofAll(ps.stream().map(ValueSpecificationAccessor::_genericType).collect(Collectors.toList()))), "one")); + register("meta::pure::functions::collection::pair_U_1__V_1__Pair_1_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::functions::collection::Pair"), Lists.fixedSize.ofAll(ps.stream().map(ValueSpecificationAccessor::_genericType).collect(Collectors.toList())), this.pureModel), "one")); register(h("meta::pure::functions::multiplicity::toOne_T_MANY__T_1_", true, ps -> res(ps.get(0)._genericType(), "one"), ps -> Lists.mutable.with(ps.get(0)._genericType()), ps -> true)); @@ -1185,13 +1163,13 @@ public Handlers(PureModel pureModel) ); register("meta::pure::executionPlan::featureFlag::withFeatureFlags_T_MANY__Enum_MANY__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany")); register(m( - m(h("meta::pure::graphFetch::execution::graphFetchChecked_T_MANY__RootGraphFetchTree_1__Checked_MANY_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(this.pureModel.getType("meta::pure::dataQuality::Checked"))._typeArgumentsAdd(ps.get(0)._genericType()), "zeroMany"), ps -> Lists.mutable.with(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> ps.size() == 2)), - m(h("meta::pure::graphFetch::execution::graphFetchChecked_T_MANY__RootGraphFetchTree_1__Integer_1__Checked_MANY_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(this.pureModel.getType("meta::pure::dataQuality::Checked"))._typeArgumentsAdd(ps.get(0)._genericType()), "zeroMany"), ps -> Lists.mutable.with(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> ps.size() == 3)) + m(h("meta::pure::graphFetch::execution::graphFetchChecked_T_MANY__RootGraphFetchTree_1__Checked_MANY_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::dataQuality::Checked"), ps.get(0)._genericType(), this.pureModel), "zeroMany"), ps -> Lists.mutable.with(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> ps.size() == 2)), + m(h("meta::pure::graphFetch::execution::graphFetchChecked_T_MANY__RootGraphFetchTree_1__Integer_1__Checked_MANY_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::dataQuality::Checked"), ps.get(0)._genericType(), pureModel), "zeroMany"), ps -> Lists.mutable.with(ps.get(0)._genericType()._typeArguments().getFirst()), ps -> ps.size() == 3)) ) ); register("meta::pure::graphFetch::execution::graphFetchUnexpanded_T_MANY__RootGraphFetchTree_1__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany")); - register("meta::pure::graphFetch::execution::graphFetchCheckedUnexpanded_T_MANY__RootGraphFetchTree_1__Checked_MANY_", false, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(this.pureModel.getType("meta::pure::dataQuality::Checked"))._typeArgumentsAdd(ps.get(0)._genericType()), "zeroMany")); + register("meta::pure::graphFetch::execution::graphFetchCheckedUnexpanded_T_MANY__RootGraphFetchTree_1__Checked_MANY_", false, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::dataQuality::Checked"), ps.get(0)._genericType(), pureModel), "zeroMany")); register(m( m(h("meta::pure::graphFetch::execution::serialize_Checked_MANY__RootGraphFetchTree_1__String_1_", false, ps -> res("String", "one"), ps -> ps.size() == 2 && "Checked".equals(ps.get(0)._genericType()._rawType()._name()))), m(h("meta::pure::graphFetch::execution::serialize_T_MANY__RootGraphFetchTree_1__String_1_", false, ps -> res("String", "one"), ps -> ps.size() == 2)), @@ -1211,9 +1189,7 @@ public Handlers(PureModel pureModel) register(m(m(h("meta::pure::functions::collection::dropAt_T_MANY__Integer_1__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany"), ps -> ps.size() == 2)), m(h("meta::pure::functions::collection::dropAt_T_MANY__Integer_1__Integer_1__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany"), ps -> ps.size() == 3)))); - register("meta::pure::functions::collection::zip_T_MANY__U_MANY__Pair_MANY_", true, ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::functions::collection::Pair")) - ._typeArguments(Lists.fixedSize.ofAll(ps.stream().map(ValueSpecificationAccessor::_genericType).collect(Collectors.toList()))), "oneMany")); + register("meta::pure::functions::collection::zip_T_MANY__U_MANY__Pair_MANY_", true, ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::functions::collection::Pair"), Lists.fixedSize.ofAll(ps.stream().map(ValueSpecificationAccessor::_genericType).collect(Collectors.toList())), pureModel), "oneMany")); register(m(grp(LambdaInference, h("meta::pure::functions::collection::removeDuplicatesBy_T_MANY__Function_1__T_MANY_", false, ps -> res(ps.get(0)._genericType(), "zeroMany"), p -> true)))); register("meta::pure::functions::collection::containsAll_Any_MANY__Any_MANY__Boolean_1_", false, ps -> res("Boolean", "one")); @@ -1812,12 +1788,7 @@ private void registerAlgebra() private void registerOlapMath() { - ReturnInference resolve = ps -> res(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, this.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType")) - ._rawType(this.pureModel.getType("meta::pure::functions::collection::Map")) - ._typeArguments(FastList.newListWith( - this.pureModel.getGenericType("meta::pure::metamodel::type::Any"), - this.pureModel.getGenericType("Integer") - )), "one"); + ReturnInference resolve = ps -> res(CompileContext.newGenericType(this.pureModel.getType("meta::pure::functions::collection::Map"), FastList.newListWith(this.pureModel.getGenericType("meta::pure::metamodel::type::Any"), this.pureModel.getGenericType("Integer")), pureModel), "one"); register(m( m(h("meta::pure::functions::math::olap::rank_Any_MANY__Map_1_", false, resolve)), diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java index 79a409f209a..56b89b150b9 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/builder/FunctionExpressionBuilder.java @@ -24,11 +24,11 @@ import org.finos.legend.engine.language.pure.compiler.toPureGraph.handlers.FunctionHandler; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpression; import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/inference/MostCommonType.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/inference/MostCommonType.java index 5ab85398da0..5e7df44909c 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/inference/MostCommonType.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/handlers/inference/MostCommonType.java @@ -22,38 +22,6 @@ public class MostCommonType { public static GenericType mostCommon(MutableList sourceTypes, PureModel pureModel) { - // Need generics return (GenericType) org.finos.legend.pure.m3.navigation.generictype.GenericType.findBestCommonGenericType(sourceTypes.collect(s -> s), true, false, pureModel.getExecutionSupport().getProcessorSupport()); -// Type nil = pureModel.getType(M3Paths.Nil); -// MutableList types = sourceTypes.select(t->!t.equals(nil)); -// if (types.isEmpty()) -// { -// return pureModel.getGenericType(M3Paths.Nil); -// } -// else -// { -// Type res = types.size() == 1? types.get(0):types.take(types.size()-1).injectInto(types.get(types.size()-1), (a,b) -> mostCommon(a,b, pureModel)); -// return new Root_meta_pure_metamodel_type_generics_GenericType_Impl("", null, context.pureModel.getClass("meta::pure::metamodel::type::generics::GenericType"))._rawType(res); -// } } - - -// public static Type mostCommon(Type a, Type b, PureModel pureModel) -// { -// if (a == b) -// { -// return a; -// } -// ListIterable la = C3Linearization.getTypeGeneralizationLinearization(a, pureModel.getExecutionSupport().getProcessorSupport()).toReversed(); -// ListIterable lb = C3Linearization.getTypeGeneralizationLinearization(b, pureModel.getExecutionSupport().getProcessorSupport()).toReversed(); -// int min = Math.min(la.size(), lb.size()); -// for (int i=0; i < min; i++) -// { -// if (la.get(i) != lb.get(i)) -// { -// return (Type)la.get(i-1); -// } -// } -// return (Type)la.get(min-1); -// } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/test/ModelStoreTestConnectionFactory.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/test/ModelStoreTestConnectionFactory.java index 8449f408ef6..86dd6c4442a 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/test/ModelStoreTestConnectionFactory.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/main/java/org/finos/legend/engine/language/pure/compiler/toPureGraph/test/ModelStoreTestConnectionFactory.java @@ -26,7 +26,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.connection.JsonModelConnection; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.modelToModel.connection.XmlModelConnection; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.shared.core.url.InputStreamProvider; import org.finos.legend.engine.shared.core.url.StreamProviderHolder; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java index 561fd2d2bfc..ac9764b3304 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestCompilationFromGrammar.java @@ -1062,7 +1062,7 @@ public void testRelation() " city : x|$x.city,\n" + " treePlanted: x|$x.treePlanted,\n" + " year: x|$x.year\n" + - " ])->pivot(~[country, city], ~[total: x|$x.treePlanted : x|$x->sum()])->cast(@Relation<(year2:Integer)>)->filter(x|$x.year2 == 2000)\n" + + " ])->pivot(~[country, city], ~[total: x|$x.treePlanted : x|$x->sum()])->cast(@meta::pure::metamodel::relation::Relation<(year2:Integer)>)->filter(x|$x.year2 == 2000)\n" + "}" ); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/fromGrammar/TestDomainCompilationFromGrammar.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/fromGrammar/TestDomainCompilationFromGrammar.java index 10d89844894..fb3176beec5 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/fromGrammar/TestDomainCompilationFromGrammar.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-compiler/src/test/java/org/finos/legend/engine/language/pure/compiler/test/fromGrammar/TestDomainCompilationFromGrammar.java @@ -724,7 +724,7 @@ public void testQualifiedProperty() "{\n" + " name : String[*];\n" + " xza(s:z::k::B[1]){$s + 'ok'}:String[1];\n" + - "}\n", "COMPILATION error at [4:8-19]: Can't find type 'z::k::B'"); + "}\n", "COMPILATION error at [4:10-16]: Can't find type 'z::k::B'"); } @Test diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar-http-api/src/test/java/org/finos/legend/engine/language/pure/grammar/api/test/TestGrammarToJsonApi.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar-http-api/src/test/java/org/finos/legend/engine/language/pure/grammar/api/test/TestGrammarToJsonApi.java index fcce3fc4a39..3846046dc5f 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar-http-api/src/test/java/org/finos/legend/engine/language/pure/grammar/api/test/TestGrammarToJsonApi.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar-http-api/src/test/java/org/finos/legend/engine/language/pure/grammar/api/test/TestGrammarToJsonApi.java @@ -34,13 +34,13 @@ public class TestGrammarToJsonApi @Test public void testProtocolGeneration() { - test(getJsonString("pureParsingTest.json"), "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"string\",\"sourceInformation\":{\"endColumn\":21,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1},\"value\":\"test\"}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Person\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":2,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}},\"test2\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"string\",\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test2\",\"startColumn\":16,\"startLine\":1},\"value\":\"test2\"}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Person\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test2\",\"startColumn\":2,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":23,\"endLine\":1,\"sourceId\":\"test2\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test(getJsonString("pureParsingTest.json"), "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"string\",\"sourceInformation\":{\"endColumn\":21,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1},\"value\":\"test\"}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Person\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":6,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":2,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}},\"test2\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"string\",\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test2\",\"startColumn\":16,\"startLine\":1},\"value\":\"test2\"}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Person\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test2\",\"startColumn\":6,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test2\",\"startColumn\":2,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":23,\"endLine\":1,\"sourceId\":\"test2\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); } @Test public void testImportParsing() { - test(getJsonString("pureImportParsingTest.json"), "{\"isolatedLambdas\":{\"lambdas\":{}},\"modelDataContext\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"Person\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"targetA\",\"propertyTypeSourceInformation\":{\"endColumn\":18,\"endLine\":4,\"sourceId\":\"\",\"startColumn\":12,\"startLine\":4},\"sourceInformation\":{\"endColumn\":22,\"endLine\":4,\"sourceId\":\"\",\"startColumn\":3,\"startLine\":4},\"stereotypes\":[],\"taggedValues\":[],\"type\":\"TargetA\"}],\"qualifiedProperties\":[],\"sourceInformation\":{\"endColumn\":1,\"endLine\":5,\"sourceId\":\"\",\"startColumn\":1,\"startLine\":2},\"stereotypes\":[],\"superTypes\":[\"VersionClass\"],\"taggedValues\":[{\"sourceInformation\":{\"endColumn\":20,\"endLine\":2,\"sourceId\":\"\",\"startColumn\":8,\"startLine\":2},\"tag\":{\"profile\":\"doc\",\"profileSourceInformation\":{\"endColumn\":10,\"endLine\":2,\"sourceId\":\"\",\"startColumn\":8,\"startLine\":2},\"sourceInformation\":{\"endColumn\":14,\"endLine\":2,\"sourceId\":\"\",\"startColumn\":12,\"startLine\":2},\"value\":\"doc\"},\"value\":\"a\"}]},{\"_type\":\"sectionIndex\",\"name\":\"SectionIndex\",\"package\":\"__internal__\",\"sections\":[{\"_type\":\"importAware\",\"elements\":[\"model::Person\"],\"imports\":[\"projectA\"],\"parserName\":\"Pure\",\"sourceInformation\":{\"endColumn\":2,\"endLine\":7,\"sourceId\":\"\",\"startColumn\":1,\"startLine\":1}}]}]},\"renderStyle\":\"STANDARD\"}"); + test(getJsonString("pureImportParsingTest.json"), "{\"isolatedLambdas\":{\"lambdas\":{}},\"modelDataContext\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"Person\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"TargetA\",\"sourceInformation\":{\"endColumn\":18,\"endLine\":4,\"sourceId\":\"\",\"startColumn\":12,\"startLine\":4}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"targetA\",\"sourceInformation\":{\"endColumn\":22,\"endLine\":4,\"sourceId\":\"\",\"startColumn\":3,\"startLine\":4},\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"sourceInformation\":{\"endColumn\":1,\"endLine\":5,\"sourceId\":\"\",\"startColumn\":1,\"startLine\":2},\"stereotypes\":[],\"superTypes\":[\"VersionClass\"],\"taggedValues\":[{\"sourceInformation\":{\"endColumn\":20,\"endLine\":2,\"sourceId\":\"\",\"startColumn\":8,\"startLine\":2},\"tag\":{\"profile\":\"doc\",\"profileSourceInformation\":{\"endColumn\":10,\"endLine\":2,\"sourceId\":\"\",\"startColumn\":8,\"startLine\":2},\"sourceInformation\":{\"endColumn\":14,\"endLine\":2,\"sourceId\":\"\",\"startColumn\":12,\"startLine\":2},\"value\":\"doc\"},\"value\":\"a\"}]},{\"_type\":\"sectionIndex\",\"name\":\"SectionIndex\",\"package\":\"__internal__\",\"sections\":[{\"_type\":\"importAware\",\"elements\":[\"model::Person\"],\"imports\":[\"projectA\"],\"parserName\":\"Pure\",\"sourceInformation\":{\"endColumn\":2,\"endLine\":7,\"sourceId\":\"\",\"startColumn\":1,\"startLine\":1}}]}]},\"renderStyle\":\"STANDARD\"}"); } @Test @@ -52,18 +52,18 @@ public void testParsingWithNoError() @Test public void testLambdaParsingWithNoError() { - test("{\"isolatedLambdas\": {\"test\": \"a:String[1]|'hello';\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"string\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":13,\"startLine\":1},\"value\":\"hello\"}],\"parameters\":[{\"_type\":\"var\",\"class\":\"String\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"a\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":20,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":12,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:String[1]|$src; \"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":18,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"String\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":13,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":14,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1]|$src+1; \"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"plus\",\"parameters\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":2,\"upperBound\":2},\"sourceInformation\":{\"endColumn\":21,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":20,\"startLine\":1},\"values\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}},{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":21,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":21,\"startLine\":1},\"value\":1}]}],\"sourceInformation\":{\"endColumn\":21,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":20,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Integer\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Integer[2]|$src->first()->toOne() \"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"toOne\",\"parameters\":[{\"_type\":\"func\",\"function\":\"first\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":26,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":22,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":35,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":31,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Integer\",\"multiplicity\":{\"lowerBound\":2,\"upperBound\":2},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":37,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Person[1] |$src.nameWithTitle('test');\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}},{\"_type\":\"string\",\"sourceInformation\":{\"endColumn\":40,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":35,\"startLine\":1},\"value\":\"test\"}],\"property\":\"nameWithTitle\",\"sourceInformation\":{\"endColumn\":33,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":21,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Person\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":13,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":42,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Person[1] |$src.name;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}],\"property\":\"name\",\"sourceInformation\":{\"endColumn\":24,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":21,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Person\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":13,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":25,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Boolean[1] | !$src;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"not\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":19,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Boolean\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":23,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1] | -$src;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"minus\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":19,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":18,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Integer\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":23,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1] | add($src,minus([1,1]));\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"add\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":25,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":22,\"startLine\":1}},{\"_type\":\"func\",\"function\":\"minus\",\"parameters\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":2,\"upperBound\":2},\"sourceInformation\":{\"endColumn\":37,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":33,\"startLine\":1},\"values\":[{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":34,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":34,\"startLine\":1},\"value\":1},{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":36,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":36,\"startLine\":1},\"value\":1}]}],\"sourceInformation\":{\"endColumn\":31,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":27,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":20,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Integer\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":40,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1]|let a = 1;$a+1;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"letFunction\",\"parameters\":[{\"_type\":\"string\",\"value\":\"a\"},{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":24,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1},\"value\":1}],\"sourceInformation\":{\"endColumn\":24,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}},{\"_type\":\"func\",\"function\":\"plus\",\"parameters\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":2,\"upperBound\":2},\"sourceInformation\":{\"endColumn\":29,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":28,\"startLine\":1},\"values\":[{\"_type\":\"var\",\"name\":\"a\",\"sourceInformation\":{\"endColumn\":27,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":26,\"startLine\":1}},{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":29,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":29,\"startLine\":1},\"value\":1}]}],\"sourceInformation\":{\"endColumn\":29,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":28,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Integer\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":30,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1] | myEnum.VALUE1;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"packageableElementPtr\",\"fullPath\":\"myEnum\",\"sourceInformation\":{\"endColumn\":23,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"property\":\"VALUE1\",\"sourceInformation\":{\"endColumn\":30,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":25,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Integer\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":31,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); - test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1] | anything;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"packageableElementPtr\",\"fullPath\":\"anything\",\"sourceInformation\":{\"endColumn\":25,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"Integer\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":26,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"a:String[1]|'hello';\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"string\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":13,\"startLine\":1},\"value\":\"hello\"}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\",\"sourceInformation\":{\"endColumn\":8,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":3,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"a\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":20,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":12,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:String[1]|$src; \"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":18,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\",\"sourceInformation\":{\"endColumn\":10,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":13,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":14,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1]|$src+1; \"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"plus\",\"parameters\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":2,\"upperBound\":2},\"sourceInformation\":{\"endColumn\":21,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":20,\"startLine\":1},\"values\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}},{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":21,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":21,\"startLine\":1},\"value\":1}]}],\"sourceInformation\":{\"endColumn\":21,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":20,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Integer[2]|$src->first()->toOne() \"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"toOne\",\"parameters\":[{\"_type\":\"func\",\"function\":\"first\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":26,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":22,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":35,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":31,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":2,\"upperBound\":2},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":37,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Person[1] |$src.nameWithTitle('test');\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}},{\"_type\":\"string\",\"sourceInformation\":{\"endColumn\":40,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":35,\"startLine\":1},\"value\":\"test\"}],\"property\":\"nameWithTitle\",\"sourceInformation\":{\"endColumn\":33,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":21,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Person\",\"sourceInformation\":{\"endColumn\":10,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":13,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":42,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Person[1] |$src.name;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":19,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}],\"property\":\"name\",\"sourceInformation\":{\"endColumn\":24,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":21,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Person\",\"sourceInformation\":{\"endColumn\":10,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":13,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":25,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Boolean[1] | !$src;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"not\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":19,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":23,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1] | -$src;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"minus\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":22,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":19,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":18,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":23,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1] | add($src,minus([1,1]));\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"add\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":25,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":22,\"startLine\":1}},{\"_type\":\"func\",\"function\":\"minus\",\"parameters\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":2,\"upperBound\":2},\"sourceInformation\":{\"endColumn\":37,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":33,\"startLine\":1},\"values\":[{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":34,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":34,\"startLine\":1},\"value\":1},{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":36,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":36,\"startLine\":1},\"value\":1}]}],\"sourceInformation\":{\"endColumn\":31,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":27,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":20,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":40,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1]|let a = 1;$a+1;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"letFunction\",\"parameters\":[{\"_type\":\"string\",\"value\":\"a\"},{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":24,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1},\"value\":1}],\"sourceInformation\":{\"endColumn\":24,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}},{\"_type\":\"func\",\"function\":\"plus\",\"parameters\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":2,\"upperBound\":2},\"sourceInformation\":{\"endColumn\":29,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":28,\"startLine\":1},\"values\":[{\"_type\":\"var\",\"name\":\"a\",\"sourceInformation\":{\"endColumn\":27,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":26,\"startLine\":1}},{\"_type\":\"integer\",\"sourceInformation\":{\"endColumn\":29,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":29,\"startLine\":1},\"value\":1}]}],\"sourceInformation\":{\"endColumn\":29,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":28,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":30,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":15,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1] | myEnum.VALUE1;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"packageableElementPtr\",\"fullPath\":\"myEnum\",\"sourceInformation\":{\"endColumn\":23,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"property\":\"VALUE1\",\"sourceInformation\":{\"endColumn\":30,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":25,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":31,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + test("{\"isolatedLambdas\": {\"test\": \"src:Integer[1] | anything;\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"packageableElementPtr\",\"fullPath\":\"anything\",\"sourceInformation\":{\"endColumn\":25,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":18,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\",\"sourceInformation\":{\"endColumn\":11,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":26,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); // a really meaningless lambda test("{\"isolatedLambdas\": {\"test\": \"anything\"}}", "{\"isolatedLambdas\":{\"lambdas\":{\"test\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"packageableElementPtr\",\"fullPath\":\"anything\",\"sourceInformation\":{\"endColumn\":8,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}],\"parameters\":[],\"sourceInformation\":{\"endColumn\":8,\"endLine\":1,\"sourceId\":\"test\",\"startColumn\":1,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); } @@ -138,7 +138,7 @@ private String getJsonString(String path) public void testLambdaWithCast() { test("{\"isolatedLambdas\":{\"testLambda\":\"src:OldClass[1]|$src->cast(@newClass)\"}}", - "{\"isolatedLambdas\":{\"lambdas\":{\"testLambda\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"cast\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":20,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":17,\"startLine\":1}},{\"_type\":\"genericTypeInstance\",\"fullPath\":\"newClass\",\"sourceInformation\":{\"endColumn\":36,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":29,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":26,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":23,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"class\":\"OldClass\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":15,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":37,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); + "{\"isolatedLambdas\":{\"lambdas\":{\"testLambda\":{\"_type\":\"lambda\",\"body\":[{\"_type\":\"func\",\"function\":\"cast\",\"parameters\":[{\"_type\":\"var\",\"name\":\"src\",\"sourceInformation\":{\"endColumn\":20,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":17,\"startLine\":1}},{\"_type\":\"genericTypeInstance\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"newClass\",\"sourceInformation\":{\"endColumn\":36,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":29,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"sourceInformation\":{\"endColumn\":36,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":28,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":26,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":23,\"startLine\":1}}],\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"OldClass\",\"sourceInformation\":{\"endColumn\":12,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":5,\"startLine\":1}},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"src\",\"sourceInformation\":{\"endColumn\":15,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":1,\"startLine\":1}}],\"sourceInformation\":{\"endColumn\":37,\"endLine\":1,\"sourceId\":\"testLambda\",\"startColumn\":16,\"startLine\":1}}}},\"renderStyle\":\"STANDARD\"}"); } private void test(String request, String expected) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 index 74735dd367e..6fd30ed965b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/antlr4/org/finos/legend/engine/language/pure/grammar/from/antlr4/core/M3ParserGrammar.g4 @@ -211,14 +211,22 @@ type: (qualifiedName (LESS_THAN typeAr | ( PAREN_OPEN - columnType (COMMA columnType)* + columnInfo (COMMA columnInfo)* PAREN_CLOSE ) | unitName ; -columnType: identifier COLON identifier + +columnInfo: columnName COLON columnType +; + +columnName: identifier ; + +columnType: identifier +; + functionTypePureType: type multiplicity ; typeAndMultiplicityParameters: LESS_THAN ((typeParameters multiplictyParameters?) | multiplictyParameters) GREATER_THAN diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/PureGrammarParser.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/PureGrammarParser.java index c1142928244..01025cf72ab 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/PureGrammarParser.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/PureGrammarParser.java @@ -38,7 +38,6 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; import org.finos.legend.engine.shared.core.identity.Identity; -import org.finos.legend.engine.shared.core.identity.factory.*; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.engine.shared.core.operational.logs.LogInfo; import org.finos.legend.engine.shared.core.operational.logs.LoggingEventType; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/data/embedded/ModelStoreDataParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/data/embedded/ModelStoreDataParseTreeWalker.java index 03575109246..c5e775d0516 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/data/embedded/ModelStoreDataParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/data/embedded/ModelStoreDataParseTreeWalker.java @@ -29,15 +29,15 @@ import org.finos.legend.engine.protocol.pure.v1.model.data.ModelInstanceTestData; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import java.math.BigDecimal; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java index 98c1139e03f..dc3113a7fac 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DateParseTreeWalker.java @@ -17,9 +17,9 @@ import org.antlr.v4.runtime.tree.TerminalNode; import org.finos.legend.engine.language.pure.grammar.from.ParseTreeWalkerSourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; public class DateParseTreeWalker diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java index 0159ad1dcb3..7192207934a 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/DomainParseTreeWalker.java @@ -72,22 +72,27 @@ import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.EqualTo; import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.EqualToJson; import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.TestAssertion; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.type.Type; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.Column; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpec; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpecArray; @@ -290,7 +295,11 @@ private EnumValue visitEnumValue(DomainParserGrammar.EnumValueContext ctx) private Class visitClass(DomainParserGrammar.ClassDefinitionContext ctx) { - // TODO: break if use of generics! + if (ctx.typeParametersWithContravarianceAndMultiplicityParameters() != null && !ctx.typeParametersWithContravarianceAndMultiplicityParameters().isEmpty()) + { + throw new EngineException("Type and/or multiplicity parameters are not authorized in Legend Engine", walkerSourceInformation.getSourceInformation(ctx.typeParametersWithContravarianceAndMultiplicityParameters()), EngineErrorType.PARSER); + } + Class _class = new Class(); _class._package = ctx.qualifiedName().packagePath() == null ? "" : PureGrammarParserUtility.fromPath(ctx.qualifiedName().packagePath().identifier()); _class.name = PureGrammarParserUtility.fromIdentifier(ctx.qualifiedName().identifier()); @@ -352,11 +361,10 @@ private Property visitSimpleProperty(DomainParserGrammar.PropertyContext ctx) property.stereotypes = ctx.stereotypes() == null ? Lists.mutable.empty() : this.visitStereotypes(ctx.stereotypes()); property.taggedValues = ctx.taggedValues() == null ? Lists.mutable.empty() : this.visitTaggedValues(ctx.taggedValues()); // NOTE: here we limit the property type to only primitive type, class, or enumeration - property.type = ctx.propertyReturnType().type().getText(); + property.genericType = processGenericType(ctx.propertyReturnType().type()); property.multiplicity = this.buildMultiplicity(ctx.propertyReturnType().multiplicity().multiplicityArgument()); property.defaultValue = ctx.defaultValue() == null ? null : this.visitDefaultValue(ctx.defaultValue().defaultValueExpression()); property.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); - property.propertyTypeSourceInformation = this.walkerSourceInformation.getSourceInformation(ctx.propertyReturnType().type()); if (ctx.aggregation() != null) { if (ctx.aggregation().aggregationType().AGGREGATION_TYPE_COMPOSITE() != null) @@ -392,14 +400,13 @@ private QualifiedProperty visitDerivedProperty(DomainParserGrammar.QualifiedProp { Variable variable = new Variable(); variable.name = PureGrammarParserUtility.fromIdentifier(functionVariableExpressionContext.identifier()); - String path = functionVariableExpressionContext.type().getText(); - variable._class = new PackageableElementPointer(PackageableElementType.CLASS, path, walkerSourceInformation.getSourceInformation(functionVariableExpressionContext.type())); + variable.genericType = processGenericType(functionVariableExpressionContext.type()); variable.multiplicity = this.buildMultiplicity(functionVariableExpressionContext.multiplicity().multiplicityArgument()); variable.sourceInformation = walkerSourceInformation.getSourceInformation(functionVariableExpressionContext); return variable; }); // NOTE: we should check but here we let returned type of the derived property to be whatever - qualifiedProperty.returnType = ctx.propertyReturnType().type().getText(); + qualifiedProperty.returnGenericType = processGenericType(ctx.propertyReturnType().type()); qualifiedProperty.returnMultiplicity = this.buildMultiplicity(ctx.propertyReturnType().multiplicity().multiplicityArgument()); qualifiedProperty.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); return qualifiedProperty; @@ -426,6 +433,11 @@ private Association visitAssociation(DomainParserGrammar.AssociationContext ctx) private org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function visitFunction(DomainParserGrammar.FunctionDefinitionContext ctx) { + if (ctx.typeAndMultiplicityParameters() != null && !ctx.typeAndMultiplicityParameters().isEmpty()) + { + throw new EngineException("Type and/or multiplicity parameters are not authorized in Legend Engine", walkerSourceInformation.getSourceInformation(ctx.typeAndMultiplicityParameters()), EngineErrorType.PARSER); + } + org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function func = new org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function(); func._package = ctx.qualifiedName().packagePath() == null ? "" : PureGrammarParserUtility.fromPath(ctx.qualifiedName().packagePath().identifier()); func.stereotypes = ctx.stereotypes() == null ? Lists.mutable.empty() : this.visitStereotypes(ctx.stereotypes()); @@ -436,8 +448,7 @@ private org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain { Variable variable = new Variable(); variable.name = PureGrammarParserUtility.fromIdentifier(functionVariableExpressionContext.identifier()); - String path = functionVariableExpressionContext.type().getText(); - variable._class = new PackageableElementPointer(PackageableElementType.CLASS, path, this.walkerSourceInformation.getSourceInformation(functionVariableExpressionContext.type())); + variable.genericType = processGenericType(functionVariableExpressionContext.type()); variable.multiplicity = this.buildMultiplicity(functionVariableExpressionContext.multiplicity().multiplicityArgument()); variable.sourceInformation = this.walkerSourceInformation.getSourceInformation(functionVariableExpressionContext); return variable; @@ -494,7 +505,7 @@ private org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain } func.tests = suites; } - func.returnType = ctx.functionTypeSignature().type().getText(); + func.returnGenericType = processGenericType(ctx.functionTypeSignature().type()); func.returnMultiplicity = this.buildMultiplicity(ctx.functionTypeSignature().multiplicity().multiplicityArgument()); func.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); func.name = PureGrammarParserUtility.fromIdentifier(ctx.qualifiedName().identifier()) + HelperValueSpecificationGrammarComposer.getFunctionSignature(func); @@ -740,8 +751,8 @@ private List codeBlock(DomainParserGrammar.CodeBlockContext private ValueSpecification programLine(DomainParserGrammar.ProgramLineContext ctx, List typeParametersNames, LambdaContext lambdaContext, boolean addLines, String space) { return (ctx.combinedExpression() == null) ? - letExpression(ctx.letExpression(), typeParametersNames, lambdaContext, addLines, space) : - combinedExpression(ctx.combinedExpression(), "line", typeParametersNames, lambdaContext, space, true, addLines); + letExpression(ctx.letExpression(), typeParametersNames, lambdaContext, addLines, space) : + combinedExpression(ctx.combinedExpression(), "line", typeParametersNames, lambdaContext, space, true, addLines); } public ValueSpecification combinedExpression(DomainParserGrammar.CombinedExpressionContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) @@ -834,7 +845,7 @@ private CByteArray byteArray(DomainParserGrammar.ToBytesLiteralContext ctx) private ValueSpecification enumReference(DomainParserGrammar.EnumReferenceContext ctx, String exprName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean wrapFlag, boolean addLines) { - org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue result = new org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue(); + org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue result = new org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue(); result.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); result.fullPath = PureGrammarParserUtility.fromQualifiedName(ctx.qualifiedName().packagePath() == null ? Collections.emptyList() : ctx.qualifiedName().packagePath().identifier(), ctx.qualifiedName().identifier()); result.value = PureGrammarParserUtility.fromIdentifier(ctx.identifier()); @@ -891,11 +902,20 @@ private AppliedFunction letExpression(DomainParserGrammar.LetExpressionContext c private AppliedFunction newFunction(DomainParserGrammar.ExpressionInstanceContext ctx, List typeParametersNames, LambdaContext lambdaContext, boolean addLines, String space) { - PackageableElementPtr newClass = new PackageableElementPtr(); - newClass.fullPath = PureGrammarParserUtility.fromQualifiedName(ctx.qualifiedName().packagePath() == null ? Collections.emptyList() : ctx.qualifiedName().packagePath().identifier(), ctx.qualifiedName().identifier()); + GenericTypeInstance generic = new GenericTypeInstance( + new GenericType(new PackageableType("meta::pure::metamodel::type::Class"), + Lists.mutable.of( + new GenericType( + new PackageableType(PureGrammarParserUtility.fromQualifiedName(ctx.qualifiedName().packagePath() == null ? Collections.emptyList() : ctx.qualifiedName().packagePath().identifier(), ctx.qualifiedName().identifier())), + ListIterate.collect(ctx.typeArguments() == null ? Lists.mutable.empty() : ctx.typeArguments().type(), this::processGenericType), + ListIterate.collect(ctx.multiplicityArguments() == null ? Lists.mutable.empty() : ctx.multiplicityArguments().multiplicityArgument(), this::buildMultiplicity) + ) + ) + ) + ); List keyExpressions = processExpressionInstanceParserPropertyAssignments(ctx.expressionInstanceParserPropertyAssignment(), typeParametersNames, lambdaContext, addLines, space); Collection valueAssignments = new Collection(keyExpressions); - return this.createAppliedFunction(Lists.mutable.with(newClass, new CString(""), valueAssignments), "new"); + return this.createAppliedFunction(Lists.mutable.with(generic, new CString(""), valueAssignments), "new"); } // necessary for proper compilation of new function @@ -1261,11 +1281,10 @@ private ValueSpecification atomicExpression(DomainParserGrammar.AtomicExpression { return unitTypeReference(ctx.type()); } - if (ctx.type().typeArguments() != null && !ctx.type().typeArguments().type().get(0).columnType().isEmpty()) - { - return processRelationColumnTypes(ctx.type()); - } - return typeReference(ctx.type()); + GenericTypeInstance genericTypeInstance = new GenericTypeInstance(); + genericTypeInstance.genericType = processGenericType(ctx.type()); + genericTypeInstance.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); + return genericTypeInstance; } if (ctx.anyLambda() != null) { @@ -1447,8 +1466,7 @@ private Variable lambdaParam(DomainParserGrammar.LambdaParamContext ctx, DomainP if (ctx != null && ctx.lambdaParamType() != null) { variable.multiplicity = this.buildMultiplicity(ctx.lambdaParamType().multiplicity().multiplicityArgument()); - String path = ctx.lambdaParamType().type().getText(); - variable._class = new PackageableElementPointer(PackageableElementType.CLASS, path, walkerSourceInformation.getSourceInformation(ctx.lambdaParamType().type())); + variable.genericType = processGenericType(ctx.lambdaParamType().type()); variable.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); } variable.name = PureGrammarParserUtility.fromIdentifier(var); @@ -1519,7 +1537,7 @@ private GenericTypeInstance typeReference(DomainParserGrammar.TypeContext ctx) { String fullPath = ctx.getText(); GenericTypeInstance genericTypeInstance = new GenericTypeInstance(); - genericTypeInstance.fullPath = fullPath; + genericTypeInstance.genericType = new GenericType(new PackageableType(fullPath)); genericTypeInstance.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); return genericTypeInstance; } @@ -1528,33 +1546,45 @@ private GenericTypeInstance unitTypeReference(DomainParserGrammar.TypeContext ct { String fullPath = ctx.unitName().qualifiedName().getText().concat(TILDE).concat(ctx.unitName().identifier().getText()); GenericTypeInstance genericTypeInstance = new GenericTypeInstance(); - genericTypeInstance.fullPath = fullPath; + genericTypeInstance.genericType = new GenericType(new PackageableType(fullPath)); genericTypeInstance.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); return genericTypeInstance; } - private GenericTypeInstance processRelationColumnTypes(DomainParserGrammar.TypeContext ctx) + private GenericType processGenericType(DomainParserGrammar.TypeContext ctx) { - String fullPath = ctx.qualifiedName().getText(); - GenericTypeInstance genericTypeInstance = new GenericTypeInstance(); - genericTypeInstance.fullPath = fullPath; - genericTypeInstance.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); - if (!"meta::pure::metamodel::relation::Relation".equals(fullPath) && !"Relation".equals(fullPath)) + Type type; + if (ctx.qualifiedName() != null) { - throw new EngineException("Casting to type with generics is only supported for Relation type", walkerSourceInformation.getSourceInformation(ctx), EngineErrorType.PARSER); + PackageableType pType = new PackageableType(ctx.qualifiedName().getText()); + pType.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); + type = pType; } - List columnTypeContexts = ctx.typeArguments().type().get(0).columnType(); - ColSpecArray colSpecArr = new ColSpecArray(); - colSpecArr.colSpecs = ListIterate.collect(columnTypeContexts, columnTypeContext -> + else if (ctx.PAREN_OPEN() != null) { - ColSpec colSpec = new ColSpec(); - colSpec.sourceInformation = walkerSourceInformation.getSourceInformation(columnTypeContext); - colSpec.name = PureGrammarParserUtility.fromIdentifier(columnTypeContext.identifier().get(0)); - colSpec.type = PureGrammarParserUtility.fromIdentifier(columnTypeContext.identifier().get(1)); - return colSpec; - }); - genericTypeInstance.typeArguments = Lists.mutable.with(DomainParseTreeWalker.wrapWithClassInstance(colSpecArr, walkerSourceInformation.getSourceInformation(ctx), "colSpecArray")); - return genericTypeInstance; + type = new RelationType(ListIterate.collect(ctx.columnInfo(), x -> + { + Column column = new Column(x.columnName().getText(), x.columnType().getText()); + column.sourceInformation = walkerSourceInformation.getSourceInformation(x); + return column; + })); + } + else if (ctx.unitName() != null) + { + PackageableType pType = new PackageableType(ctx.getText()); + pType.sourceInformation = this.walkerSourceInformation.getSourceInformation(ctx); + type = pType; + } + else + { + throw new EngineException("The type " + ctx.getText() + " is not supported yet", this.walkerSourceInformation.getSourceInformation(ctx), EngineErrorType.PARSER); + } + GenericType result = new GenericType(type, ListIterate.collect(ctx.typeArguments() == null ? Lists.mutable.empty() : ctx.typeArguments().type(), this::processGenericType)); + if (ctx.multiplicityArguments() != null) + { + result.multiplicityArguments = ListIterate.collect(ctx.multiplicityArguments().multiplicityArgument(), this::buildMultiplicity); + } + return result; } private ValueSpecification allOrFunction(DomainParserGrammar.AllOrFunctionContext ctx, ValueSpecification instance, DomainParserGrammar.QualifiedNameContext funcName, List typeParametersNames, LambdaContext lambdaContext, String space, boolean addLines) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/GraphFetchTreeParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/GraphFetchTreeParseTreeWalker.java index eb59afff0dc..00d86864548 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/GraphFetchTreeParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/GraphFetchTreeParseTreeWalker.java @@ -20,14 +20,14 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.GraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.PropertyGraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/NavigationParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/NavigationParseTreeWalker.java index 78966c86aa7..ecaf49f703b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/NavigationParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/NavigationParseTreeWalker.java @@ -21,14 +21,14 @@ import org.finos.legend.engine.language.pure.grammar.from.antlr4.navigation.NavigationParserGrammar; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.path.Path; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.path.PropertyPathElement; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/StrictTimeParseTreeWalker.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/StrictTimeParseTreeWalker.java index 6a383c19658..e33f03d4362 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/StrictTimeParseTreeWalker.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/domain/StrictTimeParseTreeWalker.java @@ -17,7 +17,7 @@ import org.antlr.v4.runtime.tree.TerminalNode; import org.finos.legend.engine.language.pure.grammar.from.ParseTreeWalkerSourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; public class StrictTimeParseTreeWalker diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java index 57564449537..dfe935d43cf 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java @@ -63,32 +63,32 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.AggregateValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.PureList; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.TDSAggregateValue; @@ -402,7 +402,7 @@ public String visit(Function function) { return "function " + HelperDomainGrammarComposer.renderAnnotations(function.stereotypes, function.taggedValues) + PureGrammarComposerUtility.convertPath(HelperValueSpecificationGrammarComposer.getFunctionName(function)) + "(" + LazyIterate.collect(function.parameters, p -> p.accept(Builder.newInstance(this).withVariableInFunctionSignature().build())).makeString(", ") + ")" - + ": " + function.returnType + "[" + HelperDomainGrammarComposer.renderMultiplicity(function.returnMultiplicity) + "]\n" + + + ": " + HelperValueSpecificationGrammarComposer.printGenericType(function.returnGenericType, this) + "[" + HelperDomainGrammarComposer.renderMultiplicity(function.returnMultiplicity) + "]\n" + "{\n" + LazyIterate.collect(function.body, b -> " " + b.accept(Builder.newInstance(this).withIndentation(getTabSize(1)).build())).makeString(";\n") + (function.body.size() > 1 ? ";" : "") + "\n}" + @@ -651,7 +651,7 @@ public String visit(ValueSpecification valueSpecification) } @Override - public String visit(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class _class) + public String visit(org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class _class) { return HelperValueSpecificationGrammarComposer.printFullPath(_class.fullPath, this); } @@ -681,7 +681,7 @@ public String visit(Variable variable) (this.isVariableInFunctionSignature ? "" : "$") + PureGrammarComposerUtility.convertIdentifier(variable.name) + (this.isRenderingHTML() ? "" : "") + - (variable._class != null ? ": " + HelperValueSpecificationGrammarComposer.printFullPath(variable._class.path, this) + "[" + HelperDomainGrammarComposer.renderMultiplicity(variable.multiplicity) + "]" : ""); + (variable.genericType != null ? ": " + HelperValueSpecificationGrammarComposer.printGenericType(variable.genericType, this) + "[" + HelperDomainGrammarComposer.renderMultiplicity(variable.multiplicity) + "]" : ""); } @Override @@ -747,7 +747,7 @@ public String visit(ClassInstance iv) return (this.isRenderingHTML() ? "" : "") + "olapGroupBy" + (this.isRenderingHTML() ? "" : "") + "(" + tdsOlapAggregation.function.accept(this) + ")"; case "tdsAggregateValue": TDSAggregateValue tdsAggregateValue = (TDSAggregateValue) iv.value; - return (this.isRenderingHTML() ? "" : "") + "agg" + (this.isRenderingHTML() ? "" : "") + "(" + convertString(tdsAggregateValue.name,true) + "," + tdsAggregateValue.mapFn.accept(this) + ", " + tdsAggregateValue.aggregateFn.accept(this) + ")"; + return (this.isRenderingHTML() ? "" : "") + "agg" + (this.isRenderingHTML() ? "" : "") + "(" + convertString(tdsAggregateValue.name, true) + "," + tdsAggregateValue.mapFn.accept(this) + ", " + tdsAggregateValue.aggregateFn.accept(this) + ")"; default: PureGrammarComposerContext context = this.toContext(); @@ -763,7 +763,9 @@ public String visit(ClassInstance iv) @Override public String visit(AppliedFunction appliedFunction) { - String function = appliedFunction.function; + String _function = appliedFunction.function; + int index = _function.lastIndexOf("::"); + String function = index == -1 ? _function : _function.substring(index + 2); List parameters = appliedFunction.parameters; if ("getAll".equals(function)) @@ -778,11 +780,28 @@ else if ("letFunction".equals(function)) { return "let " + PureGrammarComposerUtility.convertIdentifier(((CString) parameters.get(0)).value) + " = " + parameters.get(1).accept(this); } + else if ("cast".equals(function)) + { + return parameters.get(0).accept(this) + "->" + _function + "(@" + parameters.get(1).accept(this) + ")"; + } + else if ("subType".equals(function)) + { + return parameters.get(0).accept(this) + "->" + _function + "(@" + parameters.get(1).accept(this) + ")"; + } else if ("new".equals(function)) { ValueSpecification param = parameters.get(parameters.size() - 1); List values = param instanceof Collection ? ((Collection) param).values : Arrays.asList(param); - return "^" + parameters.get(0).accept(this) + "(" + Lists.mutable.withAll(values).collect(v -> v.accept(this)).makeString(" , ") + ")"; + String type; + if (parameters.get(0) instanceof GenericTypeInstance) + { + type = printGenericType(((GenericTypeInstance) parameters.get(0)).genericType.typeArguments.get(0), this); + } + else + { + type = parameters.get(0).accept(this); + } + return "^" + type + "(" + Lists.mutable.withAll(values).collect(v -> v.accept(this)).makeString(" , ") + ")"; } else if ("not".equals(function)) { @@ -1042,22 +1061,7 @@ public String visit(AppliedQualifiedProperty appliedQualifiedProperty) public String visit(GenericTypeInstance genericTypeInstance) { StringBuilder builder = new StringBuilder(); - builder.append('@' + HelperValueSpecificationGrammarComposer.printFullPath(genericTypeInstance.fullPath, this)); - if (genericTypeInstance.typeArguments != null && !genericTypeInstance.typeArguments.isEmpty() && genericTypeInstance.typeArguments.get(0) instanceof ClassInstance && ((ClassInstance) genericTypeInstance.typeArguments.get(0)).type.equals("colSpecArray")) - { - ColSpecArray colSpecArray = (ColSpecArray) ((ClassInstance) genericTypeInstance.typeArguments.get(0)).value; - builder.append("<("); - if (this.isRenderingPretty()) - { - builder.append(this.returnChar() + DEPRECATED_PureGrammarComposerCore.computeIndentationString(this, getTabSize(1)) + " "); - } - builder.append(LazyIterate.collect(colSpecArray.colSpecs, colSpec -> HelperValueSpecificationGrammarComposer.printColSpec(colSpec, this)).makeString("," + (this.isRenderingPretty() ? this.returnChar() + " " + DEPRECATED_PureGrammarComposerCore.computeIndentationString(this, getTabSize(1)) : " "))); - if (this.isRenderingPretty()) - { - builder.append(this.returnChar() + DEPRECATED_PureGrammarComposerCore.computeIndentationString(this, 0)).append(" "); - } - builder.append(")>"); - } + builder.append(printGenericType(genericTypeInstance.genericType, this)); return builder.toString(); } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperDomainGrammarComposer.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperDomainGrammarComposer.java index 7bec01b0352..b91e968b0e9 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperDomainGrammarComposer.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperDomainGrammarComposer.java @@ -93,7 +93,7 @@ public static String renderMultiplicity(Multiplicity multiplicity) public static String renderProperty(Property property, DEPRECATED_PureGrammarComposerCore transformer) { - return renderAnnotations(property.stereotypes, property.taggedValues) + renderAggregation(property.aggregation) + PureGrammarComposerUtility.convertIdentifier(property.name) + ": " + property.type + "[" + renderMultiplicity(property.multiplicity) + "]" + (property.defaultValue != null ? " = " + property.defaultValue.value.accept(transformer) : ""); + return renderAnnotations(property.stereotypes, property.taggedValues) + renderAggregation(property.aggregation) + PureGrammarComposerUtility.convertIdentifier(property.name) + ": " + HelperValueSpecificationGrammarComposer.printGenericType(property.genericType, transformer) + "[" + renderMultiplicity(property.multiplicity) + "]" + (property.defaultValue != null ? " = " + property.defaultValue.value.accept(transformer) : ""); } private static String renderAggregation(AggregationKind aggregationKind) @@ -136,7 +136,7 @@ public static String renderDerivedProperty(QualifiedProperty qualifiedProperty, .collect(qualifiedProperty.body, b -> b.accept(transformer)) .makeString("\n" + getTabString(2), ";\n" + getTabString(2), ";\n" + getTabString())) + "}: " - + qualifiedProperty.returnType + "[" + renderMultiplicity(qualifiedProperty.returnMultiplicity) + "]"; + + HelperValueSpecificationGrammarComposer.printGenericType(qualifiedProperty.returnGenericType, transformer) + "[" + renderMultiplicity(qualifiedProperty.returnMultiplicity) + "]"; } public static String renderConstraint(Constraint constraint, List allConstraints, DEPRECATED_PureGrammarComposerCore transformer) @@ -182,7 +182,7 @@ public static String renderConstraint(Constraint constraint, List al public static String renderFunctionTestSuites(Function function, PureGrammarComposerContext context) { StringBuilder stringBuilder = new StringBuilder(); - if (function.tests == null) + if (function.tests.isEmpty()) { return stringBuilder.toString(); } @@ -198,7 +198,7 @@ public static String renderFunctionTestSuite(Function function, FunctionTestSuit StringBuilder str = new StringBuilder(); if (!functionTestSuite.id.equals(DEFAULT_TESTABLE_ID)) { - str.append(getTabString(baseIndentation)).append(functionTestSuite.id).append("\n").append(getTabString(baseIndentation)).append("(\n"); + str.append(getTabString(baseIndentation)).append(functionTestSuite.id).append("\n").append(getTabString(baseIndentation)).append("(\n"); if (functionTestSuite.testData != null && !functionTestSuite.testData.isEmpty()) { str.append(String.join("\n", ListIterate.collect(functionTestSuite.testData, test -> renderFunctionTestData(test, baseIndentation + 1, context)))).append("\n"); @@ -279,7 +279,7 @@ private static String renderTestAssertion(TestAssertion testAssertion, PureGramm { if (testAssertion instanceof EqualTo) { - return ((EqualTo)testAssertion).expected.accept(DEPRECATED_PureGrammarComposerCore.Builder.newInstance(context).build()); + return ((EqualTo) testAssertion).expected.accept(DEPRECATED_PureGrammarComposerCore.Builder.newInstance(context).build()); } else if (testAssertion instanceof EqualToJson) { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperValueSpecificationGrammarComposer.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperValueSpecificationGrammarComposer.java index a455acfefa7..9773897959b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperValueSpecificationGrammarComposer.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/HelperValueSpecificationGrammarComposer.java @@ -23,18 +23,22 @@ import org.finos.legend.engine.language.pure.grammar.from.domain.DateParseTreeWalker; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.type.Type; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.path.PathElement; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.path.PropertyPathElement; @@ -93,7 +97,7 @@ public static boolean isPrimitiveValue(ValueSpecification valueSpecification) public static String printColSpec(ColSpec col, DEPRECATED_PureGrammarComposerCore transformer) { - return PureGrammarComposerUtility.convertIdentifier(col.name) + (col.type != null ? ":" + col.type : "") + (col.function1 != null ? ":" + (transformer.isRenderingPretty() ? " " : "") + col.function1.accept(transformer) : "") + (col.function2 != null ? ":" + col.function2.accept(transformer) : ""); + return PureGrammarComposerUtility.convertIdentifier(col.name) + (col.type != null ? ":" + col.type : "") + (col.function1 != null ? ":" + (transformer.isRenderingPretty() ? " " : "") + col.function1.accept(transformer) : "") + (col.function2 != null ? ":" + col.function2.accept(transformer) : ""); } public static String printColSpecArray(ColSpecArray colSpecArray, DEPRECATED_PureGrammarComposerCore transformer) @@ -289,7 +293,7 @@ public static String getFunctionDescriptor(Function function) String packageName = function._package; String functionName = getFunctionNameWithNoPackage(function); String functionSignature = LazyIterate.collect(function.parameters, HelperValueSpecificationGrammarComposer::getFunctionDescriptorParameterSignature).select(Objects::nonNull).makeString(","); - String returnTypeSignature = getClassSignature(function.returnType); + String returnTypeSignature = getClassSignature(((PackageableType) function.returnGenericType.rawType).fullPath); String returnMultiplicitySignature = HelperDomainGrammarComposer.renderMultiplicity(function.returnMultiplicity); builder.append(packageName) .append("::") @@ -320,18 +324,18 @@ public static String getFunctionNameWithNoPackage(org.finos.legend.engine.protoc public static String getFunctionSignature(Function function) { String functionSignature = LazyIterate.collect(function.parameters, HelperValueSpecificationGrammarComposer::getParameterSignature).select(Objects::nonNull).makeString("__") - + "__" + getClassSignature(function.returnType) + "_" + getMultiplicitySignature(function.returnMultiplicity) + "_"; + + "__" + getClassSignature(((PackageableType) function.returnGenericType.rawType).fullPath) + "_" + getMultiplicitySignature(function.returnMultiplicity) + "_"; return function.parameters.size() > 0 ? "_" + functionSignature : functionSignature; } private static String getParameterSignature(Variable p) { - return p._class != null ? getClassSignature(p._class.path) + "_" + getMultiplicitySignature(p.multiplicity) : null; + return p.genericType != null ? getClassSignature(((PackageableType) p.genericType.rawType).fullPath) + "_" + getMultiplicitySignature(p.multiplicity) : null; } private static String getFunctionDescriptorParameterSignature(Variable p) { - return p._class != null ? getClassSignature(p._class.path) + "[" + HelperDomainGrammarComposer.renderMultiplicity(p.multiplicity) + "]" : null; + return p.genericType != null ? getClassSignature(((PackageableType) p.genericType.rawType).fullPath) + "[" + HelperDomainGrammarComposer.renderMultiplicity(p.multiplicity) + "]" : null; } private static String getClassSignature(String _class) @@ -360,4 +364,29 @@ public static String generateValidDateValueContainingPercent(String date) { return date.indexOf(DateParseTreeWalker.DATE_PREFIX) != -1 ? date : DateParseTreeWalker.DATE_PREFIX + date; } + + public static String printGenericType(GenericType genericType, DEPRECATED_PureGrammarComposerCore transformer) + { + return printType(genericType.rawType, transformer) + + (genericType.typeArguments.isEmpty() && genericType.multiplicityArguments.isEmpty() ? + "" : + "<" + + ListIterate.collect(genericType.typeArguments, x -> printGenericType(x, transformer)).makeString(", ") + + (genericType.multiplicityArguments.isEmpty() ? "" : "|" + ListIterate.collect(genericType.multiplicityArguments, HelperDomainGrammarComposer::renderMultiplicity).makeString(",")) + + ">" + ); + } + + public static String printType(Type type, DEPRECATED_PureGrammarComposerCore transformer) + { + if (type instanceof PackageableType) + { + return printFullPath(((PackageableType) type).fullPath, transformer); + } + else if (type instanceof RelationType) + { + return "(" + ListIterate.collect(((RelationType) type).columns, x -> x.name + ":" + x.type).makeString(", ") + ")"; + } + throw new RuntimeException(type.getClass().getSimpleName() + ": Not supported"); + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/data/ModelStoreDataGrammarComposer.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/data/ModelStoreDataGrammarComposer.java index accf4123e49..2ae0fa5dcd3 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/data/ModelStoreDataGrammarComposer.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/to/data/ModelStoreDataGrammarComposer.java @@ -26,33 +26,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import java.util.List; import java.util.Stack; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java index 5a9df1e107a..92a509e449b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestDomainGrammarParser.java @@ -26,6 +26,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Class; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Profile; +import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.junit.Assert; import org.junit.Test; @@ -162,4 +163,44 @@ public void testProfile() Assert.assertEquals(18, profile.tags.get(1).sourceInformation.startColumn); Assert.assertEquals(21, profile.tags.get(1).sourceInformation.endColumn); } + + @Test + public void testPreventTypeParametersInClass() + { + EngineException e = Assert.assertThrows(EngineException.class, () -> test( + "Class x::X{}")); + Assert.assertEquals("PARSER error at [1:11-13]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "Class x::X<|m>{}")); + Assert.assertEquals("PARSER error at [1:11-14]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "Class x::X{}")); + Assert.assertEquals("PARSER error at [1:11-15]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "Class x::X{}")); + Assert.assertEquals("PARSER error at [1:11-19]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + } + + @Test + public void testPreventTypeParametersInFunction() + { + EngineException e = Assert.assertThrows(EngineException.class, () -> test( + "function x::f(x:String[1]):String[1]{'ok'}")); + Assert.assertEquals("PARSER error at [1:14-16]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "function x::f<|m>(x:String[1]):String[1]{'ok'}")); + Assert.assertEquals("PARSER error at [1:14-17]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "function x::f(x:String[1]):String[1]{'ok'}")); + Assert.assertEquals("PARSER error at [1:14-18]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + + e = Assert.assertThrows(EngineException.class, () -> test( + "function x::f(x:String[1]):String[1]{'ok'}")); + Assert.assertEquals("PARSER error at [1:14-22]: Type and/or multiplicity parameters are not authorized in Legend Engine", e.toPretty()); + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestMappingGrammarParser.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestMappingGrammarParser.java index 0a1b2e4e170..3b74a45b637 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestMappingGrammarParser.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/parser/TestMappingGrammarParser.java @@ -31,7 +31,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.Mapping; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; import org.finos.legend.engine.shared.core.operational.Assert; import org.junit.Test; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestDomainGrammarArgumentsRoundtrip.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestDomainGrammarArgumentsRoundtrip.java new file mode 100644 index 00000000000..36d8c7cd6fb --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/roundtrip/TestDomainGrammarArgumentsRoundtrip.java @@ -0,0 +1,63 @@ +// Copyright 2024 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.language.pure.grammar.test.roundtrip; + +import org.finos.legend.engine.language.pure.grammar.test.TestGrammarRoundtrip; +import org.junit.Test; + +public class TestDomainGrammarArgumentsRoundtrip extends TestGrammarRoundtrip.TestGrammarRoundtripTestSuite +{ + // TO FIX ------ + // We don't want to authorize typeParameters but typeArguments for system's parameterized types should be allowed + // Unfortunately the parser is considering Result as a type and not a GenericType with rawType=Result and typeArguments = GenericType(rawType=String) + // Which means the compiler can't work... We need to parse the GenericType and 'slot' it in the Protocol. + // ------------- + + @Test + public void testFunctionWithTypeArguments() + { + test("function withPath::f(s: Result[1]): Result[0..1]\n" + + "{\n" + + " []\n" + + "}\n"); + } + + @Test + public void testClassPropertiesWithTypeArguments() + { + test("Class my::Class\n" + + "{\n" + + " prop1: Result[1];\n" + + "}\n"); + } + + @Test + public void testCast() + { + test("function withPath::f(s: a::Result[1]): Relation<(a:Integer)>[0..1]\n" + + "{\n" + + " []->cast(@Relation<(a:Integer)>)\n" + + "}\n"); + } + + @Test + public void testFunc() + { + test("function withPath::f(s: a::Type[1]): String[0..1]\n" + + "{\n" + + " []\n" + + "}\n"); + } +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/resources/SimpleMixedBooleanArithmeticConstraint.json b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/resources/SimpleMixedBooleanArithmeticConstraint.json index 1301d348b7f..c82a5e1100b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/resources/SimpleMixedBooleanArithmeticConstraint.json +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/resources/SimpleMixedBooleanArithmeticConstraint.json @@ -135,18 +135,27 @@ "package": "test", "properties": [ { + "genericType": { + "multiplicityArguments": [], + "rawType": { + "_type": "packageableType", + "fullPath": "Integer", + "sourceInformation": { + "endColumn": 14, + "endLine": 6, + "sourceId": "", + "startColumn": 8, + "startLine": 6 + } + }, + "typeArguments": [], + "typeVariableValues": [] + }, "multiplicity": { "lowerBound": 1, "upperBound": 1 }, "name": "id", - "propertyTypeSourceInformation": { - "endColumn": 14, - "endLine": 6, - "sourceId": "", - "startColumn": 8, - "startLine": 6 - }, "sourceInformation": { "endColumn": 18, "endLine": 6, @@ -155,8 +164,7 @@ "startLine": 6 }, "stereotypes": [], - "taggedValues": [], - "type": "Integer" + "taggedValues": [] } ], "qualifiedProperties": [], @@ -194,4 +202,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/ProcessHelper.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/ProcessHelper.java new file mode 100644 index 00000000000..d4570f77b72 --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/ProcessHelper.java @@ -0,0 +1,48 @@ +// Copyright 2024 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.protocol.pure.v1; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.JsonNode; +import org.eclipse.collections.api.factory.Lists; +import org.eclipse.collections.api.list.MutableList; + +import java.util.Iterator; + +public class ProcessHelper +{ + public static X processOne(JsonNode node, String name, java.lang.Class _class, ObjectCodec codec) throws JsonProcessingException + { + JsonNode sourceInformation = node.get(name); + return sourceInformation == null ? null : codec.treeToValue(sourceInformation, _class); + } + + public static MutableList processMany(JsonNode node, String name, java.lang.Class _class, ObjectCodec codec) throws JsonProcessingException + { + JsonNode stereotypes = node.get(name); + if (stereotypes != null) + { + MutableList res = Lists.mutable.empty(); + Iterator it = stereotypes.elements(); + while (it.hasNext()) + { + res.add(codec.treeToValue(it.next(), _class)); + } + return res; + } + return Lists.mutable.empty(); + } +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/Function.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/Function.java index c209080b29b..7bec71bb5ec 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/Function.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/Function.java @@ -14,30 +14,81 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElementVisitor; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.function.FunctionTestSuite; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; +import java.io.IOException; import java.util.Collections; import java.util.List; +import static org.finos.legend.engine.protocol.pure.v1.ProcessHelper.processMany; +import static org.finos.legend.engine.protocol.pure.v1.ProcessHelper.processOne; + +@JsonDeserialize(using = Function.FunctionDeserializer.class) public class Function extends PackageableElement { public List preConstraints = Collections.emptyList(); public List postConstraints = Collections.emptyList(); public List parameters = Collections.emptyList(); - public String returnType; + public GenericType returnGenericType; public Multiplicity returnMultiplicity; public List stereotypes = Collections.emptyList(); public List taggedValues = Collections.emptyList(); public List body = Collections.emptyList(); - public List tests; + public List tests = Collections.emptyList(); @Override public T accept(PackageableElementVisitor visitor) { return visitor.visit(this); } + + public static class FunctionDeserializer extends JsonDeserializer + { + @Override + public Function deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException + { + Function result = new Function(); + + ObjectCodec codec = jsonParser.getCodec(); + JsonNode node = codec.readTree(jsonParser); + + result.name = processOne(node, "name", String.class, codec); + result._package = processOne(node, "package", String.class, codec); + result.sourceInformation = processOne(node, "sourceInformation", SourceInformation.class, codec); + + result.preConstraints = processMany(node, "preConstraints", Constraint.class, codec); + result.postConstraints = processMany(node, "postConstraints", Constraint.class, codec); + result.parameters = processMany(node, "parameters", Variable.class, codec); + + result.returnGenericType = processOne(node, "returnGenericType", GenericType.class, codec); + // Backward compatibility -------------- + if (node.get("returnType") != null) + { + String fullPath = node.get("returnType").asText(); + result.returnGenericType = new GenericType(new PackageableType(fullPath)); + } + // Backward compatibility -------------- + + result.returnMultiplicity = processOne(node, "returnMultiplicity", Multiplicity.class, codec); + result.stereotypes = processMany(node, "stereotypes", StereotypePtr.class, codec); + result.taggedValues = processMany(node, "taggedValues", TaggedValue.class, codec); + result.body = processMany(node, "body", ValueSpecification.class, codec); + result.tests = processMany(node, "tests", FunctionTestSuite.class, codec); + + return result; + } + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/Property.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/Property.java index 53254bb2a70..e9ff6a83d6c 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/Property.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/Property.java @@ -14,20 +14,72 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import java.io.IOException; import java.util.Collections; import java.util.List; +import static org.finos.legend.engine.protocol.pure.v1.ProcessHelper.processMany; +import static org.finos.legend.engine.protocol.pure.v1.ProcessHelper.processOne; + +@JsonDeserialize(using = Property.PropertyDeserializer.class) public class Property { public String name; - public String type; + public GenericType genericType; public Multiplicity multiplicity; public DefaultValue defaultValue; public List stereotypes = Collections.emptyList(); public List taggedValues = Collections.emptyList(); - public SourceInformation sourceInformation; - public SourceInformation propertyTypeSourceInformation; public AggregationKind aggregation; + public SourceInformation sourceInformation; + + public static class PropertyDeserializer extends JsonDeserializer + { + @Override + public Property deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException + { + ObjectCodec codec = jsonParser.getCodec(); + JsonNode node = codec.readTree(jsonParser); + + Property property = new Property(); + + property.name = node.get("name").asText(); + + property.genericType = processOne(node, "genericType", GenericType.class, codec); + + // Backward compatibility -------------- + if (node.get("type") != null) + { + String fullPath = node.get("type").asText(); + PackageableType type = new PackageableType(fullPath); + if (node.get("propertyTypeSourceInformation") != null) + { + type.sourceInformation = codec.treeToValue(node.get("propertyTypeSourceInformation"), SourceInformation.class); + } + property.genericType = new GenericType(type); + } + // Backward compatibility -------------- + + property.multiplicity = processOne(node, "multiplicity", Multiplicity.class, codec); + property.defaultValue = processOne(node, "defaultValue", DefaultValue.class, codec); + property.stereotypes = processMany(node, "stereotypes", StereotypePtr.class, codec); + property.taggedValues = processMany(node, "taggedValues", TaggedValue.class, codec); + property.aggregation = processOne(node, "aggregation", AggregationKind.class, codec); + property.sourceInformation = processOne(node, "sourceInformation", SourceInformation.class, codec); + + return property; + } + } + + } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/QualifiedProperty.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/QualifiedProperty.java index 19506b685a8..72956bc69d6 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/QualifiedProperty.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/domain/QualifiedProperty.java @@ -14,21 +14,68 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; +import java.io.IOException; import java.util.Collections; import java.util.List; +import static org.finos.legend.engine.protocol.pure.v1.ProcessHelper.processMany; +import static org.finos.legend.engine.protocol.pure.v1.ProcessHelper.processOne; + +@JsonDeserialize(using = QualifiedProperty.QualifiedPropertyDeserializer.class) public class QualifiedProperty { public String name; public List parameters = Collections.emptyList(); - public String returnType; + public GenericType returnGenericType; public Multiplicity returnMultiplicity; public List stereotypes = Collections.emptyList(); public List taggedValues = Collections.emptyList(); public List body = Collections.emptyList(); public SourceInformation sourceInformation; + + public static class QualifiedPropertyDeserializer extends JsonDeserializer + { + @Override + public QualifiedProperty deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException + { + QualifiedProperty result = new QualifiedProperty(); + + ObjectCodec codec = jsonParser.getCodec(); + JsonNode node = codec.readTree(jsonParser); + + result.name = node.get("name").asText(); + result.parameters = processMany(node, "parameters", Variable.class, codec); + + result.returnGenericType = processOne(node, "returnGenericType", GenericType.class, codec); + // Backward compatibility -------------- + if (node.get("returnType") != null) + { + String fullPath = node.get("returnType").asText(); + result.returnGenericType = new GenericType(new PackageableType(fullPath)); + } + // Backward compatibility -------------- + + result.returnMultiplicity = processOne(node, "returnMultiplicity", Multiplicity.class, codec); + result.stereotypes = processMany(node, "stereotypes", StereotypePtr.class, codec); + result.taggedValues = processMany(node, "taggedValues", TaggedValue.class, codec); + result.body = processMany(node, "body", ValueSpecification.class, codec); + result.sourceInformation = processOne(node, "sourceInformation", SourceInformation.class, codec); + + return result; + } + + + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/GenericType.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/GenericType.java new file mode 100644 index 00000000000..4c27c5812d3 --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/GenericType.java @@ -0,0 +1,53 @@ +// Copyright 2024 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.protocol.pure.v1.model.type; + +import org.eclipse.collections.api.factory.Lists; +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; +import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; + +import java.util.List; + +public class GenericType +{ + public Type rawType; + public List typeArguments = Lists.mutable.empty(); + public List multiplicityArguments = Lists.mutable.empty(); + public List typeVariableValues = Lists.mutable.empty(); + public SourceInformation sourceInformation; + + public GenericType() + { + } + + public GenericType(Type rawType) + { + this.rawType = rawType; + } + + public GenericType(Type rawType, List typeArguments) + { + this.rawType = rawType; + this.typeArguments = typeArguments; + } + + public GenericType(Type rawType, List typeArguments, List multiplicityArguments) + { + this.rawType = rawType; + this.typeArguments = typeArguments; + this.multiplicityArguments = multiplicityArguments; + } +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DeprecatedValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/PackageableType.java similarity index 56% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DeprecatedValueSpecification.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/PackageableType.java index 435a48083d0..0bcf4e3935d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DeprecatedValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/PackageableType.java @@ -1,4 +1,4 @@ -// Copyright 2022 Goldman Sachs +// Copyright 2024 Goldman Sachs // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,8 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.type; -public abstract class DeprecatedValueSpecification extends One +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; + +public class PackageableType extends PackageableElementPtr implements Type { + public PackageableType() + { + super(); + } + + public PackageableType(String fullPath) + { + super(fullPath); + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/Type.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/Type.java new file mode 100644 index 00000000000..d2ef15ff427 --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/Type.java @@ -0,0 +1,29 @@ +// Copyright 2024 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.protocol.pure.v1.model.type; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.finos.legend.engine.protocol.pure.v1.model.type.relationType.RelationType; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "_type") +@JsonSubTypes({ + // Collection + @JsonSubTypes.Type(value = PackageableType.class, name = "packageableType"), + @JsonSubTypes.Type(value = RelationType.class, name = "relationType"), +}) +public interface Type +{ +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/Column.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/Column.java similarity index 66% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/Column.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/Column.java index 6fade57c389..e3e2bc652cd 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/Column.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/Column.java @@ -12,10 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.relationType; +package org.finos.legend.engine.protocol.pure.v1.model.type.relationType; + +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; public class Column { + public SourceInformation sourceInformation; public String name; public String type; + + public Column() + { + } + + public Column(String name, String type) + { + this.name = name; + this.type = type; + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/RelationType.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/RelationType.java similarity index 62% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/RelationType.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/RelationType.java index 51745fadb93..e3725e29af7 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/relationType/RelationType.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/type/relationType/RelationType.java @@ -12,12 +12,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.relationType; +package org.finos.legend.engine.protocol.pure.v1.model.type.relationType; + +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; +import org.finos.legend.engine.protocol.pure.v1.model.type.Type; import java.util.Collections; import java.util.List; -public class RelationType +public class RelationType implements Type { + public SourceInformation sourceInformation; public List columns = Collections.emptyList(); + + public RelationType() + { + } + + public RelationType(List columns) + { + this.columns = columns; + } } diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecification.java index 39d857170ef..0f8ca6cc236 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecification.java @@ -20,34 +20,34 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedClass; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedClass; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "_type") @JsonSubTypes({ diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecificationVisitor.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecificationVisitor.java index 1893c48718d..32282c5b26b 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecificationVisitor.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/ValueSpecificationVisitor.java @@ -16,33 +16,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; public interface ValueSpecificationVisitor { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/Variable.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/Variable.java index 2927df1c8ed..b86bc90685c 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/Variable.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/Variable.java @@ -14,24 +14,29 @@ package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; -import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementType; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import org.eclipse.collections.api.factory.Lists; +import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; -import org.finos.legend.engine.protocol.pure.v1.model.relationType.RelationType; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import java.io.IOException; + +@JsonDeserialize(using = Variable.VariableDeserializer.class) public class Variable extends ValueSpecification { + private static ObjectMapper om = PureProtocolObjectMapperFactory.getNewObjectMapper(); + public String name; + public GenericType genericType; public Multiplicity multiplicity; - - // Type can be either a Class or a RelationType - @JsonProperty(value = "class") - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) - public PackageableElementPointer _class; - public RelationType relationType; - public Boolean supportsStream; public Variable() @@ -42,7 +47,14 @@ public Variable() public Variable(String name, String _class, Multiplicity multiplicity) { this.name = name; - this._class = new PackageableElementPointer(PackageableElementType.CLASS, _class); + this.genericType = new GenericType(new PackageableType(_class)); + this.multiplicity = multiplicity; + } + + public Variable(String name, GenericType genericType, Multiplicity multiplicity) + { + this.name = name; + this.genericType = genericType; this.multiplicity = multiplicity; } @@ -51,4 +63,49 @@ public T accept(ValueSpecificationVisitor visitor) { return visitor.visit(this); } + + public static class VariableDeserializer extends JsonDeserializer + { + @Override + public ValueSpecification deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException + { + JsonNode node = jsonParser.getCodec().readTree(jsonParser); + Variable variable = new Variable(); + variable.name = node.get("name").asText(); + + // Backward compatibility ------------------------------------------------------------------- + if (node.get("class") != null) + { + String _class = node.get("class").asText(); + GenericType genericType = new GenericType(new PackageableType(_class)); + if ("meta::pure::mapping::Result".equals(_class) || "Result".equals(_class)) + { + genericType.typeArguments = Lists.mutable.of(new GenericType(new PackageableType("meta::pure::metamodel::type::Any"))); + genericType.multiplicityArguments = Lists.mutable.of(Multiplicity.PURE_MANY); + } + variable.genericType = genericType; + } + // Backward compatibility ------------------------------------------------------------------- + + else if (node.get("genericType") != null) + { + variable.genericType = om.treeToValue(node.get("genericType"), GenericType.class); + } + if (node.get("multiplicity") != null) + { + variable.multiplicity = om.treeToValue(node.get("multiplicity"), Multiplicity.class); + } + if (node.get("sourceInformation") != null) + { + variable.sourceInformation = om.treeToValue(node.get("sourceInformation"), SourceInformation.class); + } + if (node.get("supportsStream") != null) + { + variable.supportsStream = om.treeToValue(node.get("supportsStream"), Boolean.class); + } + return variable; + } + } } + + diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/AbstractAppliedFunction.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AbstractAppliedFunction.java similarity index 87% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/AbstractAppliedFunction.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AbstractAppliedFunction.java index 0827d5016d4..2fc847c3668 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/AbstractAppliedFunction.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AbstractAppliedFunction.java @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application; + +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; public abstract class AbstractAppliedFunction extends One { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedFunction.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedFunction.java index 67201910a36..8036dd5a0ed 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedFunction.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedFunction.java @@ -16,7 +16,6 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.AbstractAppliedFunction; import java.util.Collections; import java.util.List; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedProperty.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedProperty.java index 951ead3f86b..8eb7dcfd0a4 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedProperty.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedProperty.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.AbstractAppliedFunction; import java.util.Collections; import java.util.List; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedQualifiedProperty.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/AppliedQualifiedProperty.java similarity index 95% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedQualifiedProperty.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/AppliedQualifiedProperty.java index 8f991084762..7c949cecde3 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/AppliedQualifiedProperty.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/AppliedQualifiedProperty.java @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.annotation.JsonProperty; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.AbstractAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AbstractAppliedFunction; import java.util.Collections; import java.util.List; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Class.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Class.java similarity index 92% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Class.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Class.java index 7b75cec065e..f44ec582066 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Class.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Class.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Enum.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Enum.java similarity index 92% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Enum.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Enum.java index b20d1b288ce..9b8a6cb2889 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Enum.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Enum.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedClass.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedClass.java similarity index 89% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedClass.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedClass.java index 9d6030e1fd6..720a8d789e7 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedClass.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedClass.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -22,6 +22,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedUnit.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedUnit.java similarity index 90% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedUnit.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedUnit.java index 49f8ac7db57..bbd831de302 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/HackedUnit.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/HackedUnit.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -22,6 +22,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/MappingInstance.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/MappingInstance.java similarity index 92% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/MappingInstance.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/MappingInstance.java index c6c2f34dd9a..f2bd0639b79 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/MappingInstance.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/MappingInstance.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveType.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/PrimitiveType.java similarity index 95% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveType.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/PrimitiveType.java index 85cca2fac1c..e0bbdb75e47 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveType.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/PrimitiveType.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -24,6 +24,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/UnknownAppliedFunction.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/UnknownAppliedFunction.java similarity index 94% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/UnknownAppliedFunction.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/UnknownAppliedFunction.java index 11f80d0da67..1706e436750 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/application/UnknownAppliedFunction.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/UnknownAppliedFunction.java @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.AbstractAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AbstractAppliedFunction; @Deprecated public class UnknownAppliedFunction extends AbstractAppliedFunction diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Whatever.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Whatever.java similarity index 88% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Whatever.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Whatever.java index 3c241e5e104..ce59be2e8dc 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/Whatever.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/deprecated/Whatever.java @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated; import com.fasterxml.jackson.annotation.JsonProperty; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; @Deprecated -public class Whatever extends DeprecatedValueSpecification +public class Whatever extends One { @JsonProperty(value = "class") public String _class; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/GenericTypeInstance.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/GenericTypeInstance.java deleted file mode 100644 index 67f9fff226f..00000000000 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/GenericTypeInstance.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020 Goldman Sachs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; - -import java.io.IOException; -import java.util.List; - -public class GenericTypeInstance extends PackageableElementPtr -{ - public List typeArguments; - - public GenericTypeInstance() - { - } - - public GenericTypeInstance(String fullPath) - { - super(fullPath); - } - - @Override - public T accept(ValueSpecificationVisitor visitor) - { - return visitor.visit(this); - } - - public static class HackedClassDeserializer extends JsonDeserializer - { - @Override - public ValueSpecification deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException - { - return convert(jsonParser.getCodec().readTree(jsonParser)); - } - } -} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CBoolean.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CBoolean.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CBoolean.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CBoolean.java index fd6ccef22ce..7354afded50 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CBoolean.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CBoolean.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CByteArray.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CByteArray.java similarity index 97% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CByteArray.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CByteArray.java index 0d1fbff0c56..54912c9adcf 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CByteArray.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CByteArray.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDate.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDate.java similarity index 96% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDate.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDate.java index 11a41519bc3..4ab24edb0d5 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDate.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDate.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; public abstract class CDate extends PrimitiveValueSpecification { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDateTime.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDateTime.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDateTime.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDateTime.java index b0e3d5ae784..2537af20838 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDateTime.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDateTime.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDecimal.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDecimal.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDecimal.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDecimal.java index 6011ead401d..d4c5377b2ca 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CDecimal.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CDecimal.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CFloat.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CFloat.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CFloat.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CFloat.java index 3498dd57b63..4eba4d0b6ab 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CFloat.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CFloat.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CInteger.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CInteger.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CInteger.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CInteger.java index 9143b7c3360..9fcfb6340d7 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CInteger.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CInteger.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CLatestDate.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CLatestDate.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CLatestDate.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CLatestDate.java index 0b1d83e2c12..0e4cc8b6b48 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CLatestDate.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CLatestDate.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictDate.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictDate.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictDate.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictDate.java index f9cbbd99b90..c5baae3c709 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictDate.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictDate.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictTime.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictTime.java similarity index 97% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictTime.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictTime.java index 02b964a0226..839ba04ab72 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CStrictTime.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CStrictTime.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CString.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CString.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CString.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CString.java index 1493173488f..6a83ecb8ef9 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/CString.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/CString.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DataTypeValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/DataTypeValueSpecification.java similarity index 87% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DataTypeValueSpecification.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/DataTypeValueSpecification.java index d801d42f368..109d964487e 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/DataTypeValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/DataTypeValueSpecification.java @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; + +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; public abstract class DataTypeValueSpecification extends One { diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/EnumValue.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/EnumValue.java similarity index 98% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/EnumValue.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/EnumValue.java index 873df562c26..c8af037e0e1 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/EnumValue.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/EnumValue.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveValueSpecification.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/PrimitiveValueSpecification.java similarity index 95% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveValueSpecification.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/PrimitiveValueSpecification.java index 48cd861dc8e..7d757868e59 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PrimitiveValueSpecification.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/PrimitiveValueSpecification.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; @@ -22,6 +22,7 @@ import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; import java.util.function.Function; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/UnitInstance.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/UnitInstance.java similarity index 97% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/UnitInstance.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/UnitInstance.java index 0a8cc2e92ba..0eb70931d51 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/UnitInstance.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/datatype/UnitInstance.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/GenericTypeInstance.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/GenericTypeInstance.java new file mode 100644 index 00000000000..66e3f361864 --- /dev/null +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/GenericTypeInstance.java @@ -0,0 +1,84 @@ +// Copyright 2020 Goldman Sachs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; +import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; + +import java.io.IOException; + +@JsonDeserialize(using = GenericTypeInstance.GenericTypeInstanceDeserializer.class) +public class GenericTypeInstance extends One +{ + protected static ObjectMapper om = PureProtocolObjectMapperFactory.getNewObjectMapper(); + + public GenericType genericType; + + public GenericTypeInstance() + { + } + + public GenericTypeInstance(GenericType genericType) + { + this.genericType = genericType; + } + + public GenericTypeInstance(String packageableType) + { + this.genericType = new GenericType(new PackageableType(packageableType)); + } + + @Override + public T accept(ValueSpecificationVisitor visitor) + { + return visitor.visit(this); + } + + public static class GenericTypeInstanceDeserializer extends JsonDeserializer + { + @Override + public ValueSpecification deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException + { + JsonNode node = jsonParser.getCodec().readTree(jsonParser); + JsonNode values = node.get("fullPath"); + ValueSpecification result; + if (values != null) + { + result = new GenericTypeInstance(new GenericType(new PackageableType(values.asText()))); + } + else + { + result = new GenericTypeInstance(om.treeToValue(node.get("genericType"), GenericType.class)); + } + JsonNode sourceInformation = node.get("sourceInformation"); + if (sourceInformation != null) + { + result.sourceInformation = om.treeToValue(sourceInformation, SourceInformation.class); + } + return result; + } + } +} diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PackageableElementPtr.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/PackageableElementPtr.java similarity index 94% rename from legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PackageableElementPtr.java rename to legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/PackageableElementPtr.java index 34f3fd4af29..481ab8a82aa 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/PackageableElementPtr.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/raw/packageableElement/PackageableElementPtr.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -20,6 +20,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.One; import java.io.IOException; diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/java/org/finos/legend/engine/protocol/test/TestCompatibilityAndMigration.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/java/org/finos/legend/engine/protocol/test/TestCompatibilityAndMigration.java index 54d9c2c4592..295a037a336 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/java/org/finos/legend/engine/protocol/test/TestCompatibilityAndMigration.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/java/org/finos/legend/engine/protocol/test/TestCompatibilityAndMigration.java @@ -74,7 +74,12 @@ public void testStringValueSpecification() throws Exception " \"elements\" : [ {\n" + " \"_type\" : \"function\",\n" + " \"name\" : \"a\",\n" + - " \"returnType\" : \"String\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + " \"returnMultiplicity\" : {\n" + " \"lowerBound\" : 0\n" + " },\n" + @@ -138,7 +143,12 @@ public void testStringCollectionValueSpecification() throws Exception " \"elements\" : [ {\n" + " \"_type\" : \"function\",\n" + " \"name\" : \"a\",\n" + - " \"returnType\" : \"String\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + " \"returnMultiplicity\" : {\n" + " \"lowerBound\" : 0\n" + " },\n" + @@ -207,7 +217,12 @@ public void testPrimitiveType() throws Exception " \"elements\" : [ {\n" + " \"_type\" : \"function\",\n" + " \"name\" : \"a\",\n" + - " \"returnType\" : \"Any\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"Any\"\n" + + " }\n" + + " },\n" + " \"returnMultiplicity\" : {\n" + " \"lowerBound\" : 1,\n" + " \"upperBound\" : 1\n" + @@ -310,7 +325,12 @@ public void testUnitType() throws Exception " }, {\n" + " \"_type\" : \"function\",\n" + " \"name\" : \"f\",\n" + - " \"returnType\" : \"Any\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"Any\"\n" + + " }\n" + + " },\n" + " \"returnMultiplicity\" : {\n" + " \"lowerBound\" : 1,\n" + " \"upperBound\" : 1\n" + @@ -334,200 +354,222 @@ public void testUnitType() throws Exception public void testCastType() throws Exception { check("{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"function\",\n" + - " \"body\": [\n" + - " {\n" + - " \"_type\": \"func\",\n" + - " \"function\": \"cast\",\n" + - " \"parameters\": [\n" + - " {\n" + - " \"_type\": \"packageableElementPtr\",\n" + - " \"fullPath\": \"a\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 2,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 2,\n" + - " \"startLine\": 1\n" + - " }\n" + - " },\n" + - " {\n" + - " \"_type\": \"hackedClass\",\n" + - " \"fullPath\": \"Type\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 7,\n" + - " \"endLine\": 2,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 4,\n" + - " \"startLine\": 2\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 8,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 5,\n" + - " \"startLine\": 1\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"name\": \"a\",\n" + - " \"package\": \"a\",\n" + - " \"parameters\": [],\n" + - " \"returnMultiplicity\": {\n" + - " \"lowerBound\": 0\n" + - " },\n" + - " \"returnType\": \"Any\"\n" + - " }\n" + - " ]\n" + - "}", "{\n" + - " \"_type\" : \"data\",\n" + - " \"elements\" : [ {\n" + - " \"_type\" : \"function\",\n" + - " \"name\" : \"a\",\n" + - " \"returnType\" : \"Any\",\n" + - " \"returnMultiplicity\" : {\n" + - " \"lowerBound\" : 0\n" + - " },\n" + - " \"body\" : [ {\n" + - " \"_type\" : \"func\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 5,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 8\n" + - " },\n" + - " \"function\" : \"cast\",\n" + - " \"parameters\" : [ {\n" + - " \"_type\" : \"packageableElementPtr\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 2,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 2\n" + - " },\n" + - " \"fullPath\" : \"a\"\n" + - " }, {\n" + - " \"_type\" : \"genericTypeInstance\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 2,\n" + - " \"startColumn\" : 4,\n" + - " \"endLine\" : 2,\n" + - " \"endColumn\" : 7\n" + - " },\n" + - " \"fullPath\" : \"Type\"\n" + - " } ]\n" + - " } ],\n" + - " \"package\" : \"a\"\n" + - " } ]\n" + - "}"); + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"packageableElementPtr\",\n" + + " \"fullPath\": \"a\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 2,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 2,\n" + + " \"startLine\": 1\n" + + " }\n" + + " },\n" + + " {\n" + + " \"_type\": \"hackedClass\",\n" + + " \"fullPath\": \"Type\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 7,\n" + + " \"endLine\": 2,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 4,\n" + + " \"startLine\": 2\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 8,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 5,\n" + + " \"startLine\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"name\": \"a\",\n" + + " \"package\": \"a\",\n" + + " \"parameters\": [],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0\n" + + " },\n" + + " \"returnType\": \"Any\"\n" + + " }\n" + + " ]\n" + + "}", + "{\n" + + " \"_type\" : \"data\",\n" + + " \"elements\" : [ {\n" + + " \"_type\" : \"function\",\n" + + " \"name\" : \"a\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"Any\"\n" + + " }\n" + + " },\n" + + " \"returnMultiplicity\" : {\n" + + " \"lowerBound\" : 0\n" + + " },\n" + + " \"body\" : [ {\n" + + " \"_type\" : \"func\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::a\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 5,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 8\n" + + " },\n" + + " \"function\" : \"cast\",\n" + + " \"parameters\" : [ {\n" + + " \"_type\" : \"packageableElementPtr\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::a\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 2,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 2\n" + + " },\n" + + " \"fullPath\" : \"a\"\n" + + " }, {\n" + + " \"_type\" : \"genericTypeInstance\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::a\",\n" + + " \"startLine\" : 2,\n" + + " \"startColumn\" : 4,\n" + + " \"endLine\" : 2,\n" + + " \"endColumn\" : 7\n" + + " },\n" + + " \"genericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"Type\"\n" + + " }\n" + + " }\n" + + " } ]\n" + + " } ],\n" + + " \"package\" : \"a\"\n" + + " } ]\n" + + "}"); } @Test public void testCastUnit() throws Exception { check("{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"function\",\n" + - " \"body\": [\n" + - " {\n" + - " \"_type\": \"func\",\n" + - " \"function\": \"cast\",\n" + - " \"parameters\": [\n" + - " {\n" + - " \"_type\": \"packageableElementPtr\",\n" + - " \"fullPath\": \"a\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 2,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 2,\n" + - " \"startLine\": 1\n" + - " }\n" + - " },\n" + - " {\n" + - " \"_type\": \"hackedUnit\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 9,\n" + - " \"endLine\": 2,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 4,\n" + - " \"startLine\": 2\n" + - " },\n" + - " \"unitType\": \"Type~A\"\n" + - " }\n" + - " ],\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 8,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 5,\n" + - " \"startLine\": 1\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"name\": \"a\",\n" + - " \"package\": \"a\",\n" + - " \"parameters\": [],\n" + - " \"returnMultiplicity\": {\n" + - " \"lowerBound\": 0\n" + - " },\n" + - " \"returnType\": \"Any\"\n" + - " }\n" + - " ]\n" + - "}", "{\n" + - " \"_type\" : \"data\",\n" + - " \"elements\" : [ {\n" + - " \"_type\" : \"function\",\n" + - " \"name\" : \"a\",\n" + - " \"returnType\" : \"Any\",\n" + - " \"returnMultiplicity\" : {\n" + - " \"lowerBound\" : 0\n" + - " },\n" + - " \"body\" : [ {\n" + - " \"_type\" : \"func\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 5,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 8\n" + - " },\n" + - " \"function\" : \"cast\",\n" + - " \"parameters\" : [ {\n" + - " \"_type\" : \"packageableElementPtr\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 2,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 2\n" + - " },\n" + - " \"fullPath\" : \"a\"\n" + - " }, {\n" + - " \"_type\" : \"genericTypeInstance\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::a\",\n" + - " \"startLine\" : 2,\n" + - " \"startColumn\" : 4,\n" + - " \"endLine\" : 2,\n" + - " \"endColumn\" : 9\n" + - " },\n" + - " \"fullPath\" : \"Type~A\"\n" + - " } ]\n" + - " } ],\n" + - " \"package\" : \"a\"\n" + - " } ]\n" + - "}"); + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"packageableElementPtr\",\n" + + " \"fullPath\": \"a\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 2,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 2,\n" + + " \"startLine\": 1\n" + + " }\n" + + " },\n" + + " {\n" + + " \"_type\": \"hackedUnit\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 9,\n" + + " \"endLine\": 2,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 4,\n" + + " \"startLine\": 2\n" + + " },\n" + + " \"unitType\": \"Type~A\"\n" + + " }\n" + + " ],\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 8,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 5,\n" + + " \"startLine\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"name\": \"a\",\n" + + " \"package\": \"a\",\n" + + " \"parameters\": [],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0\n" + + " },\n" + + " \"returnType\": \"Any\"\n" + + " }\n" + + " ]\n" + + "}", + "{\n" + + " \"_type\" : \"data\",\n" + + " \"elements\" : [ {\n" + + " \"_type\" : \"function\",\n" + + " \"name\" : \"a\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"Any\"\n" + + " }\n" + + " },\n" + + " \"returnMultiplicity\" : {\n" + + " \"lowerBound\" : 0\n" + + " },\n" + + " \"body\" : [ {\n" + + " \"_type\" : \"func\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::a\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 5,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 8\n" + + " },\n" + + " \"function\" : \"cast\",\n" + + " \"parameters\" : [ {\n" + + " \"_type\" : \"packageableElementPtr\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::a\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 2,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 2\n" + + " },\n" + + " \"fullPath\" : \"a\"\n" + + " }, {\n" + + " \"_type\" : \"genericTypeInstance\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::a\",\n" + + " \"startLine\" : 2,\n" + + " \"startColumn\" : 4,\n" + + " \"endLine\" : 2,\n" + + " \"endColumn\" : 9\n" + + " },\n" + + " \"genericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"Type~A\"\n" + + " }\n" + + " }\n" + + " } ]\n" + + " } ],\n" + + " \"package\" : \"a\"\n" + + " } ]\n" + + "}"); } @Test @@ -575,51 +617,57 @@ public void testPath() throws Exception " \"returnType\": \"String\"\n" + " }\n" + " ]\n" + - "}", "{\n" + - " \"_type\" : \"data\",\n" + - " \"elements\" : [ {\n" + - " \"_type\" : \"function\",\n" + - " \"name\" : \"f\",\n" + - " \"returnType\" : \"String\",\n" + - " \"returnMultiplicity\" : {\n" + - " \"lowerBound\" : 1,\n" + - " \"upperBound\" : 1\n" + - " },\n" + - " \"body\" : [ {\n" + - " \"_type\" : \"classInstance\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::f\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 11,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 22\n" + - " },\n" + - " \"type\" : \"path\",\n" + - " \"value\" : {\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::f\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 11,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 22\n" + - " },\n" + - " \"startType\" : \"A\",\n" + - " \"path\" : [ {\n" + - " \"_type\" : \"propertyPath\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::f\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 13,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 17\n" + - " },\n" + - " \"property\" : \"name\"\n" + - " } ]\n" + - " }\n" + - " } ],\n" + - " \"package\" : \"a\"\n" + - " } ]\n" + - "}"); + "}", + "{\n" + + " \"_type\" : \"data\",\n" + + " \"elements\" : [ {\n" + + " \"_type\" : \"function\",\n" + + " \"name\" : \"f\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + + " \"returnMultiplicity\" : {\n" + + " \"lowerBound\" : 1,\n" + + " \"upperBound\" : 1\n" + + " },\n" + + " \"body\" : [ {\n" + + " \"_type\" : \"classInstance\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::f\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 11,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 22\n" + + " },\n" + + " \"type\" : \"path\",\n" + + " \"value\" : {\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::f\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 11,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 22\n" + + " },\n" + + " \"startType\" : \"A\",\n" + + " \"path\" : [ {\n" + + " \"_type\" : \"propertyPath\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::f\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 13,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 17\n" + + " },\n" + + " \"property\" : \"name\"\n" + + " } ]\n" + + " }\n" + + " } ],\n" + + " \"package\" : \"a\"\n" + + " } ]\n" + + "}"); } @Test @@ -668,79 +716,85 @@ public void testGraphfetch() throws Exception " \"returnType\": \"String\"\n" + " }\n" + " ]\n" + - "}", "{\n" + - " \"_type\" : \"data\",\n" + - " \"elements\" : [ {\n" + - " \"_type\" : \"function\",\n" + - " \"name\" : \"f\",\n" + - " \"returnType\" : \"String\",\n" + - " \"returnMultiplicity\" : {\n" + - " \"lowerBound\" : 1,\n" + - " \"upperBound\" : 1\n" + - " },\n" + - " \"body\" : [ {\n" + - " \"_type\" : \"classInstance\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::f\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 4,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 4\n" + - " },\n" + - " \"type\" : \"rootGraphFetchTree\",\n" + - " \"value\" : {\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::f\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 4,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 4\n" + - " },\n" + - " \"subTrees\" : [ {\n" + - " \"_type\" : \"propertyGraphFetchTree\",\n" + - " \"sourceInformation\" : {\n" + - " \"sourceId\" : \"a::f\",\n" + - " \"startLine\" : 1,\n" + - " \"startColumn\" : 6,\n" + - " \"endLine\" : 1,\n" + - " \"endColumn\" : 9\n" + - " },\n" + - " \"_type\" : \"propertyGraphFetchTree\",\n" + - " \"property\" : \"name\"\n" + - " } ],\n" + - " \"_type\" : \"rootGraphFetchTree\",\n" + - " \"class\" : \"A\"\n" + - " }\n" + - " } ],\n" + - " \"package\" : \"a\"\n" + - " } ]\n" + - "}"); - } - - @Test - public void testListInstance() throws Exception - { - check("{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"function\",\n" + - " \"body\": [\n" + - " {\n" + - " \"_type\": \"listInstance\",\n" + - " \"sourceInformation\": {\n" + - " \"endColumn\": 4,\n" + - " \"endLine\": 1,\n" + - " \"sourceId\": \"a::a\",\n" + - " \"startColumn\": 2,\n" + - " \"startLine\": 1\n" + - " }\n" + - " }\n" + - " ],\n" + - " \"name\": \"a\",\n" + - " \"package\": \"a\",\n" + - " \"parameters\": [],\n" + - " \"returnMultiplicity\": {\n" + + "}", + "{\n" + + " \"_type\" : \"data\",\n" + + " \"elements\" : [ {\n" + + " \"_type\" : \"function\",\n" + + " \"name\" : \"f\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + + " \"returnMultiplicity\" : {\n" + + " \"lowerBound\" : 1,\n" + + " \"upperBound\" : 1\n" + + " },\n" + + " \"body\" : [ {\n" + + " \"_type\" : \"classInstance\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::f\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 4,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 4\n" + + " },\n" + + " \"type\" : \"rootGraphFetchTree\",\n" + + " \"value\" : {\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::f\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 4,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 4\n" + + " },\n" + + " \"subTrees\" : [ {\n" + + " \"_type\" : \"propertyGraphFetchTree\",\n" + + " \"sourceInformation\" : {\n" + + " \"sourceId\" : \"a::f\",\n" + + " \"startLine\" : 1,\n" + + " \"startColumn\" : 6,\n" + + " \"endLine\" : 1,\n" + + " \"endColumn\" : 9\n" + + " },\n" + + " \"_type\" : \"propertyGraphFetchTree\",\n" + + " \"property\" : \"name\"\n" + + " } ],\n" + + " \"_type\" : \"rootGraphFetchTree\",\n" + + " \"class\" : \"A\"\n" + + " }\n" + + " } ],\n" + + " \"package\" : \"a\"\n" + + " } ]\n" + + "}"); + } + + @Test + public void testListInstance() throws Exception + { + check("{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"listInstance\",\n" + + " \"sourceInformation\": {\n" + + " \"endColumn\": 4,\n" + + " \"endLine\": 1,\n" + + " \"sourceId\": \"a::a\",\n" + + " \"startColumn\": 2,\n" + + " \"startLine\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"name\": \"a\",\n" + + " \"package\": \"a\",\n" + + " \"parameters\": [],\n" + + " \"returnMultiplicity\": {\n" + " \"lowerBound\": 0\n" + " },\n" + " \"returnType\": \"String\"\n" + @@ -752,7 +806,12 @@ public void testListInstance() throws Exception " \"elements\" : [ {\n" + " \"_type\" : \"function\",\n" + " \"name\" : \"a\",\n" + - " \"returnType\" : \"String\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + " \"returnMultiplicity\" : {\n" + " \"lowerBound\" : 0\n" + " },\n" + @@ -806,7 +865,12 @@ public void testListInstance() throws Exception " \"elements\" : [ {\n" + " \"_type\" : \"function\",\n" + " \"name\" : \"a\",\n" + - " \"returnType\" : \"String\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + " \"returnMultiplicity\" : {\n" + " \"lowerBound\" : 0\n" + " },\n" + @@ -842,7 +906,12 @@ public void testListInstance() throws Exception " \"elements\" : [ {\n" + " \"_type\" : \"function\",\n" + " \"name\" : \"a\",\n" + - " \"returnType\" : \"String\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + " \"returnMultiplicity\" : {\n" + " \"lowerBound\" : 0\n" + " },\n" + @@ -919,7 +988,12 @@ public void checkEmptyStringBugFix() throws Exception " \"elements\" : [ {\n" + " \"_type\" : \"function\",\n" + " \"name\" : \"a\",\n" + - " \"returnType\" : \"String\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + " \"returnMultiplicity\" : {\n" + " \"lowerBound\" : 0\n" + " },\n" + @@ -950,7 +1024,7 @@ public void checkEmptyStringBugFix() throws Exception " } ],\n" + " \"package\" : \"a\"\n" + " } ]\n" + - "}"); + "}\n"); } @@ -1231,33 +1305,531 @@ public void testDataElementReference() throws Exception { check( "{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"dataElement\",\n" + - " \"data\": {\n" + - " \"_type\": \"reference\",\n" + - " \"dataElement\": \"com::path::exampleReference\"\n" + - " },\n" + - " \"name\": \"dataElementReferenceExample\",\n" + - " \"package\": \"my\"\n" + - " }\n" + - " ]\n" + - "}\n", - "{\n" + - " \"_type\": \"data\",\n" + - " \"elements\": [\n" + - " {\n" + - " \"_type\": \"dataElement\",\n" + - " \"data\": {\n" + - " \"_type\": \"reference\",\n" + - " \"dataElement\":{\"path\":\"com::path::exampleReference\",\"type\":\"DATA\"}" + - " },\n" + - " \"name\": \"dataElementReferenceExample\",\n" + - " \"package\": \"my\"\n" + - " }\n" + - " ]\n" + - "}\n"); + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"dataElement\",\n" + + " \"data\": {\n" + + " \"_type\": \"reference\",\n" + + " \"dataElement\": \"com::path::exampleReference\"\n" + + " },\n" + + " \"name\": \"dataElementReferenceExample\",\n" + + " \"package\": \"my\"\n" + + " }\n" + + " ]\n" + + "}\n", + "{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"dataElement\",\n" + + " \"data\": {\n" + + " \"_type\": \"reference\",\n" + + " \"dataElement\":{\"path\":\"com::path::exampleReference\",\"type\":\"DATA\"}" + + " },\n" + + " \"name\": \"dataElementReferenceExample\",\n" + + " \"package\": \"my\"\n" + + " }\n" + + " ]\n" + + "}\n"); + } + + @Test + public void testGenericTypeInstance() throws Exception + { + check( + "{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"cast\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 0\n" + + " },\n" + + " \"values\": []\n" + + " },\n" + + " {\n" + + " \"_type\": \"genericTypeInstance\",\n" + + " \"fullPath\": \"String\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"name\": \"f__String_$0_1$_\",\n" + + " \"package\": \"withPath\",\n" + + " \"parameters\": [],\n" + + " \"postConstraints\": [],\n" + + " \"preConstraints\": [],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"returnType\": \"String\",\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": []\n" + + " }\n" + + " ]\n" + + "}\n", + "{\n" + + " \"_type\" : \"data\",\n" + + " \"elements\" : [ {\n" + + " \"_type\" : \"function\",\n" + + " \"name\" : \"f__String_$0_1$_\",\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + + " \"returnMultiplicity\" : {\n" + + " \"lowerBound\" : 0,\n" + + " \"upperBound\" : 1\n" + + " },\n" + + " \"body\" : [ {\n" + + " \"_type\" : \"func\",\n" + + " \"function\" : \"cast\",\n" + + " \"parameters\" : [ {\n" + + " \"_type\" : \"collection\",\n" + + " \"multiplicity\" : {\n" + + " \"lowerBound\" : 0,\n" + + " \"upperBound\" : 0\n" + + " }\n" + + " }, {\n" + + " \"_type\" : \"genericTypeInstance\",\n" + + " \"genericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " }\n" + + " } ]\n" + + " } ],\n" + + " \"package\" : \"withPath\"\n" + + " } ]\n" + + "}"); + } + + @Test + public void testVariable() throws Exception + { + check("{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 0\n" + + " },\n" + + " \"values\": []\n" + + " }\n" + + " ],\n" + + " \"name\": \"f_Type_1__String_$0_1$_\",\n" + + " \"package\": \"withPath\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"var\",\n" + + " \"class\": \"a::Type\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"name\": \"s\"\n" + + " }\n" + + " ],\n" + + " \"postConstraints\": [],\n" + + " \"preConstraints\": [],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"returnType\": \"String\",\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": []\n" + + " },\n" + + " {\n" + + " \"_type\": \"sectionIndex\",\n" + + " \"name\": \"SectionIndex\",\n" + + " \"package\": \"__internal__\",\n" + + " \"sections\": [\n" + + " {\n" + + " \"_type\": \"importAware\",\n" + + " \"elements\": [\n" + + " \"withPath::f_Type_1__String_$0_1$_\"\n" + + " ],\n" + + " \"imports\": [],\n" + + " \"parserName\": \"Pure\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + "}\n", + "{\n" + + " \"_type\" : \"data\",\n" + + " \"elements\" : [ {\n" + + " \"_type\" : \"function\",\n" + + " \"name\" : \"f_Type_1__String_$0_1$_\",\n" + + " \"parameters\" : [ {\n" + + " \"_type\" : \"var\",\n" + + " \"name\" : \"s\",\n" + + " \"genericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"a::Type\"\n" + + " }\n" + + " },\n" + + " \"multiplicity\" : {\n" + + " \"lowerBound\" : 1,\n" + + " \"upperBound\" : 1\n" + + " }\n" + + " } ],\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " },\n" + + " \"returnMultiplicity\" : {\n" + + " \"lowerBound\" : 0,\n" + + " \"upperBound\" : 1\n" + + " },\n" + + " \"body\" : [ {\n" + + " \"_type\" : \"collection\",\n" + + " \"multiplicity\" : {\n" + + " \"lowerBound\" : 0,\n" + + " \"upperBound\" : 0\n" + + " }\n" + + " } ],\n" + + " \"package\" : \"withPath\"\n" + + " }, {\n" + + " \"_type\" : \"sectionIndex\",\n" + + " \"name\" : \"SectionIndex\",\n" + + " \"sections\" : [ {\n" + + " \"_type\" : \"importAware\",\n" + + " \"parserName\" : \"Pure\",\n" + + " \"elements\" : [ \"withPath::f_Type_1__String_$0_1$_\" ]\n" + + " } ],\n" + + " \"package\" : \"__internal__\"\n" + + " } ]\n" + + "}"); + } + + @Test + public void testClass() throws Exception + { + check("{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"class\",\n" + + " \"constraints\": [],\n" + + " \"name\": \"Class\",\n" + + " \"originalMilestonedProperties\": [],\n" + + " \"package\": \"my\",\n" + + " \"properties\": [\n" + + " {\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"name\": \"prop1\",\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": [],\n" + + " \"type\": \"Result\"\n" + + " }\n" + + " ],\n" + + " \"qualifiedProperties\": [\n" + + " {\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 0\n" + + " },\n" + + " \"values\": []\n" + + " }\n" + + " ],\n" + + " \"name\": \"prop2\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"var\",\n" + + " \"genericType\": {\n" + + " \"multiplicityArguments\": [],\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"String\"\n" + + " },\n" + + " \"typeArguments\": [],\n" + + " \"typeVariableValues\": []\n" + + " },\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"name\": \"val\"\n" + + " }\n" + + " ],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"returnType\": \"Result\",\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": []\n" + + " }\n" + + " ],\n" + + " \"stereotypes\": [],\n" + + " \"superTypes\": [],\n" + + " \"taggedValues\": []\n" + + " },\n" + + " {\n" + + " \"_type\": \"sectionIndex\",\n" + + " \"name\": \"SectionIndex\",\n" + + " \"package\": \"__internal__\",\n" + + " \"sections\": [\n" + + " {\n" + + " \"_type\": \"importAware\",\n" + + " \"elements\": [\n" + + " \"my::Class\"\n" + + " ],\n" + + " \"imports\": [],\n" + + " \"parserName\": \"Pure\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + "}\n", + "{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"class\",\n" + + " \"name\": \"Class\",\n" + + " \"properties\": [\n" + + " {\n" + + " \"name\": \"prop1\",\n" + + " \"genericType\": {\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"Result\"\n" + + " }\n" + + " },\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"qualifiedProperties\": [\n" + + " {\n" + + " \"name\": \"prop2\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"var\",\n" + + " \"name\": \"val\",\n" + + " \"genericType\": {\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"String\"\n" + + " }\n" + + " },\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"returnGenericType\": {\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"Result\"\n" + + " }\n" + + " },\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 0\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"package\": \"my\"\n" + + " },\n" + + " {\n" + + " \"_type\": \"sectionIndex\",\n" + + " \"name\": \"SectionIndex\",\n" + + " \"sections\": [\n" + + " {\n" + + " \"_type\": \"importAware\",\n" + + " \"parserName\": \"Pure\",\n" + + " \"elements\": [\n" + + " \"my::Class\"\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"package\": \"__internal__\"\n" + + " }\n" + + " ]\n" + + "}"); + } + + @Test + public void testFunction() throws Exception + { + check("{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 0\n" + + " },\n" + + " \"values\": []\n" + + " }\n" + + " ],\n" + + " \"name\": \"f_Result_1__Result_$0_1$_\",\n" + + " \"package\": \"\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"var\",\n" + + " \"genericType\": {\n" + + " \"multiplicityArguments\": [\n" + + " {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " }\n" + + " ],\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"Result\"\n" + + " },\n" + + " \"typeArguments\": [\n" + + " {\n" + + " \"multiplicityArguments\": [],\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"String\"\n" + + " },\n" + + " \"typeArguments\": [],\n" + + " \"typeVariableValues\": []\n" + + " }\n" + + " ],\n" + + " \"typeVariableValues\": []\n" + + " },\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"name\": \"x\"\n" + + " }\n" + + " ],\n" + + " \"postConstraints\": [],\n" + + " \"preConstraints\": [],\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 0,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"returnType\": \"Result\",\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": []\n" + + " },\n" + + " {\n" + + " \"_type\": \"sectionIndex\",\n" + + " \"name\": \"SectionIndex\",\n" + + " \"package\": \"__internal__\",\n" + + " \"sections\": [\n" + + " {\n" + + " \"_type\": \"importAware\",\n" + + " \"elements\": [\n" + + " \"f_Result_1__Result_$0_1$_\"\n" + + " ],\n" + + " \"imports\": [],\n" + + " \"parserName\": \"Pure\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + "}\n", + "{\n" + + " \"_type\" : \"data\",\n" + + " \"elements\" : [ {\n" + + " \"_type\" : \"function\",\n" + + " \"name\" : \"f_Result_1__Result_$0_1$_\",\n" + + " \"parameters\" : [ {\n" + + " \"_type\" : \"var\",\n" + + " \"name\" : \"x\",\n" + + " \"genericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"Result\"\n" + + " },\n" + + " \"typeArguments\" : [ {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"String\"\n" + + " }\n" + + " } ],\n" + + " \"multiplicityArguments\" : [ {\n" + + " \"lowerBound\" : 1,\n" + + " \"upperBound\" : 1\n" + + " } ]\n" + + " },\n" + + " \"multiplicity\" : {\n" + + " \"lowerBound\" : 1,\n" + + " \"upperBound\" : 1\n" + + " }\n" + + " } ],\n" + + " \"returnGenericType\" : {\n" + + " \"rawType\" : {\n" + + " \"_type\" : \"packageableType\",\n" + + " \"fullPath\" : \"Result\"\n" + + " }\n" + + " },\n" + + " \"returnMultiplicity\" : {\n" + + " \"lowerBound\" : 0,\n" + + " \"upperBound\" : 1\n" + + " },\n" + + " \"body\" : [ {\n" + + " \"_type\" : \"collection\",\n" + + " \"multiplicity\" : {\n" + + " \"lowerBound\" : 0,\n" + + " \"upperBound\" : 0\n" + + " }\n" + + " } ]\n" + + " }, {\n" + + " \"_type\" : \"sectionIndex\",\n" + + " \"name\" : \"SectionIndex\",\n" + + " \"sections\" : [ {\n" + + " \"_type\" : \"importAware\",\n" + + " \"parserName\" : \"Pure\",\n" + + " \"elements\" : [ \"f_Result_1__Result_$0_1$_\" ]\n" + + " } ],\n" + + " \"package\" : \"__internal__\"\n" + + " } ]\n" + + "}"); } @Test @@ -1266,7 +1838,7 @@ public void testStoreTestData() throws Exception check( new Scanner(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("simpleFunctionBefore.json"), "Can't find resource '" + "simpleFunctionBefore.json" + "'"), "UTF-8").useDelimiter("\\A").next(), new Scanner(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("simpleFunctionAfter.json"), "Can't find resource '" + "simpleFunctionAfter.json" + "'"), "UTF-8").useDelimiter("\\A").next() - ); + ); } @Test diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/resources/simpleFunctionAfter.json b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/resources/simpleFunctionAfter.json index f3c2e04c879..9e97cbce98d 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/resources/simpleFunctionAfter.json +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol-pure/src/test/resources/simpleFunctionAfter.json @@ -1,1317 +1,1238 @@ { - "_type": "data", - "elements": [ - { - "_type": "Enumeration", - "name": "EmployeeType", - "package": "model", - "sourceInformation": { - "endColumn": 1, - "endLine": 6, - "startColumn": 1, - "startLine": 2 + "_type" : "data", + "elements" : [ { + "_type" : "Enumeration", + "name" : "EmployeeType", + "sourceInformation" : { + "startLine" : 2, + "startColumn" : 1, + "endLine" : 6, + "endColumn" : 1 + }, + "values" : [ { + "value" : "CONTRACT", + "sourceInformation" : { + "startLine" : 4, + "startColumn" : 3, + "endLine" : 4, + "endColumn" : 10 + } + }, { + "value" : "FULL_TIME", + "sourceInformation" : { + "startLine" : 5, + "startColumn" : 3, + "endLine" : 5, + "endColumn" : 11 + } + } ], + "package" : "model" + }, { + "_type" : "class", + "name" : "Person", + "sourceInformation" : { + "startLine" : 8, + "startColumn" : 1, + "endLine" : 13, + "endColumn" : 1 + }, + "properties" : [ { + "name" : "firstName", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "sourceInformation" : { + "startLine" : 10, + "startColumn" : 14, + "endLine" : 10, + "endColumn" : 19 + }, + "fullPath" : "String" + } }, - "values": [ - { - "sourceInformation": { - "endColumn": 10, - "endLine": 4, - "startColumn": 3, - "startLine": 4 + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + }, + "sourceInformation" : { + "startLine" : 10, + "startColumn" : 3, + "endLine" : 10, + "endColumn" : 23 + } + }, { + "name" : "lastName", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "sourceInformation" : { + "startLine" : 11, + "startColumn" : 13, + "endLine" : 11, + "endColumn" : 18 }, - "value": "CONTRACT" - }, - { - "sourceInformation": { - "endColumn": 11, - "endLine": 5, - "startColumn": 3, - "startLine": 5 + "fullPath" : "String" + } + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + }, + "sourceInformation" : { + "startLine" : 11, + "startColumn" : 3, + "endLine" : 11, + "endColumn" : 22 + } + }, { + "name" : "employeeType", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "sourceInformation" : { + "startLine" : 12, + "startColumn" : 17, + "endLine" : 12, + "endColumn" : 35 }, - "value": "FULL_TIME" + "fullPath" : "model::EmployeeType" } - ] + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + }, + "sourceInformation" : { + "startLine" : 12, + "startColumn" : 3, + "endLine" : 12, + "endColumn" : 39 + } + } ], + "package" : "model" + }, { + "_type" : "class", + "name" : "Firm", + "sourceInformation" : { + "startLine" : 15, + "startColumn" : 1, + "endLine" : 19, + "endColumn" : 1 }, - { - "_type": "class", - "name": "Person", - "package": "model", - "properties": [ - { - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "firstName", - "propertyTypeSourceInformation": { - "endColumn": 19, - "endLine": 10, - "startColumn": 14, - "startLine": 10 - }, - "sourceInformation": { - "endColumn": 23, - "endLine": 10, - "startColumn": 3, - "startLine": 10 + "properties" : [ { + "name" : "legalName", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "sourceInformation" : { + "startLine" : 17, + "startColumn" : 14, + "endLine" : 17, + "endColumn" : 19 }, - "type": "String" - }, - { - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "lastName", - "propertyTypeSourceInformation": { - "endColumn": 18, - "endLine": 11, - "startColumn": 13, - "startLine": 11 - }, - "sourceInformation": { - "endColumn": 22, - "endLine": 11, - "startColumn": 3, - "startLine": 11 - }, - "type": "String" - }, - { - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "employeeType", - "propertyTypeSourceInformation": { - "endColumn": 35, - "endLine": 12, - "startColumn": 17, - "startLine": 12 - }, - "sourceInformation": { - "endColumn": 39, - "endLine": 12, - "startColumn": 3, - "startLine": 12 + "fullPath" : "String" + } + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + }, + "sourceInformation" : { + "startLine" : 17, + "startColumn" : 3, + "endLine" : 17, + "endColumn" : 23 + } + }, { + "name" : "employees", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "sourceInformation" : { + "startLine" : 18, + "startColumn" : 14, + "endLine" : 18, + "endColumn" : 26 }, - "type": "model::EmployeeType" + "fullPath" : "model::Person" } - ], - "sourceInformation": { - "endColumn": 1, - "endLine": 13, - "startColumn": 1, - "startLine": 8 + }, + "multiplicity" : { + "lowerBound" : 0 + }, + "sourceInformation" : { + "startLine" : 18, + "startColumn" : 3, + "endLine" : 18, + "endColumn" : 30 } + } ], + "package" : "model" + }, { + "_type" : "function", + "name" : "PersonQuery__TabularDataSet_1_", + "sourceInformation" : { + "startLine" : 21, + "startColumn" : 1, + "endLine" : 24, + "endColumn" : 1 }, - { - "_type": "class", - "name": "Firm", - "package": "model", - "properties": [ - { - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "legalName", - "propertyTypeSourceInformation": { - "endColumn": 19, - "endLine": 17, - "startColumn": 14, - "startLine": 17 - }, - "sourceInformation": { - "endColumn": 23, - "endLine": 17, - "startColumn": 3, - "startLine": 17 - }, - "type": "String" + "returnGenericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "meta::pure::tds::TabularDataSet" + } + }, + "returnMultiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + }, + "body" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 131, + "endLine" : 23, + "endColumn" : 134 + }, + "function" : "from", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 24, + "endLine" : 23, + "endColumn" : 30 }, - { - "multiplicity": { - "lowerBound": 0 + "function" : "project", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 16, + "endLine" : 23, + "endColumn" : 21 }, - "name": "employees", - "propertyTypeSourceInformation": { - "endColumn": 26, - "endLine": 18, - "startColumn": 14, - "startLine": 18 + "function" : "getAll", + "parameters" : [ { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 3, + "endLine" : 23, + "endColumn" : 15 + }, + "fullPath" : "model::Person" + } ] + }, { + "_type" : "collection", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 32, + "endLine" : 23, + "endColumn" : 98 }, - "sourceInformation": { - "endColumn": 30, - "endLine": 18, - "startColumn": 3, - "startLine": 18 + "multiplicity" : { + "lowerBound" : 2, + "upperBound" : 2 }, - "type": "model::Person" - } - ], - "sourceInformation": { - "endColumn": 1, - "endLine": 19, - "startColumn": 1, - "startLine": 15 - } - }, - { - "_type": "function", - "body": [ - { - "_type": "func", - "function": "from", - "parameters": [ - { - "_type": "func", - "function": "project", - "parameters": [ - { - "_type": "func", - "function": "getAll", - "parameters": [ - { - "_type": "packageableElementPtr", - "fullPath": "model::Person", - "sourceInformation": { - "endColumn": 15, - "endLine": 23, - "startColumn": 3, - "startLine": 23 - } - } - ], - "sourceInformation": { - "endColumn": 21, - "endLine": 23, - "startColumn": 16, - "startLine": 23 - } - }, - { - "_type": "collection", - "multiplicity": { - "lowerBound": 2, - "upperBound": 2 - }, - "sourceInformation": { - "endColumn": 98, - "endLine": 23, - "startColumn": 32, - "startLine": 23 - }, - "values": [ - { - "_type": "lambda", - "body": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 54, - "endLine": 23, - "startColumn": 53, - "startLine": 23 - } - } - ], - "property": "firstName", - "sourceInformation": { - "endColumn": 64, - "endLine": 23, - "startColumn": 56, - "startLine": 23 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 48, - "endLine": 23, - "startColumn": 36, - "startLine": 23 - } - } - ], - "sourceInformation": { - "endColumn": 64, - "endLine": 23, - "startColumn": 52, - "startLine": 23 - } - }, - { - "_type": "lambda", - "body": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 88, - "endLine": 23, - "startColumn": 87, - "startLine": 23 - } - } - ], - "property": "lastName", - "sourceInformation": { - "endColumn": 97, - "endLine": 23, - "startColumn": 90, - "startLine": 23 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 82, - "endLine": 23, - "startColumn": 70, - "startLine": 23 - } - } - ], - "sourceInformation": { - "endColumn": 97, - "endLine": 23, - "startColumn": 86, - "startLine": 23 - } - } - ] + "values" : [ { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 52, + "endLine" : 23, + "endColumn" : 64 + }, + "body" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 56, + "endLine" : 23, + "endColumn" : 64 + }, + "property" : "firstName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 53, + "endLine" : 23, + "endColumn" : 54 }, - { - "_type": "collection", - "multiplicity": { - "lowerBound": 2, - "upperBound": 2 - }, - "sourceInformation": { - "endColumn": 127, - "endLine": 23, - "startColumn": 101, - "startLine": 23 - }, - "values": [ - { - "_type": "string", - "sourceInformation": { - "endColumn": 113, - "endLine": 23, - "startColumn": 102, - "startLine": 23 - }, - "value": "First Name" - }, - { - "_type": "string", - "sourceInformation": { - "endColumn": 126, - "endLine": 23, - "startColumn": 116, - "startLine": 23 - }, - "value": "Last Name" - } - ] + "name" : "x" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 36, + "endLine" : 23, + "endColumn" : 48 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" } - ], - "sourceInformation": { - "endColumn": 30, - "endLine": 23, - "startColumn": 24, - "startLine": 23 + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } + } ] + }, { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 86, + "endLine" : 23, + "endColumn" : 97 }, - { - "_type": "packageableElementPtr", - "fullPath": "execution::RelationalMapping", - "sourceInformation": { - "endColumn": 163, - "endLine": 23, - "startColumn": 136, - "startLine": 23 + "body" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 90, + "endLine" : 23, + "endColumn" : 97 + }, + "property" : "lastName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 87, + "endLine" : 23, + "endColumn" : 88 + }, + "name" : "x" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 70, + "endLine" : 23, + "endColumn" : 82 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" + } + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } + } ] + } ] + }, { + "_type" : "collection", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 101, + "endLine" : 23, + "endColumn" : 127 + }, + "multiplicity" : { + "lowerBound" : 2, + "upperBound" : 2 + }, + "values" : [ { + "_type" : "string", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 102, + "endLine" : 23, + "endColumn" : 113 }, - { - "_type": "packageableElementPtr", - "fullPath": "execution::Runtime", - "sourceInformation": { - "endColumn": 183, - "endLine": 23, - "startColumn": 166, - "startLine": 23 - } - } - ], - "sourceInformation": { - "endColumn": 134, - "endLine": 23, - "startColumn": 131, - "startLine": 23 - } + "value" : "First Name" + }, { + "_type" : "string", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 116, + "endLine" : 23, + "endColumn" : 126 + }, + "value" : "Last Name" + } ] + } ] + }, { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 136, + "endLine" : 23, + "endColumn" : 163 + }, + "fullPath" : "execution::RelationalMapping" + }, { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 23, + "startColumn" : 166, + "endLine" : 23, + "endColumn" : 183 + }, + "fullPath" : "execution::Runtime" + } ] + } ], + "package" : "model" + }, { + "_type" : "function", + "name" : "PersonWithParams_String_1__TabularDataSet_1_", + "sourceInformation" : { + "startLine" : 26, + "startColumn" : 1, + "endLine" : 44, + "endColumn" : 1 + }, + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 26, + "startColumn" : 34, + "endLine" : 26, + "endColumn" : 53 + }, + "name" : "firstName", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "String" } - ], - "name": "PersonQuery__TabularDataSet_1_", - "package": "model", - "returnMultiplicity": { - "lowerBound": 1, - "upperBound": 1 }, - "returnType": "meta::pure::tds::TabularDataSet", - "sourceInformation": { - "endColumn": 1, - "endLine": 24, - "startColumn": 1, - "startLine": 21 + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + } + } ], + "returnGenericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "meta::pure::tds::TabularDataSet" } }, - { - "_type": "function", - "body": [ - { - "_type": "func", - "function": "from", - "parameters": [ - { - "_type": "func", - "function": "project", - "parameters": [ - { - "_type": "func", - "function": "filter", - "parameters": [ - { - "_type": "func", - "function": "getAll", - "parameters": [ - { - "_type": "packageableElementPtr", - "fullPath": "model::Person", - "sourceInformation": { - "endColumn": 15, - "endLine": 28, - "startColumn": 3, - "startLine": 28 - } - } - ], - "sourceInformation": { - "endColumn": 21, - "endLine": 28, - "startColumn": 16, - "startLine": 28 - } - }, - { - "_type": "lambda", - "body": [ - { - "_type": "func", - "function": "equal", - "parameters": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 52, - "endLine": 28, - "startColumn": 51, - "startLine": 28 - } - } - ], - "property": "firstName", - "sourceInformation": { - "endColumn": 62, - "endLine": 28, - "startColumn": 54, - "startLine": 28 - } - }, - { - "_type": "var", - "name": "firstName", - "sourceInformation": { - "endColumn": 76, - "endLine": 28, - "startColumn": 67, - "startLine": 28 - } - } - ], - "sourceInformation": { - "endColumn": 65, - "endLine": 28, - "startColumn": 64, - "startLine": 28 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 46, - "endLine": 28, - "startColumn": 34, - "startLine": 28 - } - } - ], - "sourceInformation": { - "endColumn": 76, - "endLine": 28, - "startColumn": 50, - "startLine": 28 - } - } - ], - "sourceInformation": { - "endColumn": 29, - "endLine": 28, - "startColumn": 24, - "startLine": 28 - } + "returnMultiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + }, + "body" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 187, + "endLine" : 28, + "endColumn" : 190 + }, + "function" : "from", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 80, + "endLine" : 28, + "endColumn" : 86 + }, + "function" : "project", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 24, + "endLine" : 28, + "endColumn" : 29 + }, + "function" : "filter", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 16, + "endLine" : 28, + "endColumn" : 21 + }, + "function" : "getAll", + "parameters" : [ { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 3, + "endLine" : 28, + "endColumn" : 15 + }, + "fullPath" : "model::Person" + } ] + }, { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 50, + "endLine" : 28, + "endColumn" : 76 + }, + "body" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 64, + "endLine" : 28, + "endColumn" : 65 + }, + "function" : "equal", + "parameters" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 54, + "endLine" : 28, + "endColumn" : 62 }, - { - "_type": "collection", - "multiplicity": { - "lowerBound": 2, - "upperBound": 2 + "property" : "firstName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 51, + "endLine" : 28, + "endColumn" : 52 }, - "sourceInformation": { - "endColumn": 154, - "endLine": 28, - "startColumn": 88, - "startLine": 28 - }, - "values": [ - { - "_type": "lambda", - "body": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 110, - "endLine": 28, - "startColumn": 109, - "startLine": 28 - } - } - ], - "property": "firstName", - "sourceInformation": { - "endColumn": 120, - "endLine": 28, - "startColumn": 112, - "startLine": 28 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 104, - "endLine": 28, - "startColumn": 92, - "startLine": 28 - } - } - ], - "sourceInformation": { - "endColumn": 120, - "endLine": 28, - "startColumn": 108, - "startLine": 28 - } - }, - { - "_type": "lambda", - "body": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 144, - "endLine": 28, - "startColumn": 143, - "startLine": 28 - } - } - ], - "property": "lastName", - "sourceInformation": { - "endColumn": 153, - "endLine": 28, - "startColumn": 146, - "startLine": 28 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 138, - "endLine": 28, - "startColumn": 126, - "startLine": 28 - } - } - ], - "sourceInformation": { - "endColumn": 153, - "endLine": 28, - "startColumn": 142, - "startLine": 28 - } - } - ] + "name" : "x" + } ] + }, { + "_type" : "var", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 67, + "endLine" : 28, + "endColumn" : 76 }, - { - "_type": "collection", - "multiplicity": { - "lowerBound": 2, - "upperBound": 2 - }, - "sourceInformation": { - "endColumn": 183, - "endLine": 28, - "startColumn": 157, - "startLine": 28 - }, - "values": [ - { - "_type": "string", - "sourceInformation": { - "endColumn": 169, - "endLine": 28, - "startColumn": 158, - "startLine": 28 - }, - "value": "First Name" - }, - { - "_type": "string", - "sourceInformation": { - "endColumn": 182, - "endLine": 28, - "startColumn": 172, - "startLine": 28 - }, - "value": "Last Name" - } - ] + "name" : "firstName" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 34, + "endLine" : 28, + "endColumn" : 46 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" } - ], - "sourceInformation": { - "endColumn": 86, - "endLine": 28, - "startColumn": 80, - "startLine": 28 + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } + } ] + } ] + }, { + "_type" : "collection", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 88, + "endLine" : 28, + "endColumn" : 154 + }, + "multiplicity" : { + "lowerBound" : 2, + "upperBound" : 2 + }, + "values" : [ { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 108, + "endLine" : 28, + "endColumn" : 120 }, - { - "_type": "packageableElementPtr", - "fullPath": "execution::RelationalMapping", - "sourceInformation": { - "endColumn": 219, - "endLine": 28, - "startColumn": 192, - "startLine": 28 + "body" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 112, + "endLine" : 28, + "endColumn" : 120 + }, + "property" : "firstName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 109, + "endLine" : 28, + "endColumn" : 110 + }, + "name" : "x" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 92, + "endLine" : 28, + "endColumn" : 104 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" + } + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } + } ] + }, { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 142, + "endLine" : 28, + "endColumn" : 153 }, - { - "_type": "packageableElementPtr", - "fullPath": "execution::Runtime", - "sourceInformation": { - "endColumn": 239, - "endLine": 28, - "startColumn": 222, - "startLine": 28 + "body" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 146, + "endLine" : 28, + "endColumn" : 153 + }, + "property" : "lastName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 143, + "endLine" : 28, + "endColumn" : 144 + }, + "name" : "x" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 126, + "endLine" : 28, + "endColumn" : 138 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" + } + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } - } - ], - "sourceInformation": { - "endColumn": 190, - "endLine": 28, - "startColumn": 187, - "startLine": 28 + } ] + } ] + }, { + "_type" : "collection", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 157, + "endLine" : 28, + "endColumn" : 183 + }, + "multiplicity" : { + "lowerBound" : 2, + "upperBound" : 2 + }, + "values" : [ { + "_type" : "string", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 158, + "endLine" : 28, + "endColumn" : 169 + }, + "value" : "First Name" + }, { + "_type" : "string", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 172, + "endLine" : 28, + "endColumn" : 182 + }, + "value" : "Last Name" + } ] + } ] + }, { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 192, + "endLine" : 28, + "endColumn" : 219 + }, + "fullPath" : "execution::RelationalMapping" + }, { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 28, + "startColumn" : 222, + "endLine" : 28, + "endColumn" : 239 + }, + "fullPath" : "execution::Runtime" + } ] + } ], + "tests" : [ { + "_type" : "functionTestSuite", + "id" : "testSuite_1", + "sourceInformation" : { + "startLine" : 31, + "startColumn" : 3, + "endLine" : 43, + "endColumn" : 3 + }, + "tests" : [ { + "_type" : "functionTest", + "id" : "testPass", + "sourceInformation" : { + "startLine" : 42, + "startColumn" : 5, + "endLine" : 42, + "endColumn" : 109 + }, + "assertions" : [ { + "_type" : "equalToJson", + "id" : "default", + "sourceInformation" : { + "startLine" : 42, + "startColumn" : 46, + "endLine" : 42, + "endColumn" : 108 + }, + "expected" : { + "_type" : "externalFormat", + "sourceInformation" : { + "startLine" : 42, + "startColumn" : 46, + "endLine" : 42, + "endColumn" : 108 + }, + "contentType" : "application/json", + "data" : "[{\n \"First Name\" : \"Nicole\",\"Last Name\" : \"Smith\"} ]" } - } - ], - "name": "PersonWithParams_String_1__TabularDataSet_1_", - "package": "model", - "parameters": [ - { - "_type": "var", - "class": "String", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 + } ], + "parameters" : [ { + "sourceInformation" : { + "startLine" : 42, + "startColumn" : 33, + "endLine" : 42, + "endColumn" : 40 }, - "name": "firstName", - "sourceInformation": { - "endColumn": 53, - "endLine": 26, - "startColumn": 34, - "startLine": 26 + "name" : "firstName", + "value" : { + "_type" : "string", + "sourceInformation" : { + "startLine" : 42, + "startColumn" : 33, + "endLine" : 42, + "endColumn" : 40 + }, + "value" : "Nicole" + } + } ] + } ], + "testData" : [ { + "store" : { + "type" : "STORE", + "path" : "store::TestDB" + }, + "data" : { + "_type" : "reference", + "dataElement" : { + "type" : "DATA", + "path" : "test::other" } } - ], - "returnMultiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "returnType": "meta::pure::tds::TabularDataSet", - "sourceInformation": { - "endColumn": 1, - "endLine": 44, - "startColumn": 1, - "startLine": 26 + } ] + } ], + "package" : "model" + }, { + "_type" : "function", + "name" : "PersonQuerySharedData__TabularDataSet_1_", + "sourceInformation" : { + "startLine" : 46, + "startColumn" : 1, + "endLine" : 49, + "endColumn" : 1 + }, + "returnGenericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "meta::pure::tds::TabularDataSet" + } + }, + "returnMultiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + }, + "body" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 131, + "endLine" : 48, + "endColumn" : 134 }, - "tests": [ - { - "_type": "functionTestSuite", - "id": "testSuite_1", - "sourceInformation": { - "endColumn": 3, - "endLine": 43, - "startColumn": 3, - "startLine": 31 + "function" : "from", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 24, + "endLine" : 48, + "endColumn" : 30 + }, + "function" : "project", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 16, + "endLine" : 48, + "endColumn" : 21 }, - "testData": [ - { - "data": { - "_type": "reference", - "dataElement": { - "path": "test::other", - "type": "DATA" - } + "function" : "getAll", + "parameters" : [ { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 3, + "endLine" : 48, + "endColumn" : 15 + }, + "fullPath" : "model::Person" + } ] + }, { + "_type" : "collection", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 32, + "endLine" : 48, + "endColumn" : 98 + }, + "multiplicity" : { + "lowerBound" : 2, + "upperBound" : 2 + }, + "values" : [ { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 52, + "endLine" : 48, + "endColumn" : 64 + }, + "body" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 56, + "endLine" : 48, + "endColumn" : 64 }, - "store": { - "path":"store::TestDB", - "type": "STORE" - } - } - ], - "tests": [ - { - "_type": "functionTest", - "assertions": [ - { - "_type": "equalToJson", - "expected": { - "_type": "externalFormat", - "contentType": "application/json", - "data": "[{\n \"First Name\" : \"Nicole\",\"Last Name\" : \"Smith\"} ]", - "sourceInformation": { - "endColumn": 108, - "endLine": 42, - "startColumn": 46, - "startLine": 42 - } - }, - "id": "default", - "sourceInformation": { - "endColumn": 108, - "endLine": 42, - "startColumn": 46, - "startLine": 42 - } - } - ], - "id": "testPass", - "parameters": [ - { - "name": "firstName", - "sourceInformation": { - "endColumn": 40, - "endLine": 42, - "startColumn": 33, - "startLine": 42 - }, - "value": { - "_type": "string", - "sourceInformation": { - "endColumn": 40, - "endLine": 42, - "startColumn": 33, - "startLine": 42 - }, - "value": "Nicole" - } + "property" : "firstName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 53, + "endLine" : 48, + "endColumn" : 54 + }, + "name" : "x" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 36, + "endLine" : 48, + "endColumn" : 48 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" } - ], - "sourceInformation": { - "endColumn": 109, - "endLine": 42, - "startColumn": 5, - "startLine": 42 + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } - } - ] - } - ] - }, - { - "_type": "function", - "body": [ - { - "_type": "func", - "function": "from", - "parameters": [ - { - "_type": "func", - "function": "project", - "parameters": [ - { - "_type": "func", - "function": "getAll", - "parameters": [ - { - "_type": "packageableElementPtr", - "fullPath": "model::Person", - "sourceInformation": { - "endColumn": 15, - "endLine": 48, - "startColumn": 3, - "startLine": 48 - } - } - ], - "sourceInformation": { - "endColumn": 21, - "endLine": 48, - "startColumn": 16, - "startLine": 48 - } - }, - { - "_type": "collection", - "multiplicity": { - "lowerBound": 2, - "upperBound": 2 - }, - "sourceInformation": { - "endColumn": 98, - "endLine": 48, - "startColumn": 32, - "startLine": 48 - }, - "values": [ - { - "_type": "lambda", - "body": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 54, - "endLine": 48, - "startColumn": 53, - "startLine": 48 - } - } - ], - "property": "firstName", - "sourceInformation": { - "endColumn": 64, - "endLine": 48, - "startColumn": 56, - "startLine": 48 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 48, - "endLine": 48, - "startColumn": 36, - "startLine": 48 - } - } - ], - "sourceInformation": { - "endColumn": 64, - "endLine": 48, - "startColumn": 52, - "startLine": 48 - } - }, - { - "_type": "lambda", - "body": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 88, - "endLine": 48, - "startColumn": 87, - "startLine": 48 - } - } - ], - "property": "lastName", - "sourceInformation": { - "endColumn": 97, - "endLine": 48, - "startColumn": 90, - "startLine": 48 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 82, - "endLine": 48, - "startColumn": 70, - "startLine": 48 - } - } - ], - "sourceInformation": { - "endColumn": 97, - "endLine": 48, - "startColumn": 86, - "startLine": 48 - } - } - ] + } ] + }, { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 86, + "endLine" : 48, + "endColumn" : 97 + }, + "body" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 90, + "endLine" : 48, + "endColumn" : 97 + }, + "property" : "lastName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 87, + "endLine" : 48, + "endColumn" : 88 }, - { - "_type": "collection", - "multiplicity": { - "lowerBound": 2, - "upperBound": 2 - }, - "sourceInformation": { - "endColumn": 127, - "endLine": 48, - "startColumn": 101, - "startLine": 48 - }, - "values": [ - { - "_type": "string", - "sourceInformation": { - "endColumn": 113, - "endLine": 48, - "startColumn": 102, - "startLine": 48 - }, - "value": "First Name" - }, - { - "_type": "string", - "sourceInformation": { - "endColumn": 126, - "endLine": 48, - "startColumn": 116, - "startLine": 48 - }, - "value": "Last Name" - } - ] + "name" : "x" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 70, + "endLine" : 48, + "endColumn" : 82 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" } - ], - "sourceInformation": { - "endColumn": 30, - "endLine": 48, - "startColumn": 24, - "startLine": 48 + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } + } ] + } ] + }, { + "_type" : "collection", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 101, + "endLine" : 48, + "endColumn" : 127 + }, + "multiplicity" : { + "lowerBound" : 2, + "upperBound" : 2 + }, + "values" : [ { + "_type" : "string", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 102, + "endLine" : 48, + "endColumn" : 113 }, - { - "_type": "packageableElementPtr", - "fullPath": "execution::RelationalMapping", - "sourceInformation": { - "endColumn": 163, - "endLine": 48, - "startColumn": 136, - "startLine": 48 - } + "value" : "First Name" + }, { + "_type" : "string", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 116, + "endLine" : 48, + "endColumn" : 126 }, - { - "_type": "packageableElementPtr", - "fullPath": "execution::Runtime", - "sourceInformation": { - "endColumn": 183, - "endLine": 48, - "startColumn": 166, - "startLine": 48 - } - } - ], - "sourceInformation": { - "endColumn": 134, - "endLine": 48, - "startColumn": 131, - "startLine": 48 - } - } - ], - "name": "PersonQuerySharedData__TabularDataSet_1_", - "package": "model", - "returnMultiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "returnType": "meta::pure::tds::TabularDataSet", - "sourceInformation": { - "endColumn": 1, - "endLine": 49, - "startColumn": 1, - "startLine": 46 + "value" : "Last Name" + } ] + } ] + }, { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 136, + "endLine" : 48, + "endColumn" : 163 + }, + "fullPath" : "execution::RelationalMapping" + }, { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 48, + "startColumn" : 166, + "endLine" : 48, + "endColumn" : 183 + }, + "fullPath" : "execution::Runtime" + } ] + } ], + "package" : "model" + }, { + "_type" : "function", + "name" : "PersonWithConnectionStores__TabularDataSet_1_", + "sourceInformation" : { + "startLine" : 51, + "startColumn" : 1, + "endLine" : 54, + "endColumn" : 1 + }, + "returnGenericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "meta::pure::tds::TabularDataSet" } }, - { - "_type": "function", - "body": [ - { - "_type": "func", - "function": "from", - "parameters": [ - { - "_type": "func", - "function": "project", - "parameters": [ - { - "_type": "func", - "function": "getAll", - "parameters": [ - { - "_type": "packageableElementPtr", - "fullPath": "model::Person", - "sourceInformation": { - "endColumn": 15, - "endLine": 53, - "startColumn": 3, - "startLine": 53 - } - } - ], - "sourceInformation": { - "endColumn": 21, - "endLine": 53, - "startColumn": 16, - "startLine": 53 - } - }, - { - "_type": "collection", - "multiplicity": { - "lowerBound": 2, - "upperBound": 2 - }, - "sourceInformation": { - "endColumn": 98, - "endLine": 53, - "startColumn": 32, - "startLine": 53 - }, - "values": [ - { - "_type": "lambda", - "body": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 54, - "endLine": 53, - "startColumn": 53, - "startLine": 53 - } - } - ], - "property": "firstName", - "sourceInformation": { - "endColumn": 64, - "endLine": 53, - "startColumn": 56, - "startLine": 53 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 48, - "endLine": 53, - "startColumn": 36, - "startLine": 53 - } - } - ], - "sourceInformation": { - "endColumn": 64, - "endLine": 53, - "startColumn": 52, - "startLine": 53 - } - }, - { - "_type": "lambda", - "body": [ - { - "_type": "property", - "parameters": [ - { - "_type": "var", - "name": "x", - "sourceInformation": { - "endColumn": 88, - "endLine": 53, - "startColumn": 87, - "startLine": 53 - } - } - ], - "property": "lastName", - "sourceInformation": { - "endColumn": 97, - "endLine": 53, - "startColumn": 90, - "startLine": 53 - } - } - ], - "parameters": [ - { - "_type": "var", - "class": "model::Person", - "multiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "name": "x", - "sourceInformation": { - "endColumn": 82, - "endLine": 53, - "startColumn": 70, - "startLine": 53 - } - } - ], - "sourceInformation": { - "endColumn": 97, - "endLine": 53, - "startColumn": 86, - "startLine": 53 - } - } - ] + "returnMultiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 + }, + "body" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 131, + "endLine" : 53, + "endColumn" : 134 + }, + "function" : "from", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 24, + "endLine" : 53, + "endColumn" : 30 + }, + "function" : "project", + "parameters" : [ { + "_type" : "func", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 16, + "endLine" : 53, + "endColumn" : 21 + }, + "function" : "getAll", + "parameters" : [ { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 3, + "endLine" : 53, + "endColumn" : 15 + }, + "fullPath" : "model::Person" + } ] + }, { + "_type" : "collection", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 32, + "endLine" : 53, + "endColumn" : 98 + }, + "multiplicity" : { + "lowerBound" : 2, + "upperBound" : 2 + }, + "values" : [ { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 52, + "endLine" : 53, + "endColumn" : 64 + }, + "body" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 56, + "endLine" : 53, + "endColumn" : 64 + }, + "property" : "firstName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 53, + "endLine" : 53, + "endColumn" : 54 }, - { - "_type": "collection", - "multiplicity": { - "lowerBound": 2, - "upperBound": 2 - }, - "sourceInformation": { - "endColumn": 127, - "endLine": 53, - "startColumn": 101, - "startLine": 53 - }, - "values": [ - { - "_type": "string", - "sourceInformation": { - "endColumn": 113, - "endLine": 53, - "startColumn": 102, - "startLine": 53 - }, - "value": "First Name" - }, - { - "_type": "string", - "sourceInformation": { - "endColumn": 126, - "endLine": 53, - "startColumn": 116, - "startLine": 53 - }, - "value": "Last Name" - } - ] + "name" : "x" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 36, + "endLine" : 53, + "endColumn" : 48 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" } - ], - "sourceInformation": { - "endColumn": 30, - "endLine": 53, - "startColumn": 24, - "startLine": 53 + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } + } ] + }, { + "_type" : "lambda", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 86, + "endLine" : 53, + "endColumn" : 97 }, - { - "_type": "packageableElementPtr", - "fullPath": "execution::RelationalMapping", - "sourceInformation": { - "endColumn": 163, - "endLine": 53, - "startColumn": 136, - "startLine": 53 + "body" : [ { + "_type" : "property", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 90, + "endLine" : 53, + "endColumn" : 97 + }, + "property" : "lastName", + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 87, + "endLine" : 53, + "endColumn" : 88 + }, + "name" : "x" + } ] + } ], + "parameters" : [ { + "_type" : "var", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 70, + "endLine" : 53, + "endColumn" : 82 + }, + "name" : "x", + "genericType" : { + "rawType" : { + "_type" : "packageableType", + "fullPath" : "model::Person" + } + }, + "multiplicity" : { + "lowerBound" : 1, + "upperBound" : 1 } + } ] + } ] + }, { + "_type" : "collection", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 101, + "endLine" : 53, + "endColumn" : 127 + }, + "multiplicity" : { + "lowerBound" : 2, + "upperBound" : 2 + }, + "values" : [ { + "_type" : "string", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 102, + "endLine" : 53, + "endColumn" : 113 }, - { - "_type": "packageableElementPtr", - "fullPath": "execution::RuntimeWithStoreConnections", - "sourceInformation": { - "endColumn": 203, - "endLine": 53, - "startColumn": 166, - "startLine": 53 - } - } - ], - "sourceInformation": { - "endColumn": 134, - "endLine": 53, - "startColumn": 131, - "startLine": 53 - } - } - ], - "name": "PersonWithConnectionStores__TabularDataSet_1_", - "package": "model", - "returnMultiplicity": { - "lowerBound": 1, - "upperBound": 1 - }, - "returnType": "meta::pure::tds::TabularDataSet", - "sourceInformation": { - "endColumn": 1, - "endLine": 54, - "startColumn": 1, - "startLine": 51 - } - }, - { - "_type": "sectionIndex", - "name": "SectionIndex", - "package": "__internal__", - "sections": [ - { - "_type": "importAware", - "parserName": "Pure", - "sourceInformation": { - "endColumn": 8, - "endLine": 1, - "startColumn": 1, - "startLine": 1 - } + "value" : "First Name" + }, { + "_type" : "string", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 116, + "endLine" : 53, + "endColumn" : 126 + }, + "value" : "Last Name" + } ] + } ] + }, { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 136, + "endLine" : 53, + "endColumn" : 163 }, - { - "_type": "importAware", - "elements": [ - "model::EmployeeType", - "model::Person", - "model::Firm", - "model::PersonQuery__TabularDataSet_1_", - "model::PersonWithParams_String_1__TabularDataSet_1_", - "model::PersonQuerySharedData__TabularDataSet_1_", - "model::PersonWithConnectionStores__TabularDataSet_1_" - ], - "parserName": "Pure", - "sourceInformation": { - "endColumn": 1, - "endLine": 56, - "startColumn": 8, - "startLine": 2 - } - } - ] - } - ] + "fullPath" : "execution::RelationalMapping" + }, { + "_type" : "packageableElementPtr", + "sourceInformation" : { + "startLine" : 53, + "startColumn" : 166, + "endLine" : 53, + "endColumn" : 203 + }, + "fullPath" : "execution::RuntimeWithStoreConnections" + } ] + } ], + "package" : "model" + }, { + "_type" : "sectionIndex", + "name" : "SectionIndex", + "sections" : [ { + "_type" : "importAware", + "parserName" : "Pure", + "sourceInformation" : { + "startLine" : 1, + "startColumn" : 1, + "endLine" : 1, + "endColumn" : 8 + } + }, { + "_type" : "importAware", + "parserName" : "Pure", + "elements" : [ "model::EmployeeType", "model::Person", "model::Firm", "model::PersonQuery__TabularDataSet_1_", "model::PersonWithParams_String_1__TabularDataSet_1_", "model::PersonQuerySharedData__TabularDataSet_1_", "model::PersonWithConnectionStores__TabularDataSet_1_" ], + "sourceInformation" : { + "startLine" : 2, + "startColumn" : 8, + "endLine" : 56, + "endColumn" : 1 + } + } ], + "package" : "__internal__" + } ] } \ No newline at end of file diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/models/metamodel.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/models/metamodel.pure index b015b00a3eb..6e97fa4a4bb 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/models/metamodel.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/models/metamodel.pure @@ -206,7 +206,7 @@ Class meta::protocols::pure::vX_X_X::metamodel::domain::Property extends meta::p defaultValue : meta::protocols::pure::vX_X_X::metamodel::domain::DefaultValue[0..1]; name : String[1]; multiplicity : meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[1]; - type : String[1]; + genericType : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1]; propertyTypeSourceInformation: SourceInformation[0..1]; } @@ -214,7 +214,7 @@ Class meta::protocols::pure::vX_X_X::metamodel::domain::QualifiedProperty extend { name : String[1]; parameters : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable[*]; - returnType : String[1]; + returnGenericType : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1]; returnMultiplicity : meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[1]; body : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification[*]; } @@ -254,7 +254,23 @@ Class meta::protocols::pure::vX_X_X::metamodel::domain::Unit conversionFunction : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::Lambda[0..1]; } +Class meta::protocols::pure::vX_X_X::metamodel::type::Type +{ + _type : String[1]; +} +Class meta::protocols::pure::vX_X_X::metamodel::type::PackageableType extends meta::protocols::pure::vX_X_X::metamodel::type::Type, meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::PackageableElementPtr +{ + +} + +Class meta::protocols::pure::vX_X_X::metamodel::type::GenericType +{ + rawType : meta::protocols::pure::vX_X_X::metamodel::type::Type[1]; + typeArguments : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[*]; + multiplicityArguments : meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[*]; + typeVariableValues : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification[*]; +} Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification { @@ -268,7 +284,7 @@ Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable ext supportsStream : Boolean[0..1]; // To Remove multiplicity : meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[0..1]; - class : String[0..1]; + genericType : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[0..1]; } Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::application::FunctionApplication extends meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification @@ -310,9 +326,9 @@ Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::KeyExpr expression: meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification[1]; } -Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance extends meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::PackageableElementPtr +Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance extends meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::RawValue { - + genericType : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1]; } Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::EnumValue extends meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::RawValue @@ -842,7 +858,7 @@ Class meta::protocols::pure::vX_X_X::metamodel::domain::Function extends meta::p { preConstraints:meta::protocols::pure::vX_X_X::metamodel::domain::Constraint[*]; postConstraints:meta::protocols::pure::vX_X_X::metamodel::domain::Constraint[*]; - returnType:String[1]; + returnGenericType:meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1]; returnMultiplicity:meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[1]; parameters : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable[*]; body : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification[*]; diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/executionPlan.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/executionPlan.pure index 6ae68ebd2ba..dee7c74562d 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/executionPlan.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/executionPlan.pure @@ -103,7 +103,7 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::execution ^meta::protocols::pure::vX_X_X::metamodel::executionPlan::FunctionParametersValidationNode( _type = 'function-parameters-validation', resultType = $exp.resultType->transformResultType($extensions), - functionParameters = $exp.functionParameters->map(p | ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable(_type='var', name=$p.name, supportsStream=$p.supportsStream, class=$p.type->elementToPath(), multiplicity=$p.multiplicity->isEmpty()->if(| [],| $p.multiplicity->toOne()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()))), + functionParameters = $exp.functionParameters->map(p | ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable(_type='var', name=$p.name, supportsStream=$p.supportsStream, genericType=^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath=$p.type->elementToPath())), multiplicity=$p.multiplicity->isEmpty()->if(| [],| $p.multiplicity->toOne()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()))), parameterValidationContext = $exp.parameterValidationContext->map(p | $p->match([ e:meta::pure::executionPlan::EnumValidationContext[1] | ^meta::protocols::pure::vX_X_X::metamodel::executionPlan::EnumValidationContext(varName = $e.varName, validEnumValues = $e.validEnumValues, _type = 'enumValidationContext') ])) diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/metamodel.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/metamodel.pure index c2338de8574..e8c510fd641 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/metamodel.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/metamodel.pure @@ -138,6 +138,20 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::t ); } +function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformGenericType(genericType:GenericType[1]):meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1] +{ + ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType + ( + rawType = ^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType + ( + _type='packageableType', + fullPath=$genericType.rawType->toOne()->elementToPath() + ), + typeArguments = $genericType.typeArguments->map(ta|$ta->transformGenericType()), + multiplicityArguments = $genericType.multiplicityArguments->map(ma|$ma->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()) + ) +} + function <> meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformProperty(property:Property[1], extensions:meta::pure::extension::Extension[*]):meta::protocols::pure::vX_X_X::metamodel::domain::Property[1] { ^meta::protocols::pure::vX_X_X::metamodel::domain::Property @@ -145,7 +159,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP defaultValue = if($property.defaultValue->isEmpty(),|[],|$property.defaultValue->toOne()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformDefaultValue($extensions)->toOne()), name = $property.name->toOne(), multiplicity = $property.multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), - type = $property.genericType.rawType->toOne()->elementToPath(), + genericType = transformGenericType($property.genericType), stereotypes = $property.stereotypes->map(s|$s->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformStereotype()), taggedValues = $property.taggedValues->map(t|$t->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformTaggedValue()) ) @@ -164,7 +178,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP ( name = $qualifiedProperty.name->toOne(), parameters = $fType.parameters->tail()->map(p|$p->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformValueSpecification([], newMap([]->cast(@Pair>)), true, $extensions)->cast(@meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable)), - returnType = $fType.returnType.rawType->toOne()->elementToPath(), + returnGenericType = transformGenericType($fType.returnType), returnMultiplicity = $fType.returnMultiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), body = $qualifiedProperty->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformFunctionBody($useAppliedFunction, $extensions), stereotypes = $qualifiedProperty.stereotypes->map(s|$s->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformStereotype()), @@ -235,7 +249,7 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::transform parameters = $f->functionType().parameters->map(p | $p->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformValueSpecification([], ^Map>(), true, true, $extensions)->cast(@meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable) ), - returnType = $f->functionReturnType().rawType->toOne()->elementToPath(), + returnGenericType = transformGenericType($f->functionReturnType()), returnMultiplicity = $f->functionReturnMultiplicity()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), preConstraints = $f.preConstraints->map(c |$c->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformConstraint($extensions)), postConstraints = $f.postConstraints->map(c |$c->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformConstraint($extensions)), diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/valueSpecification.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/valueSpecification.pure index 68891641471..d62b5a166fd 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/valueSpecification.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/valueSpecification.pure @@ -210,10 +210,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance ( _type = 'genericTypeInstance', - fullPath = $v.genericType.rawType->toOne()->match([ - d:DataType[1]|$d->makeString(), - c:Class[1]|$c->elementToPath() - ]) + genericType = meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformGenericType($v.genericType) ) } @@ -228,7 +225,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP _type = 'var', multiplicity = $v.multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity(), name = $v.name, - class = $v.genericType.rawType->toOne()->elementToPath() + genericType = meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformGenericType($v.genericType) ); ,|^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable ( @@ -241,7 +238,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP function <> meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformHackedUnit(v:ValueSpecification[1]):meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance[1] { - ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance(_type='genericTypeInstance', fullPath=$v.genericType.rawType->toOne()->elementToPath()); + ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance(_type='genericTypeInstance', genericType=meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformGenericType($v.genericType)); } function <> meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformUnitInstance(v:ValueSpecification[1]):meta::protocols::pure::vX_X_X::metamodel::valueSpecification::UnitInstance[1] @@ -773,9 +770,9 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGra function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::classElementsToPure(as:Any[*], separator:String[1]):String[1]{ $as->map(a|$a->match([ c:meta::protocols::pure::vX_X_X::metamodel::domain::Class[1]| let nonAnySuperTypes = $c.superTypes->filter(s|$s != 'meta::pure::metamodel::type::Any'); '\nClass '+ if($c.stereotypes->isNotEmpty(),|'\t<<'+$c.stereotypes->classElementsToPure(',') + '>>\n',|'') + if($c.taggedValues->isNotEmpty(),|'\t{'+$c.taggedValues->classElementsToPure(',')+'}\n',|'') + if($c.package->isEmpty(),|$c.name,|$c.package->toOne()+'::'+$c.name) + if($nonAnySuperTypes->isNotEmpty(),| ' extends '+$nonAnySuperTypes->makeString(','),|'') +'\n{\n' + $c.properties->classElementsToPure('\n') + '\n' + $c.qualifiedProperties->classElementsToPure('\n')+'\n}\n';, - p:meta::protocols::pure::vX_X_X::metamodel::domain::Property[1]| if($p.stereotypes->isNotEmpty(),|'\t<<'+$p.stereotypes->classElementsToPure(',') + '>>\n',|'') + if($p.taggedValues->isNotEmpty(),|'\t{'+$p.taggedValues->classElementsToPure(',')+'}\n',|'') + '\t'+$p.name+':'+$p.type+'['+$p.multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::mapToString() +'];', - q:meta::protocols::pure::vX_X_X::metamodel::domain::QualifiedProperty[1]| '\t'+$q.name+'('+$q.parameters->tail()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::classElementsToPure(',')+'){'+$q.body->toPure()->replace('\n','')+'}:'+$q.returnType+'['+$q.returnMultiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::mapToString() +'];', - v:meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable[1]|$v.name + ':' + $v.class->toOne() +'['+$v.multiplicity->toOne()->mapToString()+']', + p:meta::protocols::pure::vX_X_X::metamodel::domain::Property[1]| if($p.stereotypes->isNotEmpty(),|'\t<<'+$p.stereotypes->classElementsToPure(',') + '>>\n',|'') + if($p.taggedValues->isNotEmpty(),|'\t{'+$p.taggedValues->classElementsToPure(',')+'}\n',|'') + '\t'+$p.name+':'+$p.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath+'['+$p.multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::mapToString() +'];', + q:meta::protocols::pure::vX_X_X::metamodel::domain::QualifiedProperty[1]| '\t'+$q.name+'('+$q.parameters->tail()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::classElementsToPure(',')+'){'+$q.body->toPure()->replace('\n','')+'}:'+$q.returnGenericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath+'['+$q.returnMultiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::mapToString() +'];', + v:meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable[1]|$v.name + ':' + $v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne() +'['+$v.multiplicity->toOne()->mapToString()+']', s:meta::protocols::pure::vX_X_X::metamodel::domain::StereotypePtr[1]|$s.profile+'.'+$s.value, t:meta::protocols::pure::vX_X_X::metamodel::domain::TaggedValue[1]|$t.tag.profile+'.'+$t.tag.value+'=\''+$t.value->replace('\'','\\\'')->replace('\n',' ')+'\'' ]))->makeString($separator) @@ -892,13 +889,13 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGra l : Lambda[1]| let pStr = $l.parameters->map(p|$p->match([ v : Variable[1]| - if ($v.class->isEmpty(), + if ($v.genericType->isEmpty(), |$v.name, - |let cName = if($v.class->in([Float, Any, String, Integer, Boolean, Date, DateTime, StrictDate]->map(x|$x->makeString())), - | $v.class->toOne()->makeString(), - | if($v.class->toOne()->isInMeta(), - |$v.class->toOne()->substring($v.class->toOne()->lastIndexOf('::')+2), - |$v.class->toOne() + |let cName = if($v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->in([Float, Any, String, Integer, Boolean, Date, DateTime, StrictDate]->map(x|$x->makeString())), + | $v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne()->makeString(), + | if($v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne()->isInMeta(), + |$v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne()->substring($v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne()->lastIndexOf('::')+2), + |$v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne() ); )->toOne(); let m = $v.multiplicity->toOne()->mapToString(); @@ -910,14 +907,14 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGra '{%s|%s}'->format([$pStr, $bStr]);, v : Variable[1]|'$' + $v.name, - hackedClass :meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance[1]|'@' + $hackedClass.fullPath, + hackedClass :meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance[1]|'@' + $hackedClass.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath, ci : ClassInstance[1] | $ci.value->match( [ aggValue : TDSAggregateValue[1]| 'agg(\'%s\', %s, %s)'->format([$aggValue.name, $state->toPure($aggValue.mapFn), $state->toPure($aggValue.aggregateFn)]), aggValue : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::AggregateValue[1]| 'agg(%s, %s)'->format([$state->toPure($aggValue.mapFn), $state->toPure($aggValue.aggregateFn)]), sortInfo : TDSSortInformation[1]| '^SortInformation(column = \'%s\', direction = SortDirection.%s)'->format([$sortInfo.column, $sortInfo.direction]), - extendInfo: TDSColumnInformation[1] | '^BasicColumnSpecification<%s>(name = \'%s\', func = %s)'->format([$extendInfo.columnFn->cast(@Lambda).parameters->at(0).class->toOne(), $extendInfo.name, $state->toPure($extendInfo.columnFn)]), + extendInfo: TDSColumnInformation[1] | '^BasicColumnSpecification<%s>(name = \'%s\', func = %s)'->format([$extendInfo.columnFn->cast(@Lambda).parameters->at(0).genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne(), $extendInfo.name, $state->toPure($extendInfo.columnFn)]), path : Path[1]| '#/%s/%s%s#'->format([$path.startType, $path.path->map(p|$p->match([ppe:PropertyPathElement[1]|$ppe.property]))->joinStrings('.'), if($path.name->isEmpty() || ($path.name->toOne()->length() == 0), |'', |'!' + $path.name->toOne())]);, or : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::TdsOlapRank[1]| '^TdsOlapRank(func = %s)'->format($state->toPure($or.function)), diff --git a/legend-engine-core/legend-engine-core-query-pure-http-api/src/test/java/org/finos/legend/engine/query/pure/api/test/inMemory/TestM2MGrammarCompileAndExecute.java b/legend-engine-core/legend-engine-core-query-pure-http-api/src/test/java/org/finos/legend/engine/query/pure/api/test/inMemory/TestM2MGrammarCompileAndExecute.java index 873b9653697..c46e70cf6cc 100644 --- a/legend-engine-core/legend-engine-core-query-pure-http-api/src/test/java/org/finos/legend/engine/query/pure/api/test/inMemory/TestM2MGrammarCompileAndExecute.java +++ b/legend-engine-core/legend-engine-core-query-pure-http-api/src/test/java/org/finos/legend/engine/query/pure/api/test/inMemory/TestM2MGrammarCompileAndExecute.java @@ -31,7 +31,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.executionContext.BaseExecutionContext; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.PropertyGraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; diff --git a/legend-engine-core/legend-engine-core-testable/legend-engine-testable/src/test/java/org/finos/legend/engine/testable/assertion/TestTestAssertionEvaluator.java b/legend-engine-core/legend-engine-core-testable/legend-engine-testable/src/test/java/org/finos/legend/engine/testable/assertion/TestTestAssertionEvaluator.java index db4744effa4..02b7ee3bc9e 100644 --- a/legend-engine-core/legend-engine-core-testable/legend-engine-testable/src/test/java/org/finos/legend/engine/testable/assertion/TestTestAssertionEvaluator.java +++ b/legend-engine-core/legend-engine-core-testable/legend-engine-testable/src/test/java/org/finos/legend/engine/testable/assertion/TestTestAssertionEvaluator.java @@ -23,7 +23,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.status.AssertPass; import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.status.AssertionStatus; import org.finos.legend.engine.protocol.pure.v1.model.test.assertion.status.EqualToJsonAssertFail; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; import org.junit.Assert; import org.junit.Test; diff --git a/legend-engine-xts-analytics/legend-engine-xts-analytics-class/legend-engine-xt-analytics-class-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestClassAnalyticsApi.java b/legend-engine-xts-analytics/legend-engine-xts-analytics-class/legend-engine-xt-analytics-class-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestClassAnalyticsApi.java index fa1a59055d3..8230de40ef8 100644 --- a/legend-engine-xts-analytics/legend-engine-xts-analytics-class/legend-engine-xt-analytics-class-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestClassAnalyticsApi.java +++ b/legend-engine-xts-analytics/legend-engine-xts-analytics-class/legend-engine-xt-analytics-class-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestClassAnalyticsApi.java @@ -37,7 +37,7 @@ public void testClassModelCoverageAnalysis() throws IOException { PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("classModelCoverageAnalysisTestData.json")), PureModelContextData.class); Assert.assertEquals( - "{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"Organization\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::Person\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Person\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]}]}", + "{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"Organization\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Person\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Person\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]}]}", api.analyzeClassModelCoverage(new ClassModelCoverageAnalysisInput("vX_X_X", "model::Organization", modelContextData), true, null).getEntity().toString()); } } diff --git a/legend-engine-xts-analytics/legend-engine-xts-analytics-function/legend-engine-xt-analytics-function-http-api/src/test/java/org.finos.legend.engine.api.analytics.test/TestFunctionAnalyticsApi.java b/legend-engine-xts-analytics/legend-engine-xts-analytics-function/legend-engine-xt-analytics-function-http-api/src/test/java/org.finos.legend.engine.api.analytics.test/TestFunctionAnalyticsApi.java index bd37ad8f514..b80aa04d031 100644 --- a/legend-engine-xts-analytics/legend-engine-xts-analytics-function/legend-engine-xt-analytics-function-http-api/src/test/java/org.finos.legend.engine.api.analytics.test/TestFunctionAnalyticsApi.java +++ b/legend-engine-xts-analytics/legend-engine-xts-analytics-function/legend-engine-xt-analytics-function-http-api/src/test/java/org.finos.legend.engine.api.analytics.test/TestFunctionAnalyticsApi.java @@ -37,7 +37,7 @@ public void testFunctionModelCoverageAnalysis() throws IOException { PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("functionModelCoverageAnalysisTestData.json")), PureModelContextData.class); Assert.assertEquals( - "{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"Person\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"function\",\"body\":[{\"_type\":\"func\",\"function\":\"plus\",\"parameters\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":3,\"upperBound\":3},\"values\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"person\"}],\"property\":\"firstName\"},{\"_type\":\"string\",\"value\":\" \"},{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"person\"}],\"property\":\"lastName\"}]}]}],\"name\":\"personFullName_Person_1__String_1_\",\"package\":\"model\",\"parameters\":[{\"_type\":\"var\",\"class\":\"model::Person\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"person\"}],\"postConstraints\":[],\"preConstraints\":[],\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"returnType\":\"String\",\"stereotypes\":[],\"taggedValues\":[]}]}", + "{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"Person\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"function\",\"body\":[{\"_type\":\"func\",\"function\":\"plus\",\"parameters\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":3,\"upperBound\":3},\"values\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"person\"}],\"property\":\"firstName\"},{\"_type\":\"string\",\"value\":\" \"},{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"person\"}],\"property\":\"lastName\"}]}]}],\"name\":\"personFullName_Person_1__String_1_\",\"package\":\"model\",\"parameters\":[{\"_type\":\"var\",\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Person\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"person\"}],\"postConstraints\":[],\"preConstraints\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[],\"tests\":[]}]}", api.analyzeFunctionModelCoverage(new FunctionModelCoverageAnalysisInput("vX_X_X", "model::personFullName_Person_1__String_1_", modelContextData), true, null).getEntity().toString()); } } diff --git a/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestMappingAnalyticsApi.java b/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestMappingAnalyticsApi.java index 16a133f29e8..9dcdea0dc88 100644 --- a/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestMappingAnalyticsApi.java +++ b/legend-engine-xts-analytics/legend-engine-xts-analytics-mapping/legend-engine-xt-analytics-mapping-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestMappingAnalyticsApi.java @@ -56,7 +56,7 @@ public void testMappingModelCoverageAnalysisWithModelReturned() throws IOExcepti { PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("mappingModelCoverageAnalysisTestData.json")), PureModelContextData.class); Assert.assertEquals( - "{\"mappedEntities\":[{\"info\":{\"classPath\":\"model::Bank\",\"isRootEntity\":true,\"subClasses\":[]},\"path\":\"model::Bank\",\"properties\":[{\"_type\":\"entity\",\"entityPath\":\"model::Trader\",\"name\":\"employees\"},{\"_type\":\"enum\",\"enumPath\":\"model::OrgType\",\"name\":\"type\"}]},{\"info\":{\"classPath\":\"model::Trader\",\"isRootEntity\":true,\"subClasses\":[]},\"path\":\"model::Trader\",\"properties\":[{\"_type\":\"MappedProperty\",\"name\":\"fullName\"}]}],\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"Class\",\"constraints\":[],\"name\":\"Bank\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"entityName\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::Trader\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::OrgType\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"OrgType\",\"package\":\"model\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"CORP\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"LLC\"}]},{\"_type\":\"Class\",\"constraints\":[],\"name\":\"Trader\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fullName\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]}]}}", + "{\"mappedEntities\":[{\"info\":{\"classPath\":\"model::Bank\",\"isRootEntity\":true,\"subClasses\":[]},\"path\":\"model::Bank\",\"properties\":[{\"_type\":\"entity\",\"entityPath\":\"model::Trader\",\"name\":\"employees\"},{\"_type\":\"enum\",\"enumPath\":\"model::OrgType\",\"name\":\"type\"}]},{\"info\":{\"classPath\":\"model::Trader\",\"isRootEntity\":true,\"subClasses\":[]},\"path\":\"model::Trader\",\"properties\":[{\"_type\":\"MappedProperty\",\"name\":\"fullName\"}]}],\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"Class\",\"constraints\":[],\"name\":\"Bank\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"entityName\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Trader\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::OrgType\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"OrgType\",\"package\":\"model\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"CORP\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"LLC\"}]},{\"_type\":\"Class\",\"constraints\":[],\"name\":\"Trader\",\"originalMilestonedProperties\":[],\"package\":\"model\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fullName\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]}]}}", api.analyzeModelCoverage(new MappingModelCoverageAnalysisInput("vX_X_X", "model::mapping", modelContextData), true, false, true, null).getEntity().toString()); } diff --git a/legend-engine-xts-data-space/legend-engine-xt-data-space-generation/src/test/java/org/finos/legend/engine/generation/TestDataSpaceAnalyticsArtifactGenerationExtension.java b/legend-engine-xts-data-space/legend-engine-xt-data-space-generation/src/test/java/org/finos/legend/engine/generation/TestDataSpaceAnalyticsArtifactGenerationExtension.java index 368356dc992..8baf4323094 100644 --- a/legend-engine-xts-data-space/legend-engine-xt-data-space-generation/src/test/java/org/finos/legend/engine/generation/TestDataSpaceAnalyticsArtifactGenerationExtension.java +++ b/legend-engine-xts-data-space/legend-engine-xt-data-space-generation/src/test/java/org/finos/legend/engine/generation/TestDataSpaceAnalyticsArtifactGenerationExtension.java @@ -83,21 +83,21 @@ private void testDataSpaceAnalyticsArtifactGenerationExtension(String modelFileP @Test public void testAnalyticsForBasicDataSpace() throws Exception { - testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceBasic.pure", "model::animal::AnimalDS_Old", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\"diagrams\":[{\"diagram\":\"model::animal::AnimalDiagram\",\"title\":\"\"},{\"diagram\":\"model::GeneralDiagram\",\"title\":\"\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"description\":\"An important execution context\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext2\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"defaultRuntime\":\"model::dummyRuntime2\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext3\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[]},\"model::dummyMapping2\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"position\":{\"x\":568.0,\"y\":404.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\",\"position\":{\"x\":809.0,\"y\":187.0},\"rectangle\":{\"height\":44.0,\"width\":108.64453125}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":628.423828125,\"y\":433.0},{\"x\":863.322265625,\"y\":209.0}]},\"sourceView\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"targetView\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\"}],\"name\":\"GeneralDiagram\",\"package\":\"model\",\"propertyViews\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Family\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Number\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::GenericAnimal2\"}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"returnType\":\"Boolean\",\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"returnType\":\"model::animal::GenericAnimal\",\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::mammal::Mammal\",\"id\":\"641a0336-d4b5-418c-b656-2f52461264e2\",\"position\":{\"x\":427.0,\"y\":210.0},\"rectangle\":{\"height\":44.0,\"width\":125.1123046875}},{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"position\":{\"x\":787.0,\"y\":216.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"7a992cfc-c888-4091-aa00-ab430915aced\",\"position\":{\"x\":515.423828125,\"y\":-7.5},\"rectangle\":{\"height\":100.0,\"width\":199.716796875}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":847.423828125,\"y\":245.0},{\"x\":615.2822265625,\"y\":42.5}]},\"sourceView\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"targetView\":\"7a992cfc-c888-4091-aa00-ab430915aced\"}],\"name\":\"AnimalDiagram\",\"package\":\"model::animal\",\"propertyViews\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]},\"name\":\"AnimalDS_Old\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS_Old\",\"stereotypes\":[{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"deprecated\"}],\"supportInfo\":{\"_type\":\"email\",\"address\":\"someEmail@test.org\"},\"taggedValues\":[{\"profile\":\"meta::pure::profiles::enterprise\",\"tag\":\"taxonomyNodes\",\"value\":\"abcdxyz005\"},{\"profile\":\"meta::pure::profiles::doc\",\"tag\":\"doc\",\"value\":\"Lorem ipsum\"},{\"profile\":\"meta::pure::profiles::doc\",\"tag\":\"doc\",\"value\":\"Lorem ipsum2\"},{\"profile\":\"meta::pure::metamodel::dataSpace::profiles::DataSpaceInfo\",\"tag\":\"deprecationNotice\",\"value\":\"Please use AnimalDS dataspace instead - link provided\"}]}"); - testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceBasic.pure", "model::animal::AnimalDS", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\"diagrams\":[{\"description\":\"Some diagram description\",\"diagram\":\"model::animal::AnimalDiagram\",\"title\":\"Diag 1\"},{\"description\":\"Some more diagram description\",\"diagram\":\"model::GeneralDiagram\",\"title\":\"Diag 2\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"description\":\"An important execution context\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\",\"title\":\"Haha Nice\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext2\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"defaultRuntime\":\"model::dummyRuntime2\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext3\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[]},\"model::dummyMapping2\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"position\":{\"x\":568.0,\"y\":404.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\",\"position\":{\"x\":809.0,\"y\":187.0},\"rectangle\":{\"height\":44.0,\"width\":108.64453125}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":628.423828125,\"y\":433.0},{\"x\":863.322265625,\"y\":209.0}]},\"sourceView\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"targetView\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\"}],\"name\":\"GeneralDiagram\",\"package\":\"model\",\"propertyViews\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Family\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Number\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::GenericAnimal2\"}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"returnType\":\"Boolean\",\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"returnType\":\"model::animal::GenericAnimal\",\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::mammal::Mammal\",\"id\":\"641a0336-d4b5-418c-b656-2f52461264e2\",\"position\":{\"x\":427.0,\"y\":210.0},\"rectangle\":{\"height\":44.0,\"width\":125.1123046875}},{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"position\":{\"x\":787.0,\"y\":216.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"7a992cfc-c888-4091-aa00-ab430915aced\",\"position\":{\"x\":515.423828125,\"y\":-7.5},\"rectangle\":{\"height\":100.0,\"width\":199.716796875}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":847.423828125,\"y\":245.0},{\"x\":615.2822265625,\"y\":42.5}]},\"sourceView\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"targetView\":\"7a992cfc-c888-4091-aa00-ab430915aced\"}],\"name\":\"AnimalDiagram\",\"package\":\"model::animal\",\"propertyViews\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]},\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS\",\"stereotypes\":[{\"profile\":\"meta::pure::metamodel::dataSpace::profiles::DataSpaceInfo\",\"value\":\"Verified\"}],\"supportInfo\":{\"_type\":\"email\",\"address\":\"someEmail@test.org\"},\"taggedValues\":[]}"); - testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceBasic.pure", "model::animal::AnimalDS2", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\"diagrams\":[{\"diagram\":\"model::animal::AnimalDiagram\",\"title\":\"\"},{\"diagram\":\"model::GeneralDiagram\",\"title\":\"\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"description\":\"An important execution context\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext2\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"defaultRuntime\":\"model::dummyRuntime2\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext3\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[]},\"model::dummyMapping2\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"position\":{\"x\":568.0,\"y\":404.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\",\"position\":{\"x\":809.0,\"y\":187.0},\"rectangle\":{\"height\":44.0,\"width\":108.64453125}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":628.423828125,\"y\":433.0},{\"x\":863.322265625,\"y\":209.0}]},\"sourceView\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"targetView\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\"}],\"name\":\"GeneralDiagram\",\"package\":\"model\",\"propertyViews\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Family\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Number\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::GenericAnimal2\"}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"returnType\":\"Boolean\",\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"returnType\":\"model::animal::GenericAnimal\",\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::mammal::Mammal\",\"id\":\"641a0336-d4b5-418c-b656-2f52461264e2\",\"position\":{\"x\":427.0,\"y\":210.0},\"rectangle\":{\"height\":44.0,\"width\":125.1123046875}},{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"position\":{\"x\":787.0,\"y\":216.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"7a992cfc-c888-4091-aa00-ab430915aced\",\"position\":{\"x\":515.423828125,\"y\":-7.5},\"rectangle\":{\"height\":100.0,\"width\":199.716796875}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":847.423828125,\"y\":245.0},{\"x\":615.2822265625,\"y\":42.5}]},\"sourceView\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"targetView\":\"7a992cfc-c888-4091-aa00-ab430915aced\"}],\"name\":\"AnimalDiagram\",\"package\":\"model::animal\",\"propertyViews\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]},\"name\":\"AnimalDS2\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS2\",\"stereotypes\":[{\"profile\":\"meta::pure::metamodel::dataSpace::profiles::DataSpaceInfo\",\"value\":\"Verified\"}],\"supportInfo\":{\"_type\":\"email\",\"address\":\"someEmail@test.org\"},\"taggedValues\":[]}"); + testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceBasic.pure", "model::animal::AnimalDS_Old", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\"diagrams\":[{\"diagram\":\"model::animal::AnimalDiagram\",\"title\":\"\"},{\"diagram\":\"model::GeneralDiagram\",\"title\":\"\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"description\":\"An important execution context\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext2\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"defaultRuntime\":\"model::dummyRuntime2\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext3\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[]},\"model::dummyMapping2\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"position\":{\"x\":568.0,\"y\":404.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\",\"position\":{\"x\":809.0,\"y\":187.0},\"rectangle\":{\"height\":44.0,\"width\":108.64453125}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":628.423828125,\"y\":433.0},{\"x\":863.322265625,\"y\":209.0}]},\"sourceView\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"targetView\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\"}],\"name\":\"GeneralDiagram\",\"package\":\"model\",\"propertyViews\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Family\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Number\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::mammal::Mammal\",\"id\":\"641a0336-d4b5-418c-b656-2f52461264e2\",\"position\":{\"x\":427.0,\"y\":210.0},\"rectangle\":{\"height\":44.0,\"width\":125.1123046875}},{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"position\":{\"x\":787.0,\"y\":216.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"7a992cfc-c888-4091-aa00-ab430915aced\",\"position\":{\"x\":515.423828125,\"y\":-7.5},\"rectangle\":{\"height\":100.0,\"width\":199.716796875}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":847.423828125,\"y\":245.0},{\"x\":615.2822265625,\"y\":42.5}]},\"sourceView\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"targetView\":\"7a992cfc-c888-4091-aa00-ab430915aced\"}],\"name\":\"AnimalDiagram\",\"package\":\"model::animal\",\"propertyViews\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]},\"name\":\"AnimalDS_Old\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS_Old\",\"stereotypes\":[{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"deprecated\"}],\"supportInfo\":{\"_type\":\"email\",\"address\":\"someEmail@test.org\"},\"taggedValues\":[{\"profile\":\"meta::pure::profiles::enterprise\",\"tag\":\"taxonomyNodes\",\"value\":\"abcdxyz005\"},{\"profile\":\"meta::pure::profiles::doc\",\"tag\":\"doc\",\"value\":\"Lorem ipsum\"},{\"profile\":\"meta::pure::profiles::doc\",\"tag\":\"doc\",\"value\":\"Lorem ipsum2\"},{\"profile\":\"meta::pure::metamodel::dataSpace::profiles::DataSpaceInfo\",\"tag\":\"deprecationNotice\",\"value\":\"Please use AnimalDS dataspace instead - link provided\"}]}"); + testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceBasic.pure", "model::animal::AnimalDS", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\"diagrams\":[{\"description\":\"Some diagram description\",\"diagram\":\"model::animal::AnimalDiagram\",\"title\":\"Diag 1\"},{\"description\":\"Some more diagram description\",\"diagram\":\"model::GeneralDiagram\",\"title\":\"Diag 2\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"description\":\"An important execution context\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\",\"title\":\"Haha Nice\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext2\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"defaultRuntime\":\"model::dummyRuntime2\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext3\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[]},\"model::dummyMapping2\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"position\":{\"x\":568.0,\"y\":404.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\",\"position\":{\"x\":809.0,\"y\":187.0},\"rectangle\":{\"height\":44.0,\"width\":108.64453125}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":628.423828125,\"y\":433.0},{\"x\":863.322265625,\"y\":209.0}]},\"sourceView\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"targetView\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\"}],\"name\":\"GeneralDiagram\",\"package\":\"model\",\"propertyViews\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Family\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Number\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::mammal::Mammal\",\"id\":\"641a0336-d4b5-418c-b656-2f52461264e2\",\"position\":{\"x\":427.0,\"y\":210.0},\"rectangle\":{\"height\":44.0,\"width\":125.1123046875}},{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"position\":{\"x\":787.0,\"y\":216.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"7a992cfc-c888-4091-aa00-ab430915aced\",\"position\":{\"x\":515.423828125,\"y\":-7.5},\"rectangle\":{\"height\":100.0,\"width\":199.716796875}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":847.423828125,\"y\":245.0},{\"x\":615.2822265625,\"y\":42.5}]},\"sourceView\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"targetView\":\"7a992cfc-c888-4091-aa00-ab430915aced\"}],\"name\":\"AnimalDiagram\",\"package\":\"model::animal\",\"propertyViews\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]},\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS\",\"stereotypes\":[{\"profile\":\"meta::pure::metamodel::dataSpace::profiles::DataSpaceInfo\",\"value\":\"Verified\"}],\"supportInfo\":{\"_type\":\"email\",\"address\":\"someEmail@test.org\"},\"taggedValues\":[]}"); + testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceBasic.pure", "model::animal::AnimalDS2", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\"diagrams\":[{\"diagram\":\"model::animal::AnimalDiagram\",\"title\":\"\"},{\"diagram\":\"model::GeneralDiagram\",\"title\":\"\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"description\":\"An important execution context\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext2\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"defaultRuntime\":\"model::dummyRuntime2\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext3\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[]},\"model::dummyMapping2\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"position\":{\"x\":568.0,\"y\":404.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\",\"position\":{\"x\":809.0,\"y\":187.0},\"rectangle\":{\"height\":44.0,\"width\":108.64453125}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":628.423828125,\"y\":433.0},{\"x\":863.322265625,\"y\":209.0}]},\"sourceView\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"targetView\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\"}],\"name\":\"GeneralDiagram\",\"package\":\"model\",\"propertyViews\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Family\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Number\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::mammal::Mammal\",\"id\":\"641a0336-d4b5-418c-b656-2f52461264e2\",\"position\":{\"x\":427.0,\"y\":210.0},\"rectangle\":{\"height\":44.0,\"width\":125.1123046875}},{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"position\":{\"x\":787.0,\"y\":216.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"7a992cfc-c888-4091-aa00-ab430915aced\",\"position\":{\"x\":515.423828125,\"y\":-7.5},\"rectangle\":{\"height\":100.0,\"width\":199.716796875}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":847.423828125,\"y\":245.0},{\"x\":615.2822265625,\"y\":42.5}]},\"sourceView\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"targetView\":\"7a992cfc-c888-4091-aa00-ab430915aced\"}],\"name\":\"AnimalDiagram\",\"package\":\"model::animal\",\"propertyViews\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]},\"name\":\"AnimalDS2\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS2\",\"stereotypes\":[{\"profile\":\"meta::pure::metamodel::dataSpace::profiles::DataSpaceInfo\",\"value\":\"Verified\"}],\"supportInfo\":{\"_type\":\"email\",\"address\":\"someEmail@test.org\"},\"taggedValues\":[]}"); } @Test public void testAnalyticsForDataSpaceWithAssociation() throws Exception { - testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithAssociation.pure", "domain::COVIDDatapace", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Not over yet?\",\"diagrams\":[{\"diagram\":\"domain::COVIDDataDiagram\",\"title\":\"\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"runtime::MyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"runtime::MyRuntime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::MyConnection\",\"storePath\":\"ModelStore\"}},{\"compatibleRuntimes\":[\"runtime::MyRuntime\"],\"defaultRuntime\":\"runtime::MyRuntime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext2\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::MyConnection\",\"storePath\":\"ModelStore\"}}],\"mappingToMappingCoverageResult\":{\"mapping::CovidDataMapping\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"COVIDData\",\"originalMilestonedProperties\":[],\"package\":\"domain\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"id\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Integer\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"fips\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"date\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"StrictDate\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"caseType\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"cases\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Float\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"lastReportedFlag\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"demographics\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"domain::Demographics\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"domain::COVIDData\",\"id\":\"6b69f44b-f729-46aa-b244-ec5ee8164142\",\"position\":{\"x\":280.0,\"y\":159.0},\"rectangle\":{\"height\":128.0,\"width\":205.8291015625}},{\"class\":\"domain::Demographics\",\"id\":\"159e797e-ae75-437d-ba9c-253f99a48826\",\"position\":{\"x\":698.0,\"y\":238.0},\"rectangle\":{\"height\":58.0,\"width\":111.68994140625}},{\"class\":\"domain::Class1\",\"id\":\"f6bd8a50-8d18-4bd9-9a8d-7fad88d02b07\",\"position\":{\"x\":360.844970703125,\"y\":49.0},\"rectangle\":{\"height\":58.0,\"width\":137.390625}},{\"class\":\"domain::Class2\",\"id\":\"690e89d4-23e9-46e8-8543-c89c22cc9e15\",\"position\":{\"x\":696.844970703125,\"y\":95.0},\"rectangle\":{\"height\":44.0,\"width\":133.68994140625}}],\"generalizationViews\":[],\"name\":\"COVIDDataDiagram\",\"package\":\"domain\",\"propertyViews\":[{\"line\":{\"points\":[{\"x\":382.91455078125,\"y\":223.0},{\"x\":753.844970703125,\"y\":267.0}]},\"property\":{\"class\":\"domain::COVIDData\",\"property\":\"demographics\"},\"sourceView\":\"6b69f44b-f729-46aa-b244-ec5ee8164142\",\"targetView\":\"159e797e-ae75-437d-ba9c-253f99a48826\"},{\"line\":{\"points\":[{\"x\":763.68994140625,\"y\":117.0},{\"x\":429.540283203125,\"y\":78.0}]},\"property\":{\"class\":\"domain::Class2\",\"property\":\"fromClass1\"},\"sourceView\":\"690e89d4-23e9-46e8-8543-c89c22cc9e15\",\"targetView\":\"f6bd8a50-8d18-4bd9-9a8d-7fad88d02b07\"},{\"line\":{\"points\":[{\"x\":429.540283203125,\"y\":78.0},{\"x\":763.68994140625,\"y\":117.0}]},\"property\":{\"class\":\"domain::Class1\",\"property\":\"fromClass2\"},\"sourceView\":\"f6bd8a50-8d18-4bd9-9a8d-7fad88d02b07\",\"targetView\":\"690e89d4-23e9-46e8-8543-c89c22cc9e15\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Class1\",\"originalMilestonedProperties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"domain::Class2\"}],\"package\":\"domain\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"propClass1\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"businesstemporal\"}],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"association\",\"name\":\"Class12Assoc\",\"originalMilestonedProperties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"domain::Class1\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"domain::Class2\"}],\"package\":\"domain\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"domain::Class1\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"domain::Class2\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Class2\",\"originalMilestonedProperties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"domain::Class1\"}],\"package\":\"domain\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"propClass2\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"processingtemporal\"}],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Demographics\",\"originalMilestonedProperties\":[],\"package\":\"domain\",\"properties\":[{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"fips\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"state\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"BusinessDateMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"ProcessingDateMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"profile\",\"name\":\"temporal\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"bitemporal\",\"businesstemporal\",\"processingtemporal\"],\"tags\":[]}]},\"name\":\"COVIDDatapace\",\"package\":\"domain\",\"path\":\"domain::COVIDDatapace\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"COVID Sample Data\"}"); + testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithAssociation.pure", "domain::COVIDDatapace", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Not over yet?\",\"diagrams\":[{\"diagram\":\"domain::COVIDDataDiagram\",\"title\":\"\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"runtime::MyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"runtime::MyRuntime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::MyConnection\",\"storePath\":\"ModelStore\"}},{\"compatibleRuntimes\":[\"runtime::MyRuntime\"],\"defaultRuntime\":\"runtime::MyRuntime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext2\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::MyConnection\",\"storePath\":\"ModelStore\"}}],\"mappingToMappingCoverageResult\":{\"mapping::CovidDataMapping\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"COVIDData\",\"originalMilestonedProperties\":[],\"package\":\"domain\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Integer\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"id\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"fips\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"StrictDate\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"date\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"caseType\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Float\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"cases\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"lastReportedFlag\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"domain::Demographics\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"demographics\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"domain::COVIDData\",\"id\":\"6b69f44b-f729-46aa-b244-ec5ee8164142\",\"position\":{\"x\":280.0,\"y\":159.0},\"rectangle\":{\"height\":128.0,\"width\":205.8291015625}},{\"class\":\"domain::Demographics\",\"id\":\"159e797e-ae75-437d-ba9c-253f99a48826\",\"position\":{\"x\":698.0,\"y\":238.0},\"rectangle\":{\"height\":58.0,\"width\":111.68994140625}},{\"class\":\"domain::Class1\",\"id\":\"f6bd8a50-8d18-4bd9-9a8d-7fad88d02b07\",\"position\":{\"x\":360.844970703125,\"y\":49.0},\"rectangle\":{\"height\":58.0,\"width\":137.390625}},{\"class\":\"domain::Class2\",\"id\":\"690e89d4-23e9-46e8-8543-c89c22cc9e15\",\"position\":{\"x\":696.844970703125,\"y\":95.0},\"rectangle\":{\"height\":44.0,\"width\":133.68994140625}}],\"generalizationViews\":[],\"name\":\"COVIDDataDiagram\",\"package\":\"domain\",\"propertyViews\":[{\"line\":{\"points\":[{\"x\":382.91455078125,\"y\":223.0},{\"x\":753.844970703125,\"y\":267.0}]},\"property\":{\"class\":\"domain::COVIDData\",\"property\":\"demographics\"},\"sourceView\":\"6b69f44b-f729-46aa-b244-ec5ee8164142\",\"targetView\":\"159e797e-ae75-437d-ba9c-253f99a48826\"},{\"line\":{\"points\":[{\"x\":763.68994140625,\"y\":117.0},{\"x\":429.540283203125,\"y\":78.0}]},\"property\":{\"class\":\"domain::Class2\",\"property\":\"fromClass1\"},\"sourceView\":\"690e89d4-23e9-46e8-8543-c89c22cc9e15\",\"targetView\":\"f6bd8a50-8d18-4bd9-9a8d-7fad88d02b07\"},{\"line\":{\"points\":[{\"x\":429.540283203125,\"y\":78.0},{\"x\":763.68994140625,\"y\":117.0}]},\"property\":{\"class\":\"domain::Class1\",\"property\":\"fromClass2\"},\"sourceView\":\"f6bd8a50-8d18-4bd9-9a8d-7fad88d02b07\",\"targetView\":\"690e89d4-23e9-46e8-8543-c89c22cc9e15\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Class1\",\"originalMilestonedProperties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"domain::Class2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[]}],\"package\":\"domain\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"propClass1\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"businesstemporal\"}],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"association\",\"name\":\"Class12Assoc\",\"originalMilestonedProperties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"domain::Class1\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"domain::Class2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[]}],\"package\":\"domain\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"domain::Class1\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"domain::Class2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Class2\",\"originalMilestonedProperties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"domain::Class1\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[]}],\"package\":\"domain\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"propClass2\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"processingtemporal\"}],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Demographics\",\"originalMilestonedProperties\":[],\"package\":\"domain\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"fips\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"state\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"BusinessDateMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"ProcessingDateMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"profile\",\"name\":\"temporal\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"bitemporal\",\"businesstemporal\",\"processingtemporal\"],\"tags\":[]}]},\"name\":\"COVIDDatapace\",\"package\":\"domain\",\"path\":\"domain::COVIDDatapace\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"COVID Sample Data\"}"); } @Test public void testAnalyticsForDataSpaceWithSubstantialMapping() throws Exception { - testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithSubstantialMapping.pure", "model::animal::AnimalDS", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\"diagrams\":[{\"diagram\":\"model::animal::AnimalDiagram\",\"title\":\"\"},{\"diagram\":\"model::GeneralDiagram\",\"title\":\"\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"description\":\"An important execution context\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext2\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"defaultRuntime\":\"model::dummyRuntime2\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext3\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[{\"path\":\"model::animal::Animal\",\"properties\":[{\"_type\":\"MappedProperty\",\"name\":\"noOfLegs\"},{\"_type\":\"MappedProperty\",\"name\":\"something\"},{\"_type\":\"entity\",\"entityPath\":\"model::animal::GenericAnimal\",\"name\":\"something2\"}]},{\"path\":\"model::animal::Animal2\",\"properties\":[{\"_type\":\"MappedProperty\",\"name\":\"name\"},{\"_type\":\"MappedProperty\",\"name\":\"name2\"}]},{\"path\":\"model::animal::GenericAnimal\",\"properties\":[]},{\"path\":\"model::animal::GenericAnimal2\",\"properties\":[]}]},\"model::dummyMapping2\":{\"mappedEntities\":[{\"path\":\"model::animal::mammal::Mammal\",\"properties\":[{\"_type\":\"MappedProperty\",\"name\":\"noOfLegs\"}]},{\"path\":\"model::animal::reptile::Reptile\",\"properties\":[{\"_type\":\"enum\",\"enumPath\":\"model::animal::Family\",\"name\":\"family\"},{\"_type\":\"MappedProperty\",\"name\":\"name2\"},{\"_type\":\"MappedProperty\",\"name\":\"something\"},{\"_type\":\"MappedProperty\",\"name\":\"hasFin\"}]}]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"position\":{\"x\":568.0,\"y\":404.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\",\"position\":{\"x\":809.0,\"y\":187.0},\"rectangle\":{\"height\":44.0,\"width\":108.64453125}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":628.423828125,\"y\":433.0},{\"x\":863.322265625,\"y\":209.0}]},\"sourceView\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"targetView\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\"}],\"name\":\"GeneralDiagram\",\"package\":\"model\",\"propertyViews\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Family\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Number\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::GenericAnimal2\"}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"returnType\":\"Boolean\",\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"returnType\":\"model::animal::GenericAnimal\",\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::mammal::Mammal\",\"id\":\"641a0336-d4b5-418c-b656-2f52461264e2\",\"position\":{\"x\":427.0,\"y\":210.0},\"rectangle\":{\"height\":44.0,\"width\":125.1123046875}},{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"position\":{\"x\":787.0,\"y\":216.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"7a992cfc-c888-4091-aa00-ab430915aced\",\"position\":{\"x\":515.423828125,\"y\":-7.5},\"rectangle\":{\"height\":100.0,\"width\":199.716796875}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":847.423828125,\"y\":245.0},{\"x\":615.2822265625,\"y\":42.5}]},\"sourceView\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"targetView\":\"7a992cfc-c888-4091-aa00-ab430915aced\"}],\"name\":\"AnimalDiagram\",\"package\":\"model::animal\",\"propertyViews\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]},\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS\",\"stereotypes\":[{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"deprecated\"}],\"supportInfo\":{\"_type\":\"email\",\"address\":\"someEmail@test.org\"},\"taggedValues\":[{\"profile\":\"meta::pure::profiles::enterprise\",\"tag\":\"taxonomyNodes\",\"value\":\"abcdxyz005\"},{\"profile\":\"meta::pure::profiles::doc\",\"tag\":\"doc\",\"value\":\"Lorem ipsum\"},{\"profile\":\"meta::pure::profiles::doc\",\"tag\":\"doc\",\"value\":\"Lorem ipsum2\"}]}"); + testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithSubstantialMapping.pure", "model::animal::AnimalDS", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\"diagrams\":[{\"diagram\":\"model::animal::AnimalDiagram\",\"title\":\"\"},{\"diagram\":\"model::GeneralDiagram\",\"title\":\"\"}],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"description\":\"An important execution context\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext2\"},{\"compatibleRuntimes\":[\"model::dummyRuntime\",\"model::dummyRuntime2\"],\"defaultRuntime\":\"model::dummyRuntime2\",\"mapping\":\"model::dummyMapping2\",\"name\":\"dummyContext3\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[{\"path\":\"model::animal::Animal\",\"properties\":[{\"_type\":\"MappedProperty\",\"name\":\"noOfLegs\"},{\"_type\":\"MappedProperty\",\"name\":\"something\"},{\"_type\":\"entity\",\"entityPath\":\"model::animal::GenericAnimal\",\"name\":\"something2\"}]},{\"path\":\"model::animal::Animal2\",\"properties\":[{\"_type\":\"MappedProperty\",\"name\":\"name\"},{\"_type\":\"MappedProperty\",\"name\":\"name2\"}]},{\"path\":\"model::animal::GenericAnimal\",\"properties\":[]},{\"path\":\"model::animal::GenericAnimal2\",\"properties\":[]}]},\"model::dummyMapping2\":{\"mappedEntities\":[{\"path\":\"model::animal::mammal::Mammal\",\"properties\":[{\"_type\":\"MappedProperty\",\"name\":\"noOfLegs\"}]},{\"path\":\"model::animal::reptile::Reptile\",\"properties\":[{\"_type\":\"enum\",\"enumPath\":\"model::animal::Family\",\"name\":\"family\"},{\"_type\":\"MappedProperty\",\"name\":\"name2\"},{\"_type\":\"MappedProperty\",\"name\":\"something\"},{\"_type\":\"MappedProperty\",\"name\":\"hasFin\"}]}]}},\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"position\":{\"x\":568.0,\"y\":404.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\",\"position\":{\"x\":809.0,\"y\":187.0},\"rectangle\":{\"height\":44.0,\"width\":108.64453125}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":628.423828125,\"y\":433.0},{\"x\":863.322265625,\"y\":209.0}]},\"sourceView\":\"4cec85f9-9b66-450a-bdcb-c855aa0314e1\",\"targetView\":\"902bf14e-e7ff-40e7-92e4-8780f91bfa29\"}],\"name\":\"GeneralDiagram\",\"package\":\"model\",\"propertyViews\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Family\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Number\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"diagram\",\"classViews\":[{\"class\":\"model::animal::mammal::Mammal\",\"id\":\"641a0336-d4b5-418c-b656-2f52461264e2\",\"position\":{\"x\":427.0,\"y\":210.0},\"rectangle\":{\"height\":44.0,\"width\":125.1123046875}},{\"class\":\"model::animal::reptile::Reptile\",\"id\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"position\":{\"x\":787.0,\"y\":216.0},\"rectangle\":{\"height\":58.0,\"width\":120.84765625}},{\"class\":\"model::animal::Animal\",\"id\":\"7a992cfc-c888-4091-aa00-ab430915aced\",\"position\":{\"x\":515.423828125,\"y\":-7.5},\"rectangle\":{\"height\":100.0,\"width\":199.716796875}}],\"generalizationViews\":[{\"line\":{\"points\":[{\"x\":847.423828125,\"y\":245.0},{\"x\":615.2822265625,\"y\":42.5}]},\"sourceView\":\"b92253d8-0389-4c7d-b5d2-3cdc3bb1ad98\",\"targetView\":\"7a992cfc-c888-4091-aa00-ab430915aced\"}],\"name\":\"AnimalDiagram\",\"package\":\"model::animal\",\"propertyViews\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]},\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS\",\"stereotypes\":[{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"deprecated\"}],\"supportInfo\":{\"_type\":\"email\",\"address\":\"someEmail@test.org\"},\"taggedValues\":[{\"profile\":\"meta::pure::profiles::enterprise\",\"tag\":\"taxonomyNodes\",\"value\":\"abcdxyz005\"},{\"profile\":\"meta::pure::profiles::doc\",\"tag\":\"doc\",\"value\":\"Lorem ipsum\"},{\"profile\":\"meta::pure::profiles::doc\",\"tag\":\"doc\",\"value\":\"Lorem ipsum2\"}]}"); } @Test diff --git a/legend-engine-xts-diagram/legend-engine-xt-diagram-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestDiagramAnalyticsApi.java b/legend-engine-xts-diagram/legend-engine-xt-diagram-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestDiagramAnalyticsApi.java index 487b17fe0de..dbc52055f3f 100644 --- a/legend-engine-xts-diagram/legend-engine-xt-diagram-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestDiagramAnalyticsApi.java +++ b/legend-engine-xts-diagram/legend-engine-xt-diagram-http-api/src/test/java/org/finos/legend/engine/api/analytics/test/TestDiagramAnalyticsApi.java @@ -58,7 +58,7 @@ public void testDiagramAnalysis() throws IOException { PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("diagramAnalyticsTestData.json")), PureModelContextData.class); Response response = api.analyzeDiagramModelCoverage(new DiagramModelCoverageAnalysisInput("vX_X_X", "model::animal::AnimalDiagram", modelContextData), false, null); - Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"profile\",\"name\":\"typemodifiers\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"abstract\"],\"tags\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Family\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Animal\"}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::typemodifiers\",\"value\":\"abstract\"}],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"MAMMAL\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"REPTILE\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"a warm-blooded vertebrate animal of a class that is distinguished by the possession of hair or fur\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[]}]}", response.getEntity().toString()); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"profile\",\"name\":\"typemodifiers\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"abstract\"],\"tags\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Family\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Animal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::typemodifiers\",\"value\":\"abstract\"}],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"MAMMAL\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"REPTILE\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"a warm-blooded vertebrate animal of a class that is distinguished by the possession of hair or fur\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[]}]}", response.getEntity().toString()); } @Test @@ -66,7 +66,7 @@ public void testDiagramAnalysisWithDerivedProperties() throws IOException { PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("diagramAnalyticsTestDataWithDerivedProperties.json")), PureModelContextData.class); Response response = api.analyzeDiagramModelCoverage(new DiagramModelCoverageAnalysisInput("vX_X_X", "model::animal::AnimalDiagram", modelContextData), false, null); - Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Family\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Number\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::GenericAnimal2\"}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"returnType\":\"Boolean\",\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"returnType\":\"model::animal::GenericAnimal\",\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]}", response.getEntity().toString()); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Family\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Number\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]}", response.getEntity().toString()); } @Test @@ -74,7 +74,7 @@ public void testDiagramAnalysisWithAssociation() throws IOException { PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("diagramAnalyticsTestDataWithAssociation.json")), PureModelContextData.class); Response response = api.analyzeDiagramModelCoverage(new DiagramModelCoverageAnalysisInput("vX_X_X", "model::animal::AnimalDiagram", modelContextData), false, null); - Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Family\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Number\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::GenericAnimal2\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"classificationInfo\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::ClassificationInfo\"}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"returnType\":\"Boolean\",\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"returnType\":\"model::animal::GenericAnimal\",\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"ClassificationInfo\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"association\",\"name\":\"CrossAssociation\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":0},\"name\":\"relatedMammal\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::mammal::Mammal\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"relatedReptile\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::reptile::Reptile\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]}", response.getEntity().toString()); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Family\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Number\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::ClassificationInfo\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"classificationInfo\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"ClassificationInfo\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"association\",\"name\":\"CrossAssociation\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::mammal::Mammal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"relatedMammal\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::reptile::Reptile\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"relatedReptile\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]}", response.getEntity().toString()); } @Test @@ -82,7 +82,7 @@ public void testDiagramAnalysisWithShouldBeExcludedProfile() throws IOException { PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("diagramAnalyticsTestDataWithShouldBeExcludedProfile.json")), PureModelContextData.class); Response response = api.analyzeDiagramModelCoverage(new DiagramModelCoverageAnalysisInput("vX_X_X", "model::animal::AnimalDiagram", modelContextData), false, null); - Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::Family\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Number\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::GenericAnimal2\"},{\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"classificationInfo\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::ClassificationInfo\"}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"returnType\":\"Boolean\",\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"returnType\":\"model::animal::GenericAnimal\",\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"ClassificationInfo\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"association\",\"name\":\"CrossAssociation\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":0},\"name\":\"relatedMammal\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::mammal::Mammal\"},{\"multiplicity\":{\"lowerBound\":0},\"name\":\"relatedReptile\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::animal::reptile::Reptile\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"Boolean\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]}", response.getEntity().toString()); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::Family\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"family\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Number\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"children\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::ClassificationInfo\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"name\":\"classificationInfo\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"func\",\"fControl\":\"greaterThan_Number_1__Number_1__Boolean_1_\",\"function\":\"greaterThan\",\"parameters\":[{\"_type\":\"property\",\"parameters\":[{\"_type\":\"var\",\"name\":\"this\"}],\"property\":\"noOfLegs\"},{\"_type\":\"integer\",\"value\":4}]}],\"name\":\"something\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]},{\"body\":[{\"_type\":\"collection\",\"multiplicity\":{\"lowerBound\":0,\"upperBound\":0},\"values\":[]}],\"name\":\"something2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::GenericAnimal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":0,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"ClassificationInfo\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"association\",\"name\":\"CrossAssociation\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::mammal::Mammal\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"relatedMammal\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::animal::reptile::Reptile\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":0},\"name\":\"relatedReptile\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"taggedValues\":[]},{\"_type\":\"Enumeration\",\"name\":\"Family\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"UO\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"OP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Mammal\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::mammal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"noOfLegs\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Reptile\",\"originalMilestonedProperties\":[],\"package\":\"model::animal::reptile\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"Boolean\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"hasFin\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]}", response.getEntity().toString()); } @Test @@ -90,7 +90,7 @@ public void testDiagramAnalysisWithMilestoning() throws IOException { PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("diagramAnalyticsTestDataWithMilestoning.json")), PureModelContextData.class); Response response = api.analyzeDiagramModelCoverage(new DiagramModelCoverageAnalysisInput("vX_X_X", "model::MyDiagram", modelContextData), false, null); - Assert.assertEquals(response.getEntity().toString(), "{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"BusinessDateMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"ProcessingDateMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"profile\",\"name\":\"temporal\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"bitemporal\",\"businesstemporal\",\"processingtemporal\"],\"tags\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Class1\",\"originalMilestonedProperties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::Class2\"}],\"package\":\"model\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"propClass1\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"businesstemporal\"}],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"association\",\"name\":\"Class12Assoc\",\"originalMilestonedProperties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::Class1\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::Class2\"}],\"package\":\"model\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::Class1\"},{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::Class2\"}],\"qualifiedProperties\":[],\"stereotypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Class2\",\"originalMilestonedProperties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"model::Class1\"}],\"package\":\"model\",\"properties\":[{\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"propClass2\",\"stereotypes\":[],\"taggedValues\":[],\"type\":\"String\"}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"processingtemporal\"}],\"superTypes\":[],\"taggedValues\":[]}]}"); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"BusinessDateMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"ProcessingDateMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"profile\",\"name\":\"temporal\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"bitemporal\",\"businesstemporal\",\"processingtemporal\"],\"tags\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Class1\",\"originalMilestonedProperties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Class2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[]}],\"package\":\"model\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"propClass1\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"businesstemporal\"}],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"association\",\"name\":\"Class12Assoc\",\"originalMilestonedProperties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Class1\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Class2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[]}],\"package\":\"model\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Class1\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Class2\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass2\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Class2\",\"originalMilestonedProperties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::Class1\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fromClass1\",\"stereotypes\":[],\"taggedValues\":[]}],\"package\":\"model\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"propClass2\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"processingtemporal\"}],\"superTypes\":[],\"taggedValues\":[]}]}", response.getEntity().toString()); } } diff --git a/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-executionPlan-test/src/main/resources/core_elasticsearch_execution_test/elasticsearch_test_tds_schema.pure b/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-executionPlan-test/src/main/resources/core_elasticsearch_execution_test/elasticsearch_test_tds_schema.pure index a08a526e536..8f24e2c7eab 100644 --- a/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-executionPlan-test/src/main/resources/core_elasticsearch_execution_test/elasticsearch_test_tds_schema.pure +++ b/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-executionPlan-test/src/main/resources/core_elasticsearch_execution_test/elasticsearch_test_tds_schema.pure @@ -41,7 +41,7 @@ function meta::external::store::elasticsearch::executionTest::testCase::tds::sch { let toCompile = $config.model->replace('%_url_%', 'http://localhost:1') + '\n\n' + '###Pure \n\n ' + - 'function test::tdsSchema::func():FunctionDefinition[1] ' + + 'function test::tdsSchema::func():FunctionDefinition[1] ' + '{\n' + $code + '}'; diff --git a/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-pure-specification-metamodel/src/main/resources/core_elasticsearch_specification_metamodel/specification_generator.pure b/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-pure-specification-metamodel/src/main/resources/core_elasticsearch_specification_metamodel/specification_generator.pure index 5c5ee52c8da..6c45cbc6e11 100644 --- a/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-pure-specification-metamodel/src/main/resources/core_elasticsearch_specification_metamodel/specification_generator.pure +++ b/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-pure-specification-metamodel/src/main/resources/core_elasticsearch_specification_metamodel/specification_generator.pure @@ -66,12 +66,12 @@ function meta::external::store::elasticsearch::specification::metamodel::generat properties = [ ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = 'value', - type = 'T', + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath='T')), multiplicity = ZeroOne->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity() ), ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = 'expression', - type = 'String', + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath='String')), multiplicity = ZeroOne->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity() ) ], @@ -116,7 +116,7 @@ meta::external::store::elasticsearch::specification::metamodel::addConstraints(c ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable( _type = 'var', name = 'b', - class = 'Boolean', + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = 'Boolean')), multiplicity = PureOne->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity() ) ] @@ -415,7 +415,7 @@ meta::external::store::elasticsearch::specification::metamodel::createProperty(p {stringVal: String[1] | ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = $name, - type = 'String', + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = 'String')), multiplicity = PureOne->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity(), defaultValue = ^meta::protocols::pure::vX_X_X::metamodel::domain::DefaultValue( value = ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::CString(_type = 'string', value = $stringVal) @@ -429,7 +429,7 @@ meta::external::store::elasticsearch::specification::metamodel::createProperty(p let multiplicity = $property.type->propertyTypeMultiplicity($property.required, $state); let pureProperty = ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = $name, - type = $pureType, + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = $pureType)), multiplicity = $multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity() ); } @@ -447,7 +447,7 @@ meta::external::store::elasticsearch::specification::metamodel::createProperty(p ); $state.log(|'Processing property finished: %s (kind: %s)'->format([$property.name, $property.type->type()->elementToPath()])); - if($fullProp.type == 'Nil' || $name == '{dynamic_property}', |[], |$fullProp); + if($fullProp.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath == 'Nil' || $name == '{dynamic_property}', |[], |$fullProp); } function diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-grammar/src/main/java/org/finos/legend/engine/language/pure/dsl/persistence/grammar/to/PrimitiveValueSpecificationToObjectVisitor.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-grammar/src/main/java/org/finos/legend/engine/language/pure/dsl/persistence/grammar/to/PrimitiveValueSpecificationToObjectVisitor.java index cbf27dfd015..a7821d8d442 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-grammar/src/main/java/org/finos/legend/engine/language/pure/dsl/persistence/grammar/to/PrimitiveValueSpecificationToObjectVisitor.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-grammar/src/main/java/org/finos/legend/engine/language/pure/dsl/persistence/grammar/to/PrimitiveValueSpecificationToObjectVisitor.java @@ -19,33 +19,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import java.io.ByteArrayInputStream; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/plugin/RelationalGraphFetchUtils.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/plugin/RelationalGraphFetchUtils.java index a9d9f59498b..820ac22db96 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/plugin/RelationalGraphFetchUtils.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-execution/legend-engine-xt-relationalStore-executionPlan/src/main/java/org/finos/legend/engine/plan/execution/stores/relational/plugin/RelationalGraphFetchUtils.java @@ -19,15 +19,15 @@ import org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCacheByEqualityKeys; import org.finos.legend.engine.plan.execution.cache.graphFetch.GraphFetchCacheKey; import org.finos.legend.engine.plan.execution.stores.relational.result.SQLExecutionResult; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.GraphFetchTree; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.PropertyGraphFetchTree; import org.finos.legend.engine.shared.core.collectionsExtensions.DoubleHashingStrategy; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/milestoning/MilestoningParseTreeWalker.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/milestoning/MilestoningParseTreeWalker.java index aaad614fe76..eabe389a60f 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/milestoning/MilestoningParseTreeWalker.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-grammar/src/main/java/org/finos/legend/engine/language/pure/grammar/from/milestoning/MilestoningParseTreeWalker.java @@ -23,9 +23,9 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning.BusinessSnapshotMilestoning; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning.Milestoning; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning.ProcessingMilestoning; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import java.util.regex.Matcher; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-http-api/src/test/resources/expectedJson.json b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-http-api/src/test/resources/expectedJson.json index 71272afa9fd..02c96553a89 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-http-api/src/test/resources/expectedJson.json +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-http-api/src/test/resources/expectedJson.json @@ -781,7 +781,12 @@ "lowerBound": 1 }, "name": "name", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -789,7 +794,12 @@ "lowerBound": 1 }, "name": "location", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -813,7 +823,12 @@ "lowerBound": 1 }, "name": "fullname", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -821,7 +836,12 @@ "lowerBound": 1 }, "name": "passportId", - "type": "Integer" + "genericType": { + "rawType": { + "fullPath": "Integer", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -829,7 +849,12 @@ "lowerBound": 0 }, "name": "firmname", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -837,7 +862,12 @@ "lowerBound": 0 }, "name": "location", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -861,7 +891,12 @@ "lowerBound": 1 }, "name": "cityId", - "type": "Integer" + "genericType": { + "rawType": { + "fullPath": "Integer", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -869,7 +904,12 @@ "lowerBound": 0 }, "name": "name", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -893,7 +933,12 @@ "lowerBound": 1 }, "name": "passportId", - "type": "Integer" + "genericType": { + "rawType": { + "fullPath": "Integer", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -901,7 +946,12 @@ "lowerBound": 0 }, "name": "countryName", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -925,7 +975,12 @@ "lowerBound": 1 }, "name": "name", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -949,7 +1004,12 @@ "lowerBound": 1 }, "name": "name", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -957,7 +1017,12 @@ "lowerBound": 1 }, "name": "location", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -981,7 +1046,12 @@ "lowerBound": 1 }, "name": "name", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -989,7 +1059,12 @@ "lowerBound": 1 }, "name": "location", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -1013,14 +1088,24 @@ "lowerBound": 1 }, "name": "companyEmployeeTestSchema1Company", - "type": "meta::relational::transform::autogen::tests::testSchema1::Company" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::Company", + "_type": "packageableType" + } + } }, { "multiplicity": { "lowerBound": 1 }, "name": "companyEmployeeTestSchema1Employee", - "type": "meta::relational::transform::autogen::tests::testSchema1::Employee" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::Employee", + "_type": "packageableType" + } + } } ] }, @@ -1043,14 +1128,24 @@ "lowerBound": 1 }, "name": "employeeCityTestSchema1Employee", - "type": "meta::relational::transform::autogen::tests::testSchema1::Employee" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::Employee", + "_type": "packageableType" + } + } }, { "multiplicity": { "lowerBound": 1 }, "name": "employeeCityTestSchema1City", - "type": "meta::relational::transform::autogen::tests::testSchema1::City" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::City", + "_type": "packageableType" + } + } } ] }, @@ -1074,7 +1169,12 @@ "lowerBound": 1 }, "name": "employeePassportTestSchema1Employee", - "type": "meta::relational::transform::autogen::tests::testSchema1::Employee" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::Employee", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -1082,7 +1182,12 @@ "lowerBound": 1 }, "name": "employeePassportTestSchema1Passport", - "type": "meta::relational::transform::autogen::tests::testSchema1::Passport" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::Passport", + "_type": "packageableType" + } + } } ] }, @@ -1105,7 +1210,12 @@ "lowerBound": 1 }, "name": "passportCountryTestSchema1Passport", - "type": "meta::relational::transform::autogen::tests::testSchema1::Passport" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::Passport", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -1113,7 +1223,12 @@ "lowerBound": 1 }, "name": "passportCountryTestSchema1Country", - "type": "meta::relational::transform::autogen::tests::testSchema1::Country" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::Country", + "_type": "packageableType" + } + } } ] }, @@ -1137,14 +1252,24 @@ "lowerBound": 1 }, "name": "companyEmployeeFromDifferentSchemasTestSchema2Company", - "type": "meta::relational::transform::autogen::tests::testSchema2::Company" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema2::Company", + "_type": "packageableType" + } + } }, { "multiplicity": { "lowerBound": 1 }, "name": "companyEmployeeFromDifferentSchemasTestSchema1Employee", - "type": "meta::relational::transform::autogen::tests::testSchema1::Employee" + "genericType": { + "rawType": { + "fullPath": "meta::relational::transform::autogen::tests::testSchema1::Employee", + "_type": "packageableType" + } + } } ] } @@ -1154,4 +1279,4 @@ "name": "pure", "version": "vX_X_X" } -} \ No newline at end of file +} diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-http-api/src/test/resources/expectedJsonWithInclude.json b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-http-api/src/test/resources/expectedJsonWithInclude.json index 005da823e05..227c7bb5daa 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-http-api/src/test/resources/expectedJsonWithInclude.json +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-http-api/src/test/resources/expectedJsonWithInclude.json @@ -267,7 +267,12 @@ "lowerBound": 1 }, "name": "name", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -275,7 +280,12 @@ "lowerBound": 1 }, "name": "location", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -299,7 +309,12 @@ "lowerBound": 1 }, "name": "fullname", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -307,7 +322,12 @@ "lowerBound": 1 }, "name": "passportId", - "type": "Integer" + "genericType": { + "rawType": { + "fullPath": "Integer", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -315,7 +335,12 @@ "lowerBound": 0 }, "name": "firmname", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -323,7 +348,12 @@ "lowerBound": 0 }, "name": "location", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -347,14 +377,24 @@ "lowerBound": 1 }, "name": "companyEmployeeTestSchema1Company", - "type": "model::testSchema1::Company" + "genericType": { + "rawType": { + "fullPath": "model::testSchema1::Company", + "_type": "packageableType" + } + } }, { "multiplicity": { "lowerBound": 1 }, "name": "companyEmployeeTestSchema1Employee", - "type": "model::testSchema1::Employee" + "genericType": { + "rawType": { + "fullPath": "model::testSchema1::Employee", + "_type": "packageableType" + } + } } ] }, @@ -553,7 +593,12 @@ "lowerBound": 1 }, "name": "name", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -561,7 +606,12 @@ "lowerBound": 0 }, "name": "addressId", - "type": "Integer" + "genericType": { + "rawType": { + "fullPath": "Integer", + "_type": "packageableType" + } + } } ] }, @@ -585,7 +635,12 @@ "lowerBound": 1 }, "name": "id", - "type": "String" + "genericType": { + "rawType": { + "fullPath": "String", + "_type": "packageableType" + } + } } ] }, @@ -608,7 +663,12 @@ "lowerBound": 1 }, "name": "personAddressHrPerson", - "type": "model::HR::Person" + "genericType": { + "rawType": { + "fullPath": "model::HR::Person", + "_type": "packageableType" + } + } }, { "multiplicity": { @@ -616,7 +676,12 @@ "lowerBound": 1 }, "name": "personAddressHrAddress", - "type": "model::HR::Address" + "genericType": { + "rawType": { + "fullPath": "model::HR::Address", + "_type": "packageableType" + } + } } ] } @@ -626,4 +691,4 @@ "name": "pure", "version": "vX_X_X" } -} \ No newline at end of file +} diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/BusinessMilestoning.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/BusinessMilestoning.java index cb9624ddae4..7d87f57d73b 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/BusinessMilestoning.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/BusinessMilestoning.java @@ -14,7 +14,7 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDate; public class BusinessMilestoning extends Milestoning { diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/ProcessingMilestoning.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/ProcessingMilestoning.java index 87ad6f67f00..62002dcf646 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/ProcessingMilestoning.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/store/relational/model/milestoning/ProcessingMilestoning.java @@ -14,7 +14,7 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.milestoning; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDate; public class ProcessingMilestoning extends Milestoning { diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/DatabaseInstance.java b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/DatabaseInstance.java index 0ad749039fc..c234bb055b8 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/DatabaseInstance.java +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/valueSpecification/DatabaseInstance.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.io.IOException; diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/autogeneration/relationalToPure.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/autogeneration/relationalToPure.pure index d8fb0155f5d..a48bc7742d7 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/autogeneration/relationalToPure.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/autogeneration/relationalToPure.pure @@ -50,7 +50,7 @@ function <> meta::relational::transform::autogen::columnToProper ( name = $column.name->createSQLSafeName()->createValidPropertyName(), multiplicity = if($column.nullable == false, | PureOne, | ZeroOne)->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), - type = meta::relational::metamodel::datatype::dataTypeToCompatiblePureType($column.type)->toOne()->elementToPath() + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = meta::relational::metamodel::datatype::dataTypeToCompatiblePureType($column.type)->toOne()->elementToPath())) ); } @@ -138,7 +138,7 @@ function <> meta::relational::transform::autogen::generateAssoci ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = $propertyName->createSQLSafeName()->createValidPropertyName(), multiplicity = $multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), - type = $packageStr + '::' + $schemaName + '::' + createValidClassName($tableName) + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = $packageStr + '::' + $schemaName + '::' + createValidClassName($tableName))) ); } @@ -255,8 +255,8 @@ function <> meta::relational::transform::autogen::generateRelati { let p1 = $association.properties->at(0); let p2 = $association.properties->at(1); - let p1ClassPath = $p2.type; - let p2ClassPath = $p1.type; + let p1ClassPath = $p2.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath; + let p2ClassPath = $p1.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath; let p1ClassName = getClassNameFromClassPath($p1ClassPath); let p2ClassName = getClassNameFromClassPath($p2ClassPath); let associationAlias = $join.aliases->at(0); diff --git a/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/compiler/toPureGraph/ServiceCompilerExtensionImpl.java b/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/compiler/toPureGraph/ServiceCompilerExtensionImpl.java index 4c6e15a172b..be0b62f6186 100644 --- a/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/compiler/toPureGraph/ServiceCompilerExtensionImpl.java +++ b/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/compiler/toPureGraph/ServiceCompilerExtensionImpl.java @@ -186,12 +186,13 @@ public Iterable> getExtraProcessors() { FunctionType fType = (FunctionType) assertion._classifierGenericType()._typeArguments().getFirst()._rawType(); Assert.assertTrue(fType._parameters() != null && fType._parameters().size() == 1, () -> "Post validation assertion function expects 1 parameter"); - Assert.assertTrue(executionFunctionType._returnType().equals(fType._parameters().getFirst()._genericType()) && executionFunctionType._returnMultiplicity().equals(fType._parameters().getAny()._multiplicity()), + Assert.assertTrue(org.finos.legend.pure.m3.navigation.generictype.GenericType.genericTypesEqual(executionFunctionType._returnType(), fType._parameters().getFirst()._genericType(), context.pureModel.getExecutionSupport().getProcessorSupport()) + && Multiplicity.multiplicitiesEqual(executionFunctionType._returnMultiplicity(), fType._parameters().getAny()._multiplicity()), () -> "Post validation assertion function parameter type '" + - fType._parameters().getFirst()._genericType()._rawType()._name() + + org.finos.legend.pure.m3.navigation.generictype.GenericType.print(fType._parameters().getFirst()._genericType(), context.pureModel.getExecutionSupport().getProcessorSupport()) + Multiplicity.print(fType._parameters().getFirst()._multiplicity()) + "' does not match with service execution return type '" + - executionFunctionType._returnType()._rawType()._name() + + org.finos.legend.pure.m3.navigation.generictype.GenericType.print(executionFunctionType._returnType(), context.pureModel.getExecutionSupport().getProcessorSupport()) + Multiplicity.print(executionFunctionType._returnMultiplicity()) + "'" ); diff --git a/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestServiceCompilationFromGrammar.java b/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestServiceCompilationFromGrammar.java index 0357d8b9d5c..dab31110198 100644 --- a/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestServiceCompilationFromGrammar.java +++ b/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/test/java/org/finos/legend/engine/language/pure/compiler/test/TestServiceCompilationFromGrammar.java @@ -235,7 +235,7 @@ public void testServiceWithSingleExecution() " [\n" + " ];\n" + " }\n" + - "}\n", "COMPILATION error at [28:12-34]: Can't find type 'test::class2'"); + "}\n", "COMPILATION error at [28:20-31]: Can't find type 'test::class2'"); // test service execution mapping test(resource + "###Service\n" + "Service test::Service\n" + @@ -303,7 +303,7 @@ public void testServiceWithSingleExecution() " { [], res: Result[1]|$res.values->cast(@TabularDataSet).rows->size() == 1 }\n" + " ];\n" + " }\n" + - "}\n", "COMPILATION error at [37:13-35]: Can't find type 'Result'"); + "}\n", "COMPILATION error at [37:20-32]: Can't find type 'Result'"); // check service execution embedded runtime test(resource + "###Service\n" + "Service test::Service\n" + @@ -640,7 +640,7 @@ public void testServiceWithMultiExecution() " data: 'testData';\n" + " }\n" + " }\n" + - "}\n", "COMPILATION error at [28:12-34]: Can't find type 'test::class2'"); + "}\n", "COMPILATION error at [28:20-31]: Can't find type 'test::class2'"); // check service execution mapping test(resource + "###Service\n" + "Service test::Service\n" + @@ -749,7 +749,7 @@ public void testServiceWithMultiExecution() " asserts: [{ [], res: Result[1]|$res.values->cast(@TabularDataSet).rows->size() == 1 }];\n" + " }\n" + " }\n" + - "}\n", "COMPILATION error at [50:23-45]: Can't find type 'Result'"); + "}\n", "COMPILATION error at [50:30-42]: Can't find type 'Result'"); test(resource + "###Service\n" + "Service meta::pure::myServiceMulti\n" + @@ -887,7 +887,7 @@ public void testServiceCompilationWithOnlyLambda() " data: 'moreThanData';\n" + " asserts:\n" + " [\n" + - " { [], res: meta::pure::mapping::Result[1]|$res.values->toOne()->size() == 1 }\n" + + " { [], res: meta::pure::mapping::Result[1]|$res.values->toOne()->size() == 1 }\n" + " ];\n" + " }\n" + "}\n"); @@ -922,7 +922,7 @@ public void testServiceCompilationWithMilestoningElements() " data: 'moreThanData';\n" + " asserts:\n" + " [\n" + - " { [], res: meta::pure::mapping::Result[1]|$res.values->toOne()->size() == 1 }\n" + + " { [], res: meta::pure::mapping::Result[1]|$res.values->toOne()->size() == 1 }\n" + " ];\n" + " }\n" + "}\n"); diff --git a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ValueSpecificationToResultVisitor.java b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ValueSpecificationToResultVisitor.java index 86051e02ac3..b0c47d9b8ad 100644 --- a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ValueSpecificationToResultVisitor.java +++ b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/test/runner/service/ValueSpecificationToResultVisitor.java @@ -19,33 +19,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.PureList; public class ValueSpecificationToResultVisitor implements ValueSpecificationVisitor diff --git a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/testable/service/extension/TestValueSpecificationBuilder.java b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/testable/service/extension/TestValueSpecificationBuilder.java index 9c8017bc1d6..1c19fb101e8 100644 --- a/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/testable/service/extension/TestValueSpecificationBuilder.java +++ b/legend-engine-xts-service/legend-engine-test-runner-service/src/main/java/org/finos/legend/engine/testable/service/extension/TestValueSpecificationBuilder.java @@ -29,33 +29,33 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedQualifiedProperty; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.UnknownAppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CByteArray; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Class; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Enum; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PrimitiveType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CBoolean; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDateTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CDecimal; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CFloat; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CInteger; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CLatestDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictDate; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CStrictTime; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.AppliedQualifiedProperty; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.UnknownAppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CByteArray; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Class; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Enum; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.PrimitiveType; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CBoolean; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDateTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CDecimal; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CFloat; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CInteger; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CLatestDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictDate; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CStrictTime; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.ClassInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.EnumValue; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.GenericTypeInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.HackedUnit; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.EnumValue; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.HackedUnit; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.KeyExpression; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.UnitInstance; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.UnitType; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Whatever; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.MappingInstance; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.Whatever; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.deprecated.MappingInstance; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.RuntimeInstance; import java.io.Closeable; diff --git a/legend-engine-xts-sql/legend-engine-xt-sql-http-api/src/main/java/org/finos/legend/engine/query/sql/api/SQLExecutor.java b/legend-engine-xts-sql/legend-engine-xt-sql-http-api/src/main/java/org/finos/legend/engine/query/sql/api/SQLExecutor.java index 68e9e81ffdc..4dd5ca75cb5 100644 --- a/legend-engine-xts-sql/legend-engine-xt-sql-http-api/src/main/java/org/finos/legend/engine/query/sql/api/SQLExecutor.java +++ b/legend-engine-xts-sql/legend-engine-xt-sql-http-api/src/main/java/org/finos/legend/engine/query/sql/api/SQLExecutor.java @@ -49,6 +49,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextPointer; import org.finos.legend.engine.protocol.pure.v1.model.executionPlan.SingleExecutionPlan; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; +import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.Variable; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.protocol.sql.metamodel.BooleanLiteral; @@ -106,11 +108,11 @@ public class SQLExecutor private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(SQLExecutor.class); private static final ObjectMapper OBJECT_MAPPER = ObjectMapperFactory.getNewStandardObjectMapperWithPureProtocolExtensionSupports(); private static final Map, String> LITERAL_TO_PURE_TYPES = UnifiedMap.newMapWith( - Tuples.pair(IntegerLiteral.class, "Integer"), - Tuples.pair(StringLiteral.class, "String"), - Tuples.pair(BooleanLiteral.class, "Boolean"), - Tuples.pair(LongLiteral.class, "Integer"), - Tuples.pair(DoubleLiteral.class, "Float") + Tuples.pair(IntegerLiteral.class, "Integer"), + Tuples.pair(StringLiteral.class, "String"), + Tuples.pair(BooleanLiteral.class, "Boolean"), + Tuples.pair(LongLiteral.class, "Integer"), + Tuples.pair(DoubleLiteral.class, "Float") ); private final ModelManager modelManager; @@ -264,7 +266,7 @@ private T process(Query query, Variable variable = new Variable(); variable.name = "_" + (index + 1); variable.multiplicity = Multiplicity.PURE_ONE; - variable._class = new PackageableElementPointer(PackageableElementType.CLASS, LITERAL_TO_PURE_TYPES.get(expression.getClass())); + variable.genericType = new GenericType(new PackageableType(LITERAL_TO_PURE_TYPES.get(expression.getClass()))); return new SQLQueryParameter(variable, expression); }); @@ -382,7 +384,7 @@ static String serializeToJSON(Object pureObject, PureModel pureModel, Boolean al private Lambda transformLambda(LambdaFunction lambda, PureModel pureModel) { - Object protocol = transformToVersionedModel(lambda, PureClientVersions.production, routerExtensions.apply(pureModel), pureModel.getExecutionSupport()); + Object protocol = transformToVersionedModel(lambda, PureClientVersions.production, routerExtensions.apply(pureModel), pureModel.getExecutionSupport()); return transform(protocol, Lambda.class, pureModel); } diff --git a/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/FunctionSQLSourceProvider.java b/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/FunctionSQLSourceProvider.java index 2b5ed78c392..d88311a3b75 100644 --- a/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/FunctionSQLSourceProvider.java +++ b/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/FunctionSQLSourceProvider.java @@ -24,6 +24,7 @@ import org.eclipse.collections.impl.utility.ListIterate; import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContext; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function; +import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.query.sql.providers.core.SQLContext; import org.finos.legend.engine.query.sql.providers.core.SQLSource; @@ -84,7 +85,7 @@ public SQLSourceResolvedContext resolve(List sources, SQLContext co Function function = SQLProviderUtils.extractElement("function", Function.class, resolvedProject.getData(), f -> path.equals(f.getPath())); - if (!TABULAR_TYPES.contains(function.returnType)) + if (!TABULAR_TYPES.contains(((PackageableType) function.returnGenericType.rawType).fullPath)) { throw new EngineException("Function " + path + " does not return Tabular data type"); } diff --git a/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/utils/SQLProviderUtils.java b/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/utils/SQLProviderUtils.java index 7c95523c763..2c020a988a2 100644 --- a/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/utils/SQLProviderUtils.java +++ b/legend-engine-xts-sql/legend-engine-xt-sql-providers/legend-engine-xt-sql-providers-shared/src/main/java/org/finos/legend/engine/query/sql/providers/shared/utils/SQLProviderUtils.java @@ -27,9 +27,9 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.runtime.IdentifiedConnection; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.runtime.StoreConnections; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application.AppliedFunction; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; -import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.PackageableElementPtr; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; import java.util.Collections; import java.util.List;