From 6736bf1ebf64a2d33599e2f41b5b1f66fb7e5f1d Mon Sep 17 00:00:00 2001 From: rafaelbey Date: Fri, 22 Nov 2024 14:18:31 -0500 Subject: [PATCH 01/17] BugFixes: propagate type arguments on new constructor, proper casting on infix functions --- .../TestDomainCompilationFromProtocol.java | 112 +++++++++++++++ .../DEPRECATED_PureGrammarComposerCore.java | 13 +- ...lperValueSpecificationGrammarComposer.java | 14 +- .../roundtrip/TestDomainGrammarRoundtrip.java | 130 ++++++++++++++++++ .../application/AppliedFunction.java | 62 +++++++++ 5 files changed, 318 insertions(+), 13 deletions(-) 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/fromProtocol/TestDomainCompilationFromProtocol.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/fromProtocol/TestDomainCompilationFromProtocol.java index 3c9e2d240b3..c2ffc9394d4 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/fromProtocol/TestDomainCompilationFromProtocol.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/fromProtocol/TestDomainCompilationFromProtocol.java @@ -80,4 +80,116 @@ public void testProfileLoadingWithPackageOffset() { testProtocolLoadingModelWithPackageOffset("profileUsedInClassExample.json", null, "update::"); } + + @Test + public void testNewConstructorWithMissingTypeArgumentsCompiles() + { + testWithJson("{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"new\",\n" + + " \"parameters\": [\n" + + " {\n" + + // ---------- type to construct, no type arguments + " \"_type\": \"packageableElementPtr\",\n" + + " \"fullPath\": \"BasicColumnSpecification\"\n" + + // ---------- type to construct, no type arguments + " },\n" + + " {\n" + + " \"_type\": \"string\",\n" + + " \"value\": \"\"\n" + + " },\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"values\": [\n" + + " {\n" + + " \"_type\": \"keyExpression\",\n" + + " \"add\": false,\n" + + " \"expression\": {\n" + + " \"_type\": \"lambda\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"integer\",\n" + + " \"value\": 1\n" + + " }\n" + + " ],\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"var\",\n" + + " \"genericType\": {\n" + + " \"multiplicityArguments\": [],\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"TDSRow\"\n" + + " },\n" + + " \"typeArguments\": [],\n" + + " \"typeVariableValues\": []\n" + + " },\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"name\": \"r\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"key\": {\n" + + " \"_type\": \"string\",\n" + + " \"value\": \"func\"\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"name\": \"new__Any_1_\",\n" + + " \"package\": \"test\",\n" + + " \"parameters\": [],\n" + + " \"postConstraints\": [],\n" + + " \"preConstraints\": [],\n" + + " \"returnGenericType\": {\n" + + " \"multiplicityArguments\": [],\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"Any\"\n" + + " },\n" + + " \"typeArguments\": [],\n" + + " \"typeVariableValues\": []\n" + + " },\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": [],\n" + + " \"tests\": []\n" + + " },\n" + + " {\n" + + " \"_type\": \"sectionIndex\",\n" + + " \"name\": \"SectionIndex\",\n" + + " \"package\": \"__internal__\",\n" + + " \"sections\": [\n" + + " {\n" + + " \"_type\": \"importAware\",\n" + + " \"elements\": [\n" + + " \"test::new__Any_1_\"\n" + + " ],\n" + + " \"imports\": [],\n" + + " \"parserName\": \"Pure\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + "}", null); + } } 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 dfe935d43cf..c1e24ebef89 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 @@ -782,7 +782,7 @@ else if ("letFunction".equals(function)) } else if ("cast".equals(function)) { - return parameters.get(0).accept(this) + "->" + _function + "(@" + parameters.get(1).accept(this) + ")"; + return possiblyAddParenthesis(parameters.get(0), this) + "->cast(@" + parameters.get(1).accept(this) + ")"; } else if ("subType".equals(function)) { @@ -791,7 +791,7 @@ else if ("subType".equals(function)) else if ("new".equals(function)) { ValueSpecification param = parameters.get(parameters.size() - 1); - List values = param instanceof Collection ? ((Collection) param).values : Arrays.asList(param); + List values = param instanceof Collection ? ((Collection) param).values : Collections.singletonList(param); String type; if (parameters.get(0) instanceof GenericTypeInstance) { @@ -842,7 +842,7 @@ else if (parameters.size() == 1) + (toCreateNewLine ? this.returnChar() + DEPRECATED_PureGrammarComposerCore.computeIndentationString(this, getTabSize(1)) : " ") + possiblyAddParenthesis(function, parameters.get(1), this); } - else if (function != null && CORE_FUNCTIONS_WITH_PREFIX_RENDERING.contains(function)) + else if (CORE_FUNCTIONS_WITH_PREFIX_RENDERING.contains(function)) { return HelperValueSpecificationGrammarComposer.renderFunctionName(function, this) + "(" + (this.isRenderingPretty() ? this.returnChar() + DEPRECATED_PureGrammarComposerCore.computeIndentationString(this, getTabSize(1)) : "") + @@ -877,12 +877,7 @@ public String visit(AppliedProperty appliedProperty) @Override public String visit(Collection collection) { - - return HelperValueSpecificationGrammarComposer.renderCollection(collection.values, v -> - { - String value = ((ValueSpecification) v).accept(this); - return v instanceof AppliedFunction && isInfix((AppliedFunction) v) ? "(" + value + ")" : value; - }, this); + return HelperValueSpecificationGrammarComposer.renderCollection(collection.values, v -> possiblyAddParenthesis((ValueSpecification) v, this), this); } @Override 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 9773897959b..cf4cb60d031 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 @@ -179,10 +179,16 @@ public static String possiblyAddParenthesis(String function, ValueSpecification { if ("and".equals(function) || "or".equals(function) || "plus".equals(function) || "minus".equals(function) || "times".equals(function) || "divide".equals(function) || "not".equals(function)) { - if (param instanceof AppliedFunction && isInfix((AppliedFunction) param)) - { - return "(" + param.accept(transformer) + ")"; - } + return possiblyAddParenthesis(param, transformer); + } + return param.accept(transformer); + } + + public static String possiblyAddParenthesis(ValueSpecification param, DEPRECATED_PureGrammarComposerCore transformer) + { + if (param instanceof AppliedFunction && isInfix((AppliedFunction) param)) + { + return "(" + param.accept(transformer) + ")"; } return param.accept(transformer); } 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/TestDomainGrammarRoundtrip.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/TestDomainGrammarRoundtrip.java index 146a380268e..2eef4809fb8 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/roundtrip/TestDomainGrammarRoundtrip.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/TestDomainGrammarRoundtrip.java @@ -14,6 +14,7 @@ package org.finos.legend.engine.language.pure.grammar.test.roundtrip; +import com.fasterxml.jackson.core.JsonProcessingException; import org.finos.legend.engine.language.pure.grammar.test.TestGrammarRoundtrip; import org.junit.Test; @@ -497,6 +498,135 @@ public void testFunction() "}\n"); } + @Test + public void testInFixFunctionAsParameter() + { + testFormat("function test::inFix(): Any[1]\n" + + "{\n" + + " %1970-01-01T00:00:00.000+0000->adjust((123 / 1000000)->cast(@Integer), DurationUnit.SECONDS)\n" + + "}\n", + "function test::inFix(): Any[1]\n" + + "{\n" + + " %1970-01-01T00:00:00.000+0000->adjust(cast(123 / 1000000, @Integer), DurationUnit.SECONDS)\n" + + "}\n"); + } + + @Test + public void testNewConstructorWithTypeArgumentsIsBackwardCompatible() throws JsonProcessingException + { + testComposedGrammar("{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"func\",\n" + + " \"function\": \"new\",\n" + + " \"parameters\": [\n" + + " {\n" + + // ---------- type to construct, no type arguments + " \"_type\": \"packageableElementPtr\",\n" + + " \"fullPath\": \"BasicColumnSpecification\"\n" + + // ---------- type to construct, no type arguments + " },\n" + + " {\n" + + " \"_type\": \"string\",\n" + + " \"value\": \"\"\n" + + " },\n" + + " {\n" + + " \"_type\": \"collection\",\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"values\": [\n" + + " {\n" + + " \"_type\": \"keyExpression\",\n" + + " \"add\": false,\n" + + " \"expression\": {\n" + + " \"_type\": \"lambda\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"integer\",\n" + + " \"value\": 1\n" + + " }\n" + + " ],\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"var\",\n" + + " \"genericType\": {\n" + + " \"multiplicityArguments\": [],\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"TDSRow\"\n" + + " },\n" + + " \"typeArguments\": [],\n" + + " \"typeVariableValues\": []\n" + + " },\n" + + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"name\": \"r\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"key\": {\n" + + " \"_type\": \"string\",\n" + + " \"value\": \"func\"\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + " }\n" + + " ],\n" + + " \"name\": \"new__Any_1_\",\n" + + " \"package\": \"test\",\n" + + " \"parameters\": [],\n" + + " \"postConstraints\": [],\n" + + " \"preConstraints\": [],\n" + + " \"returnGenericType\": {\n" + + " \"multiplicityArguments\": [],\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"Any\"\n" + + " },\n" + + " \"typeArguments\": [],\n" + + " \"typeVariableValues\": []\n" + + " },\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": [],\n" + + " \"tests\": []\n" + + " },\n" + + " {\n" + + " \"_type\": \"sectionIndex\",\n" + + " \"name\": \"SectionIndex\",\n" + + " \"package\": \"__internal__\",\n" + + " \"sections\": [\n" + + " {\n" + + " \"_type\": \"importAware\",\n" + + " \"elements\": [\n" + + " \"test::new__Any_1_\"\n" + + " ],\n" + + " \"imports\": [],\n" + + " \"parserName\": \"Pure\"\n" + + " }\n" + + " ]\n" + + " }\n" + + " ]\n" + + "}", + "function test::new(): Any[1]\n" + + "{\n" + + " ^BasicColumnSpecification(func=r: TDSRow[1]|1)\n" + + "}\n"); + } + @Test public void testFunctionTest() { 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 8036dd5a0ed..0dc3cc789ae 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 @@ -14,12 +14,29 @@ package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.util.StdConverter; +import org.eclipse.collections.api.factory.Lists; +import org.eclipse.collections.api.factory.Sets; +import org.eclipse.collections.api.set.FixedSizeSet; +import org.eclipse.collections.impl.utility.ListIterate; +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.Collection; +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.datatype.CString; +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.util.Collections; import java.util.List; +import java.util.Optional; +import java.util.Set; +@JsonDeserialize(converter = AppliedFunction.AppliedFunctionConverter.class) public class AppliedFunction extends AbstractAppliedFunction { public String function; @@ -31,4 +48,49 @@ public T accept(ValueSpecificationVisitor visitor) { return visitor.visit(this); } + + public static class AppliedFunctionConverter extends StdConverter + { + @Override + public AppliedFunction convert(AppliedFunction appliedFunction) + { + if (appliedFunction.function.equals("new")) + { + if (appliedFunction.parameters.get(0) instanceof PackageableElementPtr) + { + PackageableElementPtr type = (PackageableElementPtr) appliedFunction.parameters.get(0); + // Backward compatibility ------------------------------------------------------------------- + Set classesThatNeedTypeFixing = Sets.fixedSize.of( + "meta::pure::tds::BasicColumnSpecification", + "BasicColumnSpecification", + "meta::pure::tds::TdsOlapRank", + "TdsOlapRank" + ); + if (classesThatNeedTypeFixing.contains(type.fullPath)) + { + Collection collection = (Collection) appliedFunction.parameters.get(2); + Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(Lambda.class::isInstance) + .map(Lambda.class::cast) + .filter(x -> x.parameters.size() == 1); + + if (func.isPresent()) + { + Lambda l = func.get(); + + PackageableType rawType = new PackageableType(type.fullPath); + rawType.sourceInformation = type.sourceInformation; + List classType = Lists.mutable.of(new GenericType(rawType, Lists.mutable.with(l.parameters.get(0).genericType))); + GenericTypeInstance generic = new GenericTypeInstance(new GenericType(new PackageableType("meta::pure::metamodel::type::Class"), classType)); + appliedFunction.parameters.set(0, generic); + } + } + // Backward compatibility ------------------------------------------------------------------- + } + } + return appliedFunction; + } + } } From 38d9f412d94825104cabe5c273f3679851fcec9e Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Fri, 22 Nov 2024 19:29:43 -0500 Subject: [PATCH 02/17] Revert hardcoding cast --- .../pure/grammar/to/DEPRECATED_PureGrammarComposerCore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c1e24ebef89..d76eceb33db 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 @@ -782,7 +782,7 @@ else if ("letFunction".equals(function)) } else if ("cast".equals(function)) { - return possiblyAddParenthesis(parameters.get(0), this) + "->cast(@" + parameters.get(1).accept(this) + ")"; + return possiblyAddParenthesis(parameters.get(0), this) + "->" + _function + "(@" + parameters.get(1).accept(this) + ")"; } else if ("subType".equals(function)) { From 187c38f513239ba8979b401d29cf0cebfd667d7f Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Sat, 23 Nov 2024 12:30:57 -0500 Subject: [PATCH 03/17] Protocol fixing when parsing old grammar --- .../grammar/test/TestGrammarRoundtrip.java | 4 + .../roundtrip/TestDomainGrammarRoundtrip.java | 91 +++++++++++++++---- .../v1/model/valueSpecification/Variable.java | 17 +++- .../application/AppliedFunction.java | 68 ++++++++------ 4 files changed, 136 insertions(+), 44 deletions(-) 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/TestGrammarRoundtrip.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/TestGrammarRoundtrip.java index 3001358cb67..77933497a25 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/TestGrammarRoundtrip.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/TestGrammarRoundtrip.java @@ -152,6 +152,10 @@ private static void testFormat(String code, String unformattedCode, boolean omit { parsedModel = PureModelContextData.newPureModelContextData(parsedModel.getSerializer(), parsedModel.getOrigin(), LazyIterate.reject(parsedModel.getElements(), e -> e instanceof SectionIndex)); } + + // run json deserializer to apply protocol updates (migrate from old to new)... + parsedModel = ObjectMapperFactory.getNewStandardObjectMapperWithPureProtocolExtensionSupports().convertValue(parsedModel, PureModelContextData.class); + String formatted = grammarTransformer.renderPureModelContextData(parsedModel); Assert.assertEquals(code, formatted); // NOTE: do not remove the round-trip test for formatted code as this is a very good way to ensure that grammar <-> >protocol is bijective 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/TestDomainGrammarRoundtrip.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/TestDomainGrammarRoundtrip.java index 2eef4809fb8..50e008462f3 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/roundtrip/TestDomainGrammarRoundtrip.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/TestDomainGrammarRoundtrip.java @@ -512,7 +512,7 @@ public void testInFixFunctionAsParameter() } @Test - public void testNewConstructorWithTypeArgumentsIsBackwardCompatible() throws JsonProcessingException + public void testTypeArgumentsAreBackwardCompatibleForOldProtocolMissingIt() throws JsonProcessingException { testComposedGrammar("{\n" + " \"_type\": \"data\",\n" + @@ -603,21 +603,6 @@ public void testNewConstructorWithTypeArgumentsIsBackwardCompatible() throws Jso " \"stereotypes\": [],\n" + " \"taggedValues\": [],\n" + " \"tests\": []\n" + - " },\n" + - " {\n" + - " \"_type\": \"sectionIndex\",\n" + - " \"name\": \"SectionIndex\",\n" + - " \"package\": \"__internal__\",\n" + - " \"sections\": [\n" + - " {\n" + - " \"_type\": \"importAware\",\n" + - " \"elements\": [\n" + - " \"test::new__Any_1_\"\n" + - " ],\n" + - " \"imports\": [],\n" + - " \"parserName\": \"Pure\"\n" + - " }\n" + - " ]\n" + " }\n" + " ]\n" + "}", @@ -625,6 +610,80 @@ public void testNewConstructorWithTypeArgumentsIsBackwardCompatible() throws Jso "{\n" + " ^BasicColumnSpecification(func=r: TDSRow[1]|1)\n" + "}\n"); + + testComposedGrammar("{\n" + + " \"_type\": \"data\",\n" + + " \"elements\": [\n" + + " {\n" + + " \"_type\": \"function\",\n" + + " \"body\": [\n" + + " {\n" + + " \"_type\": \"integer\",\n" + + " \"value\": 1\n" + + " }\n" + + " ],\n" + + " \"name\": \"new_Result_1__Any_1_\",\n" + + " \"package\": \"test\",\n" + + " \"parameters\": [\n" + + " {\n" + + " \"_type\": \"var\",\n" + + // ---------- old variable type inside class property + " \"class\": \"Result\",\n" + + // ---------- old variable type inside class property + " \"multiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"name\": \"res\"\n" + + " }\n" + + " ],\n" + + " \"postConstraints\": [],\n" + + " \"preConstraints\": [],\n" + + " \"returnGenericType\": {\n" + + " \"multiplicityArguments\": [],\n" + + " \"rawType\": {\n" + + " \"_type\": \"packageableType\",\n" + + " \"fullPath\": \"Any\"\n" + + " },\n" + + " \"typeArguments\": [],\n" + + " \"typeVariableValues\": []\n" + + " },\n" + + " \"returnMultiplicity\": {\n" + + " \"lowerBound\": 1,\n" + + " \"upperBound\": 1\n" + + " },\n" + + " \"stereotypes\": [],\n" + + " \"taggedValues\": [],\n" + + " \"tests\": []\n" + + " }\n" + + " ]\n" + + "}", + "function test::new(res: Result[1]): Any[1]\n" + + "{\n" + + " 1\n" + + "}\n"); + } + + @Test + public void testTypeArgumentsAreBackwardCompatibleForOldGrammarMissingIt() throws JsonProcessingException + { + testFormat("function test::new(): Any[1]\n" + + "{\n" + + " ^BasicColumnSpecification(func=r: TDSRow[1]|1)\n" + + "}\n", + "function test::new(): Any[1]\n" + + "{\n" + + " ^BasicColumnSpecification(func=r: TDSRow[1]|1)\n" + + "}\n"); + + testFormat("function test::new(res: Result[1]): Any[1]\n" + + "{\n" + + " 1\n" + + "}\n", + "function test::new(res: Result[1]): Any[1]\n" + + "{\n" + + " 1\n" + + "}\n"); } @Test 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 b86bc90685c..0f3b4525226 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 @@ -73,7 +73,7 @@ public ValueSpecification deserialize(JsonParser jsonParser, DeserializationCont Variable variable = new Variable(); variable.name = node.get("name").asText(); - // Backward compatibility ------------------------------------------------------------------- + // Backward compatibility - old protocol ------------------------------------------------------------------- if (node.get("class") != null) { String _class = node.get("class").asText(); @@ -85,11 +85,24 @@ public ValueSpecification deserialize(JsonParser jsonParser, DeserializationCont } variable.genericType = genericType; } - // Backward compatibility ------------------------------------------------------------------- + // Backward compatibility - old protocol ------------------------------------------------------------------- else if (node.get("genericType") != null) { variable.genericType = om.treeToValue(node.get("genericType"), GenericType.class); + + // Backward compatibility - old grammar ------------------------------------------------------------------- + if (variable.genericType.rawType instanceof PackageableType) + { + String _class = ((PackageableType) variable.genericType.rawType).fullPath; + if (("meta::pure::mapping::Result".equals(_class) || "Result".equals(_class)) && variable.genericType.typeArguments.size() == 0) + { + variable.genericType.typeArguments = Lists.mutable.of(new GenericType(new PackageableType("meta::pure::metamodel::type::Any"))); + variable.genericType.multiplicityArguments = Lists.mutable.of(Multiplicity.PURE_MANY); + } + } + // Backward compatibility - old grammar ------------------------------------------------------------------- + } if (node.get("multiplicity") != null) { 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 0dc3cc789ae..e03f00b8fbc 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 @@ -54,42 +54,58 @@ public static class AppliedFunctionConverter extends StdConverter classesThatNeedTypeFixing = Sets.fixedSize.of( - "meta::pure::tds::BasicColumnSpecification", - "BasicColumnSpecification", - "meta::pure::tds::TdsOlapRank", - "TdsOlapRank" - ); - if (classesThatNeedTypeFixing.contains(type.fullPath)) + type = (PackageableElementPtr) appliedFunction.parameters.get(0); + } + else + { + GenericTypeInstance typeInstance = (GenericTypeInstance) appliedFunction.parameters.get(0); + // Backward compatibility - old grammar ------------------------------------------------------------------- + if (typeInstance.genericType.typeArguments.size() == 1 && typeInstance.genericType.typeArguments.get(0).rawType instanceof PackageableType) { - Collection collection = (Collection) appliedFunction.parameters.get(2); - Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) - .map(KeyExpression.class::cast) - .map(x -> x.expression) - .filter(Lambda.class::isInstance) - .map(Lambda.class::cast) - .filter(x -> x.parameters.size() == 1); + type = (PackageableType) typeInstance.genericType.typeArguments.get(0).rawType; + } + else + { + return appliedFunction; + } + } + + Set classesThatNeedTypeFixing = Sets.fixedSize.of( + "meta::pure::tds::BasicColumnSpecification", + "BasicColumnSpecification", + "meta::pure::tds::TdsOlapRank", + "TdsOlapRank" + ); + if (classesThatNeedTypeFixing.contains(type.fullPath)) + { + Collection collection = (Collection) appliedFunction.parameters.get(2); + Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(Lambda.class::isInstance) + .map(Lambda.class::cast) + .filter(x -> x.parameters.size() == 1); - if (func.isPresent()) - { - Lambda l = func.get(); + if (func.isPresent()) + { + Lambda l = func.get(); - PackageableType rawType = new PackageableType(type.fullPath); - rawType.sourceInformation = type.sourceInformation; - List classType = Lists.mutable.of(new GenericType(rawType, Lists.mutable.with(l.parameters.get(0).genericType))); - GenericTypeInstance generic = new GenericTypeInstance(new GenericType(new PackageableType("meta::pure::metamodel::type::Class"), classType)); - appliedFunction.parameters.set(0, generic); - } + PackageableType rawType = new PackageableType(type.fullPath); + rawType.sourceInformation = type.sourceInformation; + List classType = Lists.mutable.of(new GenericType(rawType, Lists.mutable.with(l.parameters.get(0).genericType))); + GenericTypeInstance generic = new GenericTypeInstance(new GenericType(new PackageableType("meta::pure::metamodel::type::Class"), classType)); + appliedFunction.parameters.set(0, generic); } - // Backward compatibility ------------------------------------------------------------------- } } + // Backward compatibility ------------------------------------------------------------------- return appliedFunction; } } From 6406fc79e70b325bf06c0bd55147a71de4b97709 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Sat, 23 Nov 2024 20:55:42 -0500 Subject: [PATCH 04/17] Protocol fixing when parsing old grammar --- .../protocol/pure/v1/model/valueSpecification/Variable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0f3b4525226..2cef81ec1d6 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 @@ -92,7 +92,7 @@ else if (node.get("genericType") != null) variable.genericType = om.treeToValue(node.get("genericType"), GenericType.class); // Backward compatibility - old grammar ------------------------------------------------------------------- - if (variable.genericType.rawType instanceof PackageableType) + if (variable.genericType != null && variable.genericType.rawType instanceof PackageableType) { String _class = ((PackageableType) variable.genericType.rawType).fullPath; if (("meta::pure::mapping::Result".equals(_class) || "Result".equals(_class)) && variable.genericType.typeArguments.size() == 0) From 994648807b0909f570bc7a960b8c9d5862c288a4 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Mon, 25 Nov 2024 13:23:26 -0500 Subject: [PATCH 05/17] Introduce mechanism to do protocol conversion --- .../grammar/test/TestGrammarRoundtrip.java | 18 ++- .../roundtrip/TestDomainGrammarRoundtrip.java | 45 +++++- .../pure/v1/CorePureProtocolExtension.java | 150 +++++++++++++++++- .../v1/PureProtocolObjectMapperFactory.java | 123 +++++++++++++- .../pure/v1/extension/ProtocolConverter.java | 63 ++++++++ .../v1/extension/PureProtocolExtension.java | 5 + .../v1/model/valueSpecification/Variable.java | 13 -- .../application/AppliedFunction.java | 76 ++++----- .../shared/core/ObjectMapperFactory.java | 5 + 9 files changed, 419 insertions(+), 79 deletions(-) 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/extension/ProtocolConverter.java 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/TestGrammarRoundtrip.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/TestGrammarRoundtrip.java index 77933497a25..6b193a4dc12 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/TestGrammarRoundtrip.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/TestGrammarRoundtrip.java @@ -120,12 +120,17 @@ private static void test(String code, String message, boolean keepSectionIndex) public static void testFormatWithSectionInfoPreserved(String code, String unformattedCode) { - testFormat(code, unformattedCode, false); + testFormat(code, unformattedCode, false, false); } public static void testFormat(String code, String unformattedCode) { - testFormat(code, unformattedCode, true); + testFormat(code, unformattedCode, true, false); + } + + public static void testConvert(String code, String unformattedCode) + { + testFormat(code, unformattedCode, true, true); } /** @@ -143,7 +148,7 @@ public static void testFormat(String code, String unformattedCode) * ... * // end of example */ - private static void testFormat(String code, String unformattedCode, boolean omitSectionIndex) + private static void testFormat(String code, String unformattedCode, boolean omitSectionIndex, boolean withConvert) { PureGrammarComposer grammarTransformer = PureGrammarComposer.newInstance(PureGrammarComposerContext.Builder.newInstance().build()); // NOTE: no need to get source information @@ -153,8 +158,11 @@ private static void testFormat(String code, String unformattedCode, boolean omit parsedModel = PureModelContextData.newPureModelContextData(parsedModel.getSerializer(), parsedModel.getOrigin(), LazyIterate.reject(parsedModel.getElements(), e -> e instanceof SectionIndex)); } - // run json deserializer to apply protocol updates (migrate from old to new)... - parsedModel = ObjectMapperFactory.getNewStandardObjectMapperWithPureProtocolExtensionSupports().convertValue(parsedModel, PureModelContextData.class); + if (withConvert) + { + // run json deserializer to apply protocol updates (migrate from old to new)... + parsedModel = ObjectMapperFactory.getNewStandardObjectMapperWithPureProtocolConverterSupports().convertValue(parsedModel, PureModelContextData.class); + } String formatted = grammarTransformer.renderPureModelContextData(parsedModel); Assert.assertEquals(code, formatted); 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/TestDomainGrammarRoundtrip.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/TestDomainGrammarRoundtrip.java index 50e008462f3..9af1f1935aa 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/roundtrip/TestDomainGrammarRoundtrip.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/TestDomainGrammarRoundtrip.java @@ -665,18 +665,53 @@ public void testTypeArgumentsAreBackwardCompatibleForOldProtocolMissingIt() thro } @Test - public void testTypeArgumentsAreBackwardCompatibleForOldGrammarMissingIt() throws JsonProcessingException + public void testConvertBasicColumnSpecification() { - testFormat("function test::new(): Any[1]\n" + + testConvert("function test::new(): Any[1]\n" + "{\n" + - " ^BasicColumnSpecification(func=r: TDSRow[1]|1)\n" + + " meta::pure::tds::col(r: TDSRow[1]|1, 'hello')\n" + "}\n", "function test::new(): Any[1]\n" + "{\n" + - " ^BasicColumnSpecification(func=r: TDSRow[1]|1)\n" + + " ^BasicColumnSpecification(func=r: TDSRow[1]|1, name='hello')\n" + "}\n"); - testFormat("function test::new(res: Result[1]): Any[1]\n" + + testConvert("function test::new(): Any[1]\n" + + "{\n" + + " meta::pure::tds::col(r: TDSRow[1]|1, 'hello', 'documentation here')\n" + + "}\n", + "function test::new(): Any[1]\n" + + "{\n" + + " ^meta::pure::tds::BasicColumnSpecification(documentation='documentation here', func=r: TDSRow[1]|1, name='hello')\n" + + "}\n"); + } + + @Test + public void testConvertTdsOlapRank() + { + testConvert("function test::new(): Any[1]\n" + + "{\n" + + " meta::pure::tds::func(r: TDSRow[1]|1)\n" + + "}\n", + "function test::new(): Any[1]\n" + + "{\n" + + " ^meta::pure::tds::TdsOlapRank(func=r: TDSRow[1]|1)\n" + + "}\n"); + + testConvert("function test::new(): Any[1]\n" + + "{\n" + + " meta::pure::tds::func(r: TDSRow[1]|1)\n" + + "}\n", + "function test::new(): Any[1]\n" + + "{\n" + + " ^TdsOlapRank(func=r: TDSRow[1]|1)\n" + + "}\n"); + } + + @Test + public void testConvertResult() + { + testConvert("function test::new(res: Result[1]): Any[1]\n" + "{\n" + " 1\n" + "}\n", 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/CorePureProtocolExtension.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/CorePureProtocolExtension.java index be0ff35841a..0c7faa0d09c 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/CorePureProtocolExtension.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/CorePureProtocolExtension.java @@ -14,10 +14,18 @@ package org.finos.legend.engine.protocol.pure.v1; +import com.fasterxml.jackson.databind.util.StdConverter; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import org.eclipse.collections.api.block.function.Function0; import org.eclipse.collections.api.factory.Lists; import org.eclipse.collections.api.factory.Maps; +import org.eclipse.collections.api.factory.Sets; import org.eclipse.collections.api.list.MutableList; +import org.eclipse.collections.impl.utility.ListIterate; +import org.finos.legend.engine.protocol.pure.v1.extension.ProtocolConverter; import org.finos.legend.engine.protocol.pure.v1.extension.ProtocolSubTypeInfo; import org.finos.legend.engine.protocol.pure.v1.extension.PureProtocolExtension; import org.finos.legend.engine.protocol.pure.v1.model.data.DataElementReference; @@ -42,6 +50,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Enumeration; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Measure; +import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Multiplicity; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Profile; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.externalFormat.Binding; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.externalFormat.ExternalFormatSchemaSet; @@ -71,9 +80,15 @@ import org.finos.legend.engine.protocol.pure.v1.model.test.result.TestExecuted; import org.finos.legend.engine.protocol.pure.v1.model.test.result.TestExecutionPlanDebug; import org.finos.legend.engine.protocol.pure.v1.model.test.result.TestResult; - -import java.util.List; -import java.util.Map; +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.application.AppliedFunction; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Collection; +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.datatype.CString; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.GenericTypeInstance; public class CorePureProtocolExtension implements PureProtocolExtension { @@ -180,4 +195,133 @@ public Map, String> getExtraProtoc .withKeyValue(SectionIndex.class, "meta::pure::metamodel::section::SectionIndex") .withKeyValue(RelationalMapper.class, "meta::relational::metamodel::RelationalMapper"); } + + @Override + public List> getConverterDeserializers() + { + return Lists.fixedSize.with( + new ProtocolConverter<>(new ResultVariableWithMissingTypeConverter()), + new ProtocolConverter<>( + Lists.mutable.with( + new BasicColumnSpecificationToColFunctionConverter(), + new TdsOlapRankToColFunctionConverter())) + ); + } + + private static class ResultVariableWithMissingTypeConverter extends StdConverter + { + @Override + public Variable convert(Variable variable) + { + if (variable.genericType != null && variable.genericType.rawType instanceof PackageableType) + { + String _class = ((PackageableType) variable.genericType.rawType).fullPath; + if (("meta::pure::mapping::Result".equals(_class) || "Result".equals(_class)) && variable.genericType.typeArguments.size() == 0) + { + variable.genericType.typeArguments = Lists.mutable.of(new GenericType(new PackageableType("meta::pure::metamodel::type::Any"))); + variable.genericType.multiplicityArguments = Lists.mutable.of(Multiplicity.PURE_MANY); + } + } + return variable; + } + } + + private static class BasicColumnSpecificationToColFunctionConverter extends StdConverter + { + @Override + public AppliedFunction convert(AppliedFunction appliedFunction) + { + if (appliedFunction.function.equals("new")) + { + GenericTypeInstance typeInstance = (GenericTypeInstance) appliedFunction.parameters.get(0); + if (typeInstance.genericType.typeArguments.size() >= 1 && typeInstance.genericType.typeArguments.get(0).rawType instanceof PackageableType) + { + PackageableType type = (PackageableType) typeInstance.genericType.typeArguments.get(0).rawType; + + Set classesThatNeedTypeFixing = Sets.fixedSize.of( + "meta::pure::tds::BasicColumnSpecification", + "BasicColumnSpecification" + ); + + if (classesThatNeedTypeFixing.contains(type.fullPath)) + { + Collection collection = (Collection) appliedFunction.parameters.get(2); + Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(Lambda.class::isInstance) + .map(Lambda.class::cast); + + Optional name = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("name")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(CString.class::isInstance) + .map(CString.class::cast); + + Optional doc = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("documentation")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(CString.class::isInstance) + .map(CString.class::cast); + + if (func.isPresent() && name.isPresent()) + { + appliedFunction.function = "meta::pure::tds::col"; + appliedFunction.parameters = Lists.mutable.with(func.get(), name.get()); + + if (doc.isPresent()) + { + appliedFunction.fControl = "meta::pure::tds::col_Function_1__String_1__String_1__BasicColumnSpecification_1_"; + appliedFunction.parameters.add(doc.get()); + } + else + { + appliedFunction.fControl = "meta::pure::tds::col_Function_1__String_1__BasicColumnSpecification_1_"; + } + } + } + } + } + return appliedFunction; + } + } + + private static class TdsOlapRankToColFunctionConverter extends StdConverter + { + @Override + public AppliedFunction convert(AppliedFunction appliedFunction) + { + if (appliedFunction.function.equals("new")) + { + GenericTypeInstance typeInstance = (GenericTypeInstance) appliedFunction.parameters.get(0); + if (typeInstance.genericType.typeArguments.size() >= 1 && typeInstance.genericType.typeArguments.get(0).rawType instanceof PackageableType) + { + PackageableType type = (PackageableType) typeInstance.genericType.typeArguments.get(0).rawType; + + Set classesThatNeedTypeFixing = Sets.fixedSize.of( + "meta::pure::tds::TdsOlapRank", + "TdsOlapRank" + ); + + if (classesThatNeedTypeFixing.contains(type.fullPath)) + { + Collection collection = (Collection) appliedFunction.parameters.get(2); + Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(Lambda.class::isInstance) + .map(Lambda.class::cast); + + if (func.isPresent()) + { + appliedFunction.function = "meta::pure::tds::func"; + appliedFunction.fControl = "meta::pure::tds::func_FunctionDefinition_1__TdsOlapRank_1_"; + appliedFunction.parameters = Lists.mutable.with(func.get()); + } + } + } + } + return appliedFunction; + } + } } 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/PureProtocolObjectMapperFactory.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/PureProtocolObjectMapperFactory.java index 864ad077362..5d6c11c0474 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/PureProtocolObjectMapperFactory.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/PureProtocolObjectMapperFactory.java @@ -14,13 +14,41 @@ package org.finos.legend.engine.protocol.pure.v1; +import com.fasterxml.jackson.databind.BeanDescription; +import com.fasterxml.jackson.databind.DeserializationConfig; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.KeyDeserializer; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.cfg.HandlerInstantiator; import com.fasterxml.jackson.databind.cfg.MapperBuilder; +import com.fasterxml.jackson.databind.cfg.MapperConfig; +import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier; +import com.fasterxml.jackson.databind.deser.std.StdDelegatingDeserializer; +import com.fasterxml.jackson.databind.introspect.Annotated; import com.fasterxml.jackson.databind.jsontype.NamedType; +import com.fasterxml.jackson.databind.jsontype.TypeIdResolver; +import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.databind.type.TypeFactory; +import com.fasterxml.jackson.databind.util.ClassUtil; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.Predicate; +import java.util.stream.Collectors; import org.eclipse.collections.api.block.function.Function0; import org.eclipse.collections.api.factory.Maps; +import org.eclipse.collections.api.list.MutableList; +import org.eclipse.collections.impl.multimap.list.FastListMultimap; import org.eclipse.collections.impl.utility.LazyIterate; +import org.eclipse.collections.impl.utility.ListIterate; +import org.finos.legend.engine.protocol.pure.v1.extension.ProtocolConverter; import org.finos.legend.engine.protocol.pure.v1.extension.ProtocolSubTypeInfo; import org.finos.legend.engine.protocol.pure.v1.extension.PureProtocolExtension; import org.finos.legend.engine.protocol.pure.v1.extension.PureProtocolExtensionLoader; @@ -41,12 +69,6 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.ColSpecArray; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.classInstance.relation.RelationStoreAccessor; -import java.util.Collection; -import java.util.Map; -import java.util.Set; -import java.util.function.BiConsumer; -import java.util.function.Predicate; - public class PureProtocolObjectMapperFactory { public static > T withPureProtocolExtensions(T mapperBuilder) @@ -158,4 +180,93 @@ public static ObjectMapper getNewObjectMapper(Set excludedSubTypes) { return withPureProtocolExtensions(new ObjectMapper(), excludedSubTypes); } + + public static ObjectMapper withPureProtocolConverter(ObjectMapper objectMapper) + { + ObjectMapper withPureProtocolExtensions = withPureProtocolExtensions(objectMapper); + + List> protocolConverters = PureProtocolExtensionLoader.extensions().stream() + .map(PureProtocolExtension::getConverterDeserializers) + .filter(Objects::nonNull) + .flatMap(List::stream) + .collect(Collectors.toList()); + + FastListMultimap> converterByType = ListIterate.groupBy(protocolConverters, x -> x.getInputType(TypeFactory.defaultInstance())); + + DeserializationConfig deserializationConfig = withPureProtocolExtensions + .getDeserializationConfig() + .with(new ConverterHandlerInstantiator(converterByType)); + + SimpleModule module = new SimpleModule("protocol converters"); + module.setDeserializerModifier(new ConverterBeanDeserializerModifier(converterByType)); + + return withPureProtocolExtensions.setConfig(deserializationConfig).registerModule(module); + } + + private static class ConverterHandlerInstantiator extends HandlerInstantiator + { + private final FastListMultimap> converterByType; + + public ConverterHandlerInstantiator(FastListMultimap> converterByType) + { + this.converterByType = converterByType; + } + + @Override + public JsonDeserializer deserializerInstance(DeserializationConfig config, Annotated annotated, Class deserClass) + { + MutableList> converters = this.converterByType.get(annotated.getType()); + if (!converters.isEmpty()) + { + JsonDeserializer deser = (JsonDeserializer) ClassUtil.createInstance(deserClass, config.canOverrideAccessModifiers()); + return new StdDelegatingDeserializer<>(ProtocolConverter.merge((List) converters), annotated.getType(), deser); + } + return null; + } + + @Override + public KeyDeserializer keyDeserializerInstance(DeserializationConfig config, Annotated annotated, Class keyDeserClass) + { + return null; + } + + @Override + public JsonSerializer serializerInstance(com.fasterxml.jackson.databind.SerializationConfig config, Annotated annotated, Class serClass) + { + return null; + } + + @Override + public TypeResolverBuilder typeResolverBuilderInstance(MapperConfig config, Annotated annotated, Class builderClass) + { + return null; + } + + @Override + public TypeIdResolver typeIdResolverInstance(MapperConfig config, Annotated annotated, Class resolverClass) + { + return null; + } + } + + private static class ConverterBeanDeserializerModifier extends BeanDeserializerModifier + { + private final FastListMultimap> converterByType; + + public ConverterBeanDeserializerModifier(FastListMultimap> converterByType) + { + this.converterByType = converterByType; + } + + @Override + public JsonDeserializer modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer deserializer) + { + MutableList> converters = this.converterByType.get(beanDesc.getType()); + if (!converters.isEmpty()) + { + return new StdDelegatingDeserializer(ProtocolConverter.merge((List) converters), beanDesc.getType(), deserializer); + } + return deserializer; + } + } } 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/extension/ProtocolConverter.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/extension/ProtocolConverter.java new file mode 100644 index 00000000000..2cf4daa96a2 --- /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/extension/ProtocolConverter.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.protocol.pure.v1.extension; + +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.type.TypeFactory; +import com.fasterxml.jackson.databind.util.Converter; +import java.util.List; +import java.util.stream.Collectors; +import org.eclipse.collections.impl.factory.Lists; +import org.eclipse.collections.impl.utility.ListIterate; + +public class ProtocolConverter implements Converter +{ + private final List> converters; + + public ProtocolConverter(Converter converters) + { + this(Lists.fixedSize.of(converters)); + } + + public ProtocolConverter(List> converters) + { + this.converters = converters; + } + + @Override + public JavaType getInputType(TypeFactory typeFactory) + { + return this.converters.get(0).getInputType(typeFactory); + } + + @Override + public JavaType getOutputType(TypeFactory typeFactory) + { + return this.converters.get(0).getOutputType(typeFactory); + } + + @Override + public T convert(T value) + { + return ListIterate.injectInto(value, this.converters, (t, c) -> c.convert(t)); + } + + public static ProtocolConverter merge(List> converters) + { + List> allConverters = converters.stream().flatMap(x -> x.converters.stream()).collect(Collectors.toList()); + return new ProtocolConverter<>(allConverters); + } +} 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/extension/PureProtocolExtension.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/extension/PureProtocolExtension.java index 4913301d80a..3ca9aab7f8a 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/extension/PureProtocolExtension.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/extension/PureProtocolExtension.java @@ -15,6 +15,7 @@ package org.finos.legend.engine.protocol.pure.v1.extension; import org.eclipse.collections.api.block.function.Function0; +import org.eclipse.collections.impl.factory.Lists; import org.eclipse.collections.impl.factory.Maps; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; import org.finos.legend.engine.shared.core.extension.LegendLanguageExtension; @@ -47,4 +48,8 @@ default Map getExtraClassInstanceTypeMappings() return Maps.mutable.empty(); } + default List> getConverterDeserializers() + { + return Lists.fixedSize.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/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 2cef81ec1d6..e97a3ead7ce 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 @@ -90,19 +90,6 @@ public ValueSpecification deserialize(JsonParser jsonParser, DeserializationCont else if (node.get("genericType") != null) { variable.genericType = om.treeToValue(node.get("genericType"), GenericType.class); - - // Backward compatibility - old grammar ------------------------------------------------------------------- - if (variable.genericType != null && variable.genericType.rawType instanceof PackageableType) - { - String _class = ((PackageableType) variable.genericType.rawType).fullPath; - if (("meta::pure::mapping::Result".equals(_class) || "Result".equals(_class)) && variable.genericType.typeArguments.size() == 0) - { - variable.genericType.typeArguments = Lists.mutable.of(new GenericType(new PackageableType("meta::pure::metamodel::type::Any"))); - variable.genericType.multiplicityArguments = Lists.mutable.of(Multiplicity.PURE_MANY); - } - } - // Backward compatibility - old grammar ------------------------------------------------------------------- - } if (node.get("multiplicity") != null) { 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 e03f00b8fbc..9356bcdc45b 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,9 +16,12 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.util.StdConverter; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.Set; import org.eclipse.collections.api.factory.Lists; import org.eclipse.collections.api.factory.Sets; -import org.eclipse.collections.api.set.FixedSizeSet; import org.eclipse.collections.impl.utility.ListIterate; import org.finos.legend.engine.protocol.pure.v1.model.type.GenericType; import org.finos.legend.engine.protocol.pure.v1.model.type.PackageableType; @@ -31,11 +34,6 @@ 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.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.Set; - @JsonDeserialize(converter = AppliedFunction.AppliedFunctionConverter.class) public class AppliedFunction extends AbstractAppliedFunction { @@ -54,58 +52,42 @@ public static class AppliedFunctionConverter extends StdConverter classesThatNeedTypeFixing = Sets.fixedSize.of( - "meta::pure::tds::BasicColumnSpecification", - "BasicColumnSpecification", - "meta::pure::tds::TdsOlapRank", - "TdsOlapRank" - ); - if (classesThatNeedTypeFixing.contains(type.fullPath)) - { - Collection collection = (Collection) appliedFunction.parameters.get(2); - Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) - .map(KeyExpression.class::cast) - .map(x -> x.expression) - .filter(Lambda.class::isInstance) - .map(Lambda.class::cast) - .filter(x -> x.parameters.size() == 1); + PackageableElementPtr packageableElementPtr = (PackageableElementPtr) appliedFunction.parameters.get(0); - if (func.isPresent()) + Set classesThatNeedTypeFixing = Sets.fixedSize.of( + "meta::pure::tds::BasicColumnSpecification", + "BasicColumnSpecification", + "meta::pure::tds::TdsOlapRank", + "TdsOlapRank" + ); + if (classesThatNeedTypeFixing.contains(packageableElementPtr.fullPath)) { - Lambda l = func.get(); + Collection collection = (Collection) appliedFunction.parameters.get(2); + Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(Lambda.class::isInstance) + .map(Lambda.class::cast) + .filter(x -> x.parameters.size() == 1); - PackageableType rawType = new PackageableType(type.fullPath); - rawType.sourceInformation = type.sourceInformation; - List classType = Lists.mutable.of(new GenericType(rawType, Lists.mutable.with(l.parameters.get(0).genericType))); - GenericTypeInstance generic = new GenericTypeInstance(new GenericType(new PackageableType("meta::pure::metamodel::type::Class"), classType)); - appliedFunction.parameters.set(0, generic); + if (func.isPresent()) + { + Lambda l = func.get(); + PackageableType rawType = new PackageableType(packageableElementPtr.fullPath); + rawType.sourceInformation = packageableElementPtr.sourceInformation; + List classType = Lists.mutable.of(new GenericType(rawType, Lists.mutable.with(l.parameters.get(0).genericType))); + GenericTypeInstance generic = new GenericTypeInstance(new GenericType(new PackageableType("meta::pure::metamodel::type::Class"), classType)); + appliedFunction.parameters.set(0, generic); + } } } + // Backward compatibility ------------------------------------------------------------------- } - // Backward compatibility ------------------------------------------------------------------- return appliedFunction; } } diff --git a/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/java/org/finos/legend/engine/shared/core/ObjectMapperFactory.java b/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/java/org/finos/legend/engine/shared/core/ObjectMapperFactory.java index ead31e1cc3b..ba623662613 100644 --- a/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/java/org/finos/legend/engine/shared/core/ObjectMapperFactory.java +++ b/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/java/org/finos/legend/engine/shared/core/ObjectMapperFactory.java @@ -46,4 +46,9 @@ public static ObjectMapper getNewStandardObjectMapperWithPureProtocolExtensionSu { return withStandardConfigurations(PureProtocolObjectMapperFactory.withPureProtocolExtensions(new ObjectMapper())); } + + public static ObjectMapper getNewStandardObjectMapperWithPureProtocolConverterSupports() + { + return withStandardConfigurations(PureProtocolObjectMapperFactory.withPureProtocolConverter(new ObjectMapper())); + } } From 620256b251fd1c546cc7658757350e90cc297c20 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Mon, 25 Nov 2024 18:25:32 -0500 Subject: [PATCH 06/17] Run converters on standard deserializer flow + during parsing --- .../pom.xml | 2 - .../pure/grammar/from/PureGrammarParser.java | 8 +- .../grammar/test/TestGrammarRoundtrip.java | 17 +- .../roundtrip/TestDomainGrammarRoundtrip.java | 78 ++++----- .../pure/v1/CorePureProtocolExtension.java | 164 +++++++++++------- .../v1/PureProtocolObjectMapperFactory.java | 8 +- .../v1/extension/PureProtocolExtension.java | 2 +- .../v1/model/valueSpecification/Variable.java | 8 +- .../application/AppliedFunction.java | 61 ------- .../shared/core/ObjectMapperFactory.java | 15 +- 10 files changed, 162 insertions(+), 201 deletions(-) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/pom.xml b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/pom.xml index 24f772691a6..c0b234701a5 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/pom.xml +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/pom.xml @@ -154,12 +154,10 @@ com.fasterxml.jackson.core jackson-databind - test com.fasterxml.jackson.core jackson-core - test 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 01025cf72ab..2d908aaf024 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 @@ -14,6 +14,7 @@ package org.finos.legend.engine.language.pure.grammar.from; +import com.fasterxml.jackson.databind.ObjectMapper; import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; import org.eclipse.collections.api.factory.Lists; @@ -37,6 +38,7 @@ 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.protocol.pure.v1.model.valueSpecification.raw.classInstance.graph.RootGraphFetchTree; +import org.finos.legend.engine.shared.core.ObjectMapperFactory; import org.finos.legend.engine.shared.core.identity.Identity; import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; import org.finos.legend.engine.shared.core.operational.logs.LogInfo; @@ -52,6 +54,7 @@ public class PureGrammarParser private final DEPRECATED_PureGrammarParserLibrary parsers; private final PureGrammarParserExtensions extensions; + private ObjectMapper converterMapper; private PureGrammarParser(PureGrammarParserExtensions extensions) { @@ -63,6 +66,7 @@ private PureGrammarParser(PureGrammarParserExtensions extensions) connectionParser, RuntimeParser.newInstance(connectionParser) )); + this.converterMapper = ObjectMapperFactory.getNewStandardObjectMapperWithPureProtocolExtensionSupports(); } public static PureGrammarParser newInstance(PureGrammarParserExtensions extensions) @@ -127,7 +131,9 @@ private PureModelContextData parse(String code, DEPRECATED_PureGrammarParserLibr sectionIndex.name = "SectionIndex"; sectionIndex._package = "__internal__"; sectionIndex.sections = ListIterate.collect(parser.definition().section(), sectionCtx -> this.visitSection(sectionCtx, parserLibrary, walkerSourceInformation, parserContext, builder::addElement, returnSourceInfo)); - return builder.withElement(sectionIndex).build(); + // tactically run parsed values thru converters to fix old/legacy code + PureModelContextData pmcd = builder.withElement(sectionIndex).build(); + return this.converterMapper.convertValue(pmcd, PureModelContextData.class); } private Section visitSection(CodeParserGrammar.SectionContext ctx, DEPRECATED_PureGrammarParserLibrary parserLibrary, ParseTreeWalkerSourceInformation walkerSourceInformation, PureGrammarParserContext parserContext, Consumer elementConsumer, boolean returnSourceInfo) 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/TestGrammarRoundtrip.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/TestGrammarRoundtrip.java index 6b193a4dc12..c3c3d5b7f37 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/TestGrammarRoundtrip.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/TestGrammarRoundtrip.java @@ -120,17 +120,12 @@ private static void test(String code, String message, boolean keepSectionIndex) public static void testFormatWithSectionInfoPreserved(String code, String unformattedCode) { - testFormat(code, unformattedCode, false, false); + testFormat(code, unformattedCode, false); } public static void testFormat(String code, String unformattedCode) { - testFormat(code, unformattedCode, true, false); - } - - public static void testConvert(String code, String unformattedCode) - { - testFormat(code, unformattedCode, true, true); + testFormat(code, unformattedCode, true); } /** @@ -148,7 +143,7 @@ public static void testConvert(String code, String unformattedCode) * ... * // end of example */ - private static void testFormat(String code, String unformattedCode, boolean omitSectionIndex, boolean withConvert) + private static void testFormat(String code, String unformattedCode, boolean omitSectionIndex) { PureGrammarComposer grammarTransformer = PureGrammarComposer.newInstance(PureGrammarComposerContext.Builder.newInstance().build()); // NOTE: no need to get source information @@ -158,12 +153,6 @@ private static void testFormat(String code, String unformattedCode, boolean omit parsedModel = PureModelContextData.newPureModelContextData(parsedModel.getSerializer(), parsedModel.getOrigin(), LazyIterate.reject(parsedModel.getElements(), e -> e instanceof SectionIndex)); } - if (withConvert) - { - // run json deserializer to apply protocol updates (migrate from old to new)... - parsedModel = ObjectMapperFactory.getNewStandardObjectMapperWithPureProtocolConverterSupports().convertValue(parsedModel, PureModelContextData.class); - } - String formatted = grammarTransformer.renderPureModelContextData(parsedModel); Assert.assertEquals(code, formatted); // NOTE: do not remove the round-trip test for formatted code as this is a very good way to ensure that grammar <-> >protocol is bijective 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/TestDomainGrammarRoundtrip.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/TestDomainGrammarRoundtrip.java index 9af1f1935aa..fed2eb6e836 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/roundtrip/TestDomainGrammarRoundtrip.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/TestDomainGrammarRoundtrip.java @@ -527,7 +527,7 @@ public void testTypeArgumentsAreBackwardCompatibleForOldProtocolMissingIt() thro " {\n" + // ---------- type to construct, no type arguments " \"_type\": \"packageableElementPtr\",\n" + - " \"fullPath\": \"BasicColumnSpecification\"\n" + + " \"fullPath\": \"TdsOlapRank\"\n" + // ---------- type to construct, no type arguments " },\n" + " {\n" + @@ -608,7 +608,7 @@ public void testTypeArgumentsAreBackwardCompatibleForOldProtocolMissingIt() thro "}", "function test::new(): Any[1]\n" + "{\n" + - " ^BasicColumnSpecification(func=r: TDSRow[1]|1)\n" + + " meta::pure::tds::func(r: TDSRow[1]|1)\n" + "}\n"); testComposedGrammar("{\n" + @@ -667,58 +667,58 @@ public void testTypeArgumentsAreBackwardCompatibleForOldProtocolMissingIt() thro @Test public void testConvertBasicColumnSpecification() { - testConvert("function test::new(): Any[1]\n" + - "{\n" + - " meta::pure::tds::col(r: TDSRow[1]|1, 'hello')\n" + - "}\n", + testFormat("function test::new(): Any[1]\n" + + "{\n" + + " meta::pure::tds::col(r: TDSRow[1]|1, 'hello')\n" + + "}\n", "function test::new(): Any[1]\n" + - "{\n" + - " ^BasicColumnSpecification(func=r: TDSRow[1]|1, name='hello')\n" + - "}\n"); - - testConvert("function test::new(): Any[1]\n" + - "{\n" + - " meta::pure::tds::col(r: TDSRow[1]|1, 'hello', 'documentation here')\n" + - "}\n", + "{\n" + + " ^BasicColumnSpecification(func=r: TDSRow[1]|1, name='hello')\n" + + "}\n"); + + testFormat("function test::new(): Any[1]\n" + + "{\n" + + " meta::pure::tds::col(r: TDSRow[1]|1, 'hello', 'documentation here')\n" + + "}\n", "function test::new(): Any[1]\n" + - "{\n" + - " ^meta::pure::tds::BasicColumnSpecification(documentation='documentation here', func=r: TDSRow[1]|1, name='hello')\n" + - "}\n"); + "{\n" + + " ^meta::pure::tds::BasicColumnSpecification(documentation='documentation here', func=r: TDSRow[1]|1, name='hello')\n" + + "}\n"); } @Test public void testConvertTdsOlapRank() { - testConvert("function test::new(): Any[1]\n" + - "{\n" + - " meta::pure::tds::func(r: TDSRow[1]|1)\n" + - "}\n", + testFormat("function test::new(): Any[1]\n" + + "{\n" + + " meta::pure::tds::func(r: TDSRow[1]|1)\n" + + "}\n", "function test::new(): Any[1]\n" + - "{\n" + - " ^meta::pure::tds::TdsOlapRank(func=r: TDSRow[1]|1)\n" + - "}\n"); - - testConvert("function test::new(): Any[1]\n" + - "{\n" + - " meta::pure::tds::func(r: TDSRow[1]|1)\n" + - "}\n", + "{\n" + + " ^meta::pure::tds::TdsOlapRank(func=r: TDSRow[1]|1)\n" + + "}\n"); + + testFormat("function test::new(): Any[1]\n" + + "{\n" + + " meta::pure::tds::func(r: TDSRow[1]|1)\n" + + "}\n", "function test::new(): Any[1]\n" + - "{\n" + - " ^TdsOlapRank(func=r: TDSRow[1]|1)\n" + - "}\n"); + "{\n" + + " ^TdsOlapRank(func=r: TDSRow[1]|1)\n" + + "}\n"); } @Test public void testConvertResult() { - testConvert("function test::new(res: Result[1]): Any[1]\n" + - "{\n" + - " 1\n" + - "}\n", + testFormat("function test::new(res: Result[1]): Any[1]\n" + + "{\n" + + " 1\n" + + "}\n", "function test::new(res: Result[1]): Any[1]\n" + - "{\n" + - " 1\n" + - "}\n"); + "{\n" + + " 1\n" + + "}\n"); } @Test 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/CorePureProtocolExtension.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/CorePureProtocolExtension.java index 0c7faa0d09c..0323e631578 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/CorePureProtocolExtension.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/CorePureProtocolExtension.java @@ -19,6 +19,8 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.collections.api.block.function.Function0; import org.eclipse.collections.api.factory.Lists; import org.eclipse.collections.api.factory.Maps; @@ -89,6 +91,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.Lambda; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype.CString; 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; public class CorePureProtocolExtension implements PureProtocolExtension { @@ -197,7 +200,7 @@ public Map, String> getExtraProtoc } @Override - public List> getConverterDeserializers() + public List> getProtocolConverters() { return Lists.fixedSize.with( new ProtocolConverter<>(new ResultVariableWithMissingTypeConverter()), @@ -208,6 +211,10 @@ public List> getConverterDeserializers() ); } + /** + * Converts/fix variables of type Result to ensure they have the type and multiplicity + * Result[1] -> Result<Any|*>[1] + */ private static class ResultVariableWithMissingTypeConverter extends StdConverter { @Override @@ -226,6 +233,10 @@ public Variable convert(Variable variable) } } + /** + * Convert the usage of BasicColumnSpecification to the equivalent function + * ^BasicColumnSpecification(...) == col(...) + */ private static class BasicColumnSpecificationToColFunctionConverter extends StdConverter { @Override @@ -233,52 +244,61 @@ public AppliedFunction convert(AppliedFunction appliedFunction) { if (appliedFunction.function.equals("new")) { - GenericTypeInstance typeInstance = (GenericTypeInstance) appliedFunction.parameters.get(0); - if (typeInstance.genericType.typeArguments.size() >= 1 && typeInstance.genericType.typeArguments.get(0).rawType instanceof PackageableType) - { - PackageableType type = (PackageableType) typeInstance.genericType.typeArguments.get(0).rawType; - - Set classesThatNeedTypeFixing = Sets.fixedSize.of( - "meta::pure::tds::BasicColumnSpecification", - "BasicColumnSpecification" - ); + PackageableElementPtr type; - if (classesThatNeedTypeFixing.contains(type.fullPath)) + if (appliedFunction.parameters.get(0) instanceof GenericTypeInstance) + { + GenericTypeInstance typeInstance = (GenericTypeInstance) appliedFunction.parameters.get(0); + if (typeInstance.genericType.typeArguments.size() >= 1 && typeInstance.genericType.typeArguments.get(0).rawType instanceof PackageableType) { - Collection collection = (Collection) appliedFunction.parameters.get(2); - Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) - .map(KeyExpression.class::cast) - .map(x -> x.expression) - .filter(Lambda.class::isInstance) - .map(Lambda.class::cast); + type = (PackageableType) typeInstance.genericType.typeArguments.get(0).rawType; + } + else + { + return appliedFunction; + } + } + else if (appliedFunction.parameters.get(0) instanceof PackageableElementPtr) + { + type = (PackageableElementPtr) appliedFunction.parameters.get(0); + } + else + { + return appliedFunction; + } - Optional name = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("name")) - .map(KeyExpression.class::cast) - .map(x -> x.expression) - .filter(CString.class::isInstance) - .map(CString.class::cast); + Set classesThatNeedTypeFixing = Sets.fixedSize.of( + "meta::pure::tds::BasicColumnSpecification", + "BasicColumnSpecification" + ); - Optional doc = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("documentation")) - .map(KeyExpression.class::cast) - .map(x -> x.expression) - .filter(CString.class::isInstance) - .map(CString.class::cast); + if (classesThatNeedTypeFixing.contains(type.fullPath)) + { + Collection collection = (Collection) appliedFunction.parameters.get(2); + Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(Lambda.class::isInstance) + .map(Lambda.class::cast); + + Optional name = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("name")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(CString.class::isInstance) + .map(CString.class::cast); - if (func.isPresent() && name.isPresent()) - { - appliedFunction.function = "meta::pure::tds::col"; - appliedFunction.parameters = Lists.mutable.with(func.get(), name.get()); + Optional doc = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("documentation")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(CString.class::isInstance) + .map(CString.class::cast); - if (doc.isPresent()) - { - appliedFunction.fControl = "meta::pure::tds::col_Function_1__String_1__String_1__BasicColumnSpecification_1_"; - appliedFunction.parameters.add(doc.get()); - } - else - { - appliedFunction.fControl = "meta::pure::tds::col_Function_1__String_1__BasicColumnSpecification_1_"; - } - } + appliedFunction.function = "meta::pure::tds::col"; + appliedFunction.fControl = "meta::pure::tds::col_Function_1__String_1__BasicColumnSpecification_1_"; + appliedFunction.parameters = Stream.of(func, name, doc).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList()); + if (appliedFunction.parameters.size() == 3) + { + appliedFunction.fControl = "meta::pure::tds::col_Function_1__String_1__String_1__BasicColumnSpecification_1_"; } } } @@ -286,6 +306,10 @@ public AppliedFunction convert(AppliedFunction appliedFunction) } } + /** + * Convert the usage of TdsOlapRank to the equivalent function + * ^TdsOlapRank(...) == func(...) + */ private static class TdsOlapRankToColFunctionConverter extends StdConverter { @Override @@ -293,32 +317,46 @@ public AppliedFunction convert(AppliedFunction appliedFunction) { if (appliedFunction.function.equals("new")) { - GenericTypeInstance typeInstance = (GenericTypeInstance) appliedFunction.parameters.get(0); - if (typeInstance.genericType.typeArguments.size() >= 1 && typeInstance.genericType.typeArguments.get(0).rawType instanceof PackageableType) + PackageableElementPtr type; + + if (appliedFunction.parameters.get(0) instanceof GenericTypeInstance) + { + GenericTypeInstance typeInstance = (GenericTypeInstance) appliedFunction.parameters.get(0); + if (typeInstance.genericType.typeArguments.size() >= 1 && typeInstance.genericType.typeArguments.get(0).rawType instanceof PackageableType) + { + type = (PackageableType) typeInstance.genericType.typeArguments.get(0).rawType; + } + else + { + return appliedFunction; + } + } + else if (appliedFunction.parameters.get(0) instanceof PackageableElementPtr) { - PackageableType type = (PackageableType) typeInstance.genericType.typeArguments.get(0).rawType; + type = (PackageableElementPtr) appliedFunction.parameters.get(0); + } + else + { + return appliedFunction; + } - Set classesThatNeedTypeFixing = Sets.fixedSize.of( - "meta::pure::tds::TdsOlapRank", - "TdsOlapRank" - ); + Set classesThatNeedTypeFixing = Sets.fixedSize.of( + "meta::pure::tds::TdsOlapRank", + "TdsOlapRank" + ); - if (classesThatNeedTypeFixing.contains(type.fullPath)) - { - Collection collection = (Collection) appliedFunction.parameters.get(2); - Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) - .map(KeyExpression.class::cast) - .map(x -> x.expression) - .filter(Lambda.class::isInstance) - .map(Lambda.class::cast); + if (classesThatNeedTypeFixing.contains(type.fullPath)) + { + Collection collection = (Collection) appliedFunction.parameters.get(2); + Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) + .map(KeyExpression.class::cast) + .map(x -> x.expression) + .filter(Lambda.class::isInstance) + .map(Lambda.class::cast); - if (func.isPresent()) - { - appliedFunction.function = "meta::pure::tds::func"; - appliedFunction.fControl = "meta::pure::tds::func_FunctionDefinition_1__TdsOlapRank_1_"; - appliedFunction.parameters = Lists.mutable.with(func.get()); - } - } + appliedFunction.function = "meta::pure::tds::func"; + appliedFunction.fControl = "meta::pure::tds::func_FunctionDefinition_1__TdsOlapRank_1_"; + appliedFunction.parameters = Stream.of(func).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList()); } } return appliedFunction; 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/PureProtocolObjectMapperFactory.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/PureProtocolObjectMapperFactory.java index 5d6c11c0474..cd1b3ff22f0 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/PureProtocolObjectMapperFactory.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/PureProtocolObjectMapperFactory.java @@ -183,24 +183,22 @@ public static ObjectMapper getNewObjectMapper(Set excludedSubTypes) public static ObjectMapper withPureProtocolConverter(ObjectMapper objectMapper) { - ObjectMapper withPureProtocolExtensions = withPureProtocolExtensions(objectMapper); - List> protocolConverters = PureProtocolExtensionLoader.extensions().stream() - .map(PureProtocolExtension::getConverterDeserializers) + .map(PureProtocolExtension::getProtocolConverters) .filter(Objects::nonNull) .flatMap(List::stream) .collect(Collectors.toList()); FastListMultimap> converterByType = ListIterate.groupBy(protocolConverters, x -> x.getInputType(TypeFactory.defaultInstance())); - DeserializationConfig deserializationConfig = withPureProtocolExtensions + DeserializationConfig deserializationConfig = objectMapper .getDeserializationConfig() .with(new ConverterHandlerInstantiator(converterByType)); SimpleModule module = new SimpleModule("protocol converters"); module.setDeserializerModifier(new ConverterBeanDeserializerModifier(converterByType)); - return withPureProtocolExtensions.setConfig(deserializationConfig).registerModule(module); + return objectMapper.setConfig(deserializationConfig).registerModule(module); } private static class ConverterHandlerInstantiator extends HandlerInstantiator 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/extension/PureProtocolExtension.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/extension/PureProtocolExtension.java index 3ca9aab7f8a..5ecb50e8f62 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/extension/PureProtocolExtension.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/extension/PureProtocolExtension.java @@ -48,7 +48,7 @@ default Map getExtraClassInstanceTypeMappings() return Maps.mutable.empty(); } - default List> getConverterDeserializers() + default List> getProtocolConverters() { return Lists.fixedSize.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/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 e97a3ead7ce..86f53709d91 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 @@ -77,13 +77,7 @@ public ValueSpecification deserialize(JsonParser jsonParser, DeserializationCont 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; + variable.genericType = new GenericType(new PackageableType(_class)); } // Backward compatibility - old protocol ------------------------------------------------------------------- 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 9356bcdc45b..94f7b1570f4 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 @@ -14,27 +14,11 @@ package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.application; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.util.StdConverter; import java.util.Collections; import java.util.List; -import java.util.Optional; -import java.util.Set; -import org.eclipse.collections.api.factory.Lists; -import org.eclipse.collections.api.factory.Sets; -import org.eclipse.collections.impl.utility.ListIterate; -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.Collection; -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.datatype.CString; -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; -@JsonDeserialize(converter = AppliedFunction.AppliedFunctionConverter.class) public class AppliedFunction extends AbstractAppliedFunction { public String function; @@ -46,49 +30,4 @@ public T accept(ValueSpecificationVisitor visitor) { return visitor.visit(this); } - - public static class AppliedFunctionConverter extends StdConverter - { - @Override - public AppliedFunction convert(AppliedFunction appliedFunction) - { - if (appliedFunction.function.equals("new")) - { - // Backward compatibility - old protocol ------------------------------------------------------------------- - if (appliedFunction.parameters.get(0) instanceof PackageableElementPtr) - { - PackageableElementPtr packageableElementPtr = (PackageableElementPtr) appliedFunction.parameters.get(0); - - Set classesThatNeedTypeFixing = Sets.fixedSize.of( - "meta::pure::tds::BasicColumnSpecification", - "BasicColumnSpecification", - "meta::pure::tds::TdsOlapRank", - "TdsOlapRank" - ); - if (classesThatNeedTypeFixing.contains(packageableElementPtr.fullPath)) - { - Collection collection = (Collection) appliedFunction.parameters.get(2); - Optional func = ListIterate.detectOptional(collection.values, x -> ((CString) ((KeyExpression) x).key).value.equals("func")) - .map(KeyExpression.class::cast) - .map(x -> x.expression) - .filter(Lambda.class::isInstance) - .map(Lambda.class::cast) - .filter(x -> x.parameters.size() == 1); - - if (func.isPresent()) - { - Lambda l = func.get(); - PackageableType rawType = new PackageableType(packageableElementPtr.fullPath); - rawType.sourceInformation = packageableElementPtr.sourceInformation; - List classType = Lists.mutable.of(new GenericType(rawType, Lists.mutable.with(l.parameters.get(0).genericType))); - GenericTypeInstance generic = new GenericTypeInstance(new GenericType(new PackageableType("meta::pure::metamodel::type::Class"), classType)); - appliedFunction.parameters.set(0, generic); - } - } - } - // Backward compatibility ------------------------------------------------------------------- - } - return appliedFunction; - } - } } diff --git a/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/java/org/finos/legend/engine/shared/core/ObjectMapperFactory.java b/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/java/org/finos/legend/engine/shared/core/ObjectMapperFactory.java index ba623662613..1f9b99853cc 100644 --- a/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/java/org/finos/legend/engine/shared/core/ObjectMapperFactory.java +++ b/legend-engine-core/legend-engine-core-shared/legend-engine-shared-core/src/main/java/org/finos/legend/engine/shared/core/ObjectMapperFactory.java @@ -19,9 +19,8 @@ import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; -import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; - import java.util.TimeZone; +import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; public class ObjectMapperFactory { @@ -44,11 +43,11 @@ public static ObjectMapper getNewStandardObjectMapper() public static ObjectMapper getNewStandardObjectMapperWithPureProtocolExtensionSupports() { - return withStandardConfigurations(PureProtocolObjectMapperFactory.withPureProtocolExtensions(new ObjectMapper())); - } - - public static ObjectMapper getNewStandardObjectMapperWithPureProtocolConverterSupports() - { - return withStandardConfigurations(PureProtocolObjectMapperFactory.withPureProtocolConverter(new ObjectMapper())); + return withStandardConfigurations( + // Tactically we will run converters as part of the standard flow + PureProtocolObjectMapperFactory.withPureProtocolConverter( + PureProtocolObjectMapperFactory.withPureProtocolExtensions(new ObjectMapper()) + ) + ); } } From 7b00fef197ab7a1887d7416511c794ebfef9b292 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Mon, 25 Nov 2024 20:54:23 -0500 Subject: [PATCH 07/17] Avoid using writeRawValue to make ser/deser coverter friendly --- .../mapping/EnumValueMappingSourceValueDeserializer.java | 7 ++----- .../mapping/EnumValueMappingSourceValueSerializer.java | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) 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/mapping/EnumValueMappingSourceValueDeserializer.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/mapping/EnumValueMappingSourceValueDeserializer.java index cc1b9d4fd9b..d4390fa213f 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/mapping/EnumValueMappingSourceValueDeserializer.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/mapping/EnumValueMappingSourceValueDeserializer.java @@ -18,24 +18,21 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; public class EnumValueMappingSourceValueDeserializer extends JsonDeserializer { - private final ObjectMapper objectMapper = new ObjectMapper(); - @Override public Object deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { try { - return objectMapper.readValue(jsonParser, EnumValueMappingSourceValue.class); + return deserializationContext.readValue(jsonParser, EnumValueMappingSourceValue.class); } catch (JsonProcessingException e) { - return objectMapper.readValue(jsonParser, Object.class); + return deserializationContext.readValue(jsonParser, Object.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/packageableElement/mapping/EnumValueMappingSourceValueSerializer.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/mapping/EnumValueMappingSourceValueSerializer.java index 98b650f1f4e..eca59ee7978 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/mapping/EnumValueMappingSourceValueSerializer.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/mapping/EnumValueMappingSourceValueSerializer.java @@ -16,25 +16,22 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializerProvider; import java.io.IOException; public class EnumValueMappingSourceValueSerializer extends JsonSerializer { - private final ObjectMapper objectMapper = new ObjectMapper(); - @Override public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { if (value instanceof EnumValueMappingSourceValue) { - gen.writeRawValue(objectMapper.writeValueAsString(value)); + gen.writeObject(value); } else { - gen.writeRawValue("\"" + value.toString() + "\""); + gen.writeString(value.toString()); } } } From 0dbe1b8d144c82fe4eb612695c86b2408c1da192 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Mon, 25 Nov 2024 21:08:00 -0500 Subject: [PATCH 08/17] Avoid creating new object mapper --- .../engine/protocol/AnyDeserializer.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol/src/main/java/org/finos/legend/engine/protocol/AnyDeserializer.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol/src/main/java/org/finos/legend/engine/protocol/AnyDeserializer.java index fdacda699e3..2453c1ed440 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol/src/main/java/org/finos/legend/engine/protocol/AnyDeserializer.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-protocol/src/main/java/org/finos/legend/engine/protocol/AnyDeserializer.java @@ -15,10 +15,10 @@ package org.finos.legend.engine.protocol; 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.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.BooleanNode; import com.fasterxml.jackson.databind.node.DoubleNode; @@ -27,7 +27,6 @@ import com.fasterxml.jackson.databind.node.LongNode; import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.TextNode; - import java.io.IOException; import java.time.LocalDate; import java.time.LocalDateTime; @@ -49,9 +48,9 @@ public AnyDeserializer(List> classes) @Override public Object deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { - JsonNode node = new ObjectMapper().readTree(jsonParser); + JsonNode node = jsonParser.readValueAsTree(); - Object value = deserialize(node); + Object value = deserialize(jsonParser.getCodec(), node); if (value == null && !(node instanceof NullNode)) { @@ -61,16 +60,16 @@ public Object deserialize(JsonParser jsonParser, DeserializationContext deserial return value; } - private List deserialize(ArrayNode node) + private List deserialize(ObjectCodec codec, ArrayNode node) { - return StreamSupport.stream(Spliterators.spliteratorUnknownSize(node.elements(), Spliterator.ORDERED), false).map(this::deserialize).collect(Collectors.toList()); + return StreamSupport.stream(Spliterators.spliteratorUnknownSize(node.elements(), Spliterator.ORDERED), false).map(node1 -> deserialize(codec, node1)).collect(Collectors.toList()); } - private Object deserialize(JsonNode node) + private Object deserialize(ObjectCodec codec, JsonNode node) { if (node instanceof ArrayNode) { - return deserialize((ArrayNode) node); + return deserialize(codec, (ArrayNode) node); } if (node instanceof NullNode) @@ -78,9 +77,9 @@ private Object deserialize(JsonNode node) return null; } - for (Class clazz : this.classes) + for (Class clazz : this.classes) { - Object value = tryDeserialize(node, clazz); + Object value = tryDeserialize(codec, node, clazz); if (value != null) { return value; @@ -90,7 +89,7 @@ private Object deserialize(JsonNode node) throw new RuntimeException(String.format("Failed to deserialize '%s' to types [%s]", node, this.classes)); } - private Object tryDeserialize(JsonNode node, Class clazz) + private Object tryDeserialize(ObjectCodec codec, JsonNode node, Class clazz) { try { @@ -114,7 +113,7 @@ private Object tryDeserialize(JsonNode node, Class clazz) { return null; } - return new ObjectMapper().treeToValue(node, clazz); + return codec.treeToValue(node, clazz); } catch (Exception e) From 37b1fd01747c0b41076afa010114d2a177aa9395 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Mon, 25 Nov 2024 21:24:10 -0500 Subject: [PATCH 09/17] Reuse existing mapper/coder rather than creating new one --- .../v1/model/data/DataElementReference.java | 18 +++----- .../pure/v1/model/data/ModelStoreData.java | 11 +++-- .../ClassInstanceWrapper.java | 43 +++++++++---------- .../v1/model/valueSpecification/Variable.java | 20 ++++----- .../valueSpecification/deprecated/Class.java | 2 +- .../valueSpecification/deprecated/Enum.java | 2 +- .../deprecated/HackedClass.java | 6 ++- .../deprecated/HackedUnit.java | 2 +- .../deprecated/MappingInstance.java | 2 +- .../deprecated/PrimitiveType.java | 4 +- .../valueSpecification/raw/ClassInstance.java | 3 +- .../raw/datatype/CBoolean.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/CString.java | 2 +- .../datatype/PrimitiveValueSpecification.java | 17 +++++--- .../GenericTypeInstance.java | 10 ++--- .../PackageableElementPtr.java | 9 ++-- .../valueSpecification/DatabaseInstance.java | 5 +-- 23 files changed, 80 insertions(+), 90 deletions(-) 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/data/DataElementReference.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/data/DataElementReference.java index c907f369388..bb7aa303bd5 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/data/DataElementReference.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/data/DataElementReference.java @@ -15,19 +15,17 @@ package org.finos.legend.engine.protocol.pure.v1.model.data; 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.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; +import java.io.IOException; +import java.util.Objects; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementType; -import java.io.IOException; -import java.util.Objects; - @JsonDeserialize(using = DataElementReference.DataElementReferenceDeserializer.class) public class DataElementReference extends EmbeddedData { @@ -35,13 +33,11 @@ public class DataElementReference extends EmbeddedData public static class DataElementReferenceDeserializer extends JsonDeserializer { - - private static ObjectMapper objectMapper = PureProtocolObjectMapperFactory.getNewObjectMapper(); - @Override public DataElementReference deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { - JsonNode node = jsonParser.getCodec().readTree(jsonParser); + ObjectCodec codec = jsonParser.getCodec(); + JsonNode node = codec.readTree(jsonParser); JsonNode dataElementNode = node.get("dataElement"); DataElementReference dataElementReference = new DataElementReference(); if (dataElementNode != null) @@ -51,12 +47,12 @@ public DataElementReference deserialize(JsonParser jsonParser, DeserializationCo dataElementReference.dataElement = new PackageableElementPointer( PackageableElementType.DATA, dataElementNode.textValue(), - Objects.isNull(node.get("sourceInformation")) ? null : objectMapper.treeToValue(node.get("sourceInformation"), SourceInformation.class) + Objects.isNull(node.get("sourceInformation")) ? null : codec.treeToValue(node.get("sourceInformation"), SourceInformation.class) ); } else if (dataElementNode.isObject()) { - dataElementReference.dataElement = objectMapper.treeToValue(dataElementNode, PackageableElementPointer.class); + dataElementReference.dataElement = codec.treeToValue(dataElementNode, PackageableElementPointer.class); } else { 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/data/ModelStoreData.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/data/ModelStoreData.java index aec5310b48c..beda6a04f15 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/data/ModelStoreData.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/data/ModelStoreData.java @@ -15,6 +15,7 @@ package org.finos.legend.engine.protocol.pure.v1.model.data; 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; @@ -39,13 +40,11 @@ public class ModelStoreData extends EmbeddedData public static class ModelStoreDeserializer extends JsonDeserializer { - - private static ObjectMapper objectMapper = PureProtocolObjectMapperFactory.getNewObjectMapper(); - @Override public ModelStoreData deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { - JsonNode node = jsonParser.getCodec().readTree(jsonParser); + ObjectCodec codec = jsonParser.getCodec(); + JsonNode node = codec.readTree(jsonParser); JsonNode instances = node.get("instances"); JsonNode modelDataJsonNode = node.get("modelData"); ModelStoreData result = new ModelStoreData(); @@ -58,7 +57,7 @@ public ModelStoreData deserialize(JsonParser jsonParser, DeserializationContext Iterator elements = modelDataNode.elements(); while (elements.hasNext()) { - result.modelData.add(objectMapper.treeToValue(elements.next(), ModelTestData.class)); + result.modelData.add(codec.treeToValue(elements.next(), ModelTestData.class)); } } else @@ -78,7 +77,7 @@ else if (instances != null) Map.Entry instance = itr.next(); String model = instance.getKey(); JsonNode instanceVal = instance.getValue(); - ValueSpecification val = objectMapper.treeToValue(instanceVal, ValueSpecification.class); + ValueSpecification val = codec.treeToValue(instanceVal, ValueSpecification.class); ModelInstanceTestData modelInstanceTestData = new ModelInstanceTestData(); modelInstanceTestData.model = model; modelInstanceTestData.instances = val; 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/ClassInstanceWrapper.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/ClassInstanceWrapper.java index 00d10823d32..360a678b24b 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/ClassInstanceWrapper.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/ClassInstanceWrapper.java @@ -15,17 +15,18 @@ package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification; 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.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.databind.node.POJONode; -import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.TextNode; +import java.io.IOException; +import java.util.List; 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.valueSpecification.raw.ClassInstance; 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; @@ -41,20 +42,16 @@ 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.path.Path; -import java.io.IOException; -import java.util.List; - @JsonDeserialize(using = ClassInstanceWrapper.ClassInstanceWrapperDeserializer.class) public class ClassInstanceWrapper extends ValueSpecification { - protected static ObjectMapper om = PureProtocolObjectMapperFactory.getNewObjectMapper(); - public static class ClassInstanceWrapperDeserializer extends JsonDeserializer { @Override public ValueSpecification deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { - JsonNode node = jsonParser.getCodec().readTree(jsonParser); + ObjectCodec codec = jsonParser.getCodec(); + JsonNode node = codec.readTree(jsonParser); JsonNode jtype = node.get("_type"); String type = jtype == null ? null : jtype.asText(); if (!(node instanceof NullNode)) @@ -69,68 +66,68 @@ public ValueSpecification deserialize(JsonParser jsonParser, DeserializationCont node.fieldNames().forEachRemaining(fields::add); if ("path".equals(type) || node.get("path") != null) { - Path p = om.treeToValue(node, Path.class); + Path p = codec.treeToValue(node, Path.class); return new ClassInstance("path", p, p.sourceInformation); } if ("rootGraphFetchTree".equals(type) || node.get("class") != null) { ((ObjectNode) node).set("_type", new TextNode("rootGraphFetchTree")); - RootGraphFetchTree p = om.treeToValue(node, RootGraphFetchTree.class); + RootGraphFetchTree p = codec.treeToValue(node, RootGraphFetchTree.class); return new ClassInstance("rootGraphFetchTree", p, p.sourceInformation); } if ("listInstance".equals(type) || node.get("values") != null || fields.isEmpty() || (fields.size() == 1 && "sourceInformation".equals(fields.get(0)))) { - PureList p = om.treeToValue(node, PureList.class); + PureList p = codec.treeToValue(node, PureList.class); return new ClassInstance("listInstance", p, p.sourceInformation); } if ("pair".equals(type) || node.get("first") != null) { - Pair p = om.treeToValue(node, Pair.class); + Pair p = codec.treeToValue(node, Pair.class); return new ClassInstance("pair", p, p.sourceInformation); } if ("aggregateValue".equals(type) || node.get("mapFn") != null && node.get("name") == null) { - AggregateValue p = om.treeToValue(node, AggregateValue.class); + AggregateValue p = codec.treeToValue(node, AggregateValue.class); return new ClassInstance("aggregateValue", p, p.sourceInformation); } if ("tdsAggregateValue".equals(type) || node.get("mapFn") != null && node.get("name") != null) { - TDSAggregateValue p = om.treeToValue(node, TDSAggregateValue.class); + TDSAggregateValue p = codec.treeToValue(node, TDSAggregateValue.class); return new ClassInstance("tdsAggregateValue", p, p.sourceInformation); } if ("tdsColumnInformation".equals(type) || node.get("columnFn") != null) { - TDSColumnInformation p = om.treeToValue(node, TDSColumnInformation.class); + TDSColumnInformation p = codec.treeToValue(node, TDSColumnInformation.class); return new ClassInstance("tdsColumnInformation", p, p.sourceInformation); } if ("tdsSortInformation".equals(type) || node.get("direction") != null) { - TDSSortInformation p = om.treeToValue(node, TDSSortInformation.class); + TDSSortInformation p = codec.treeToValue(node, TDSSortInformation.class); return new ClassInstance("tdsSortInformation", p, p.sourceInformation); } if ("tdsOlapRank".equals(type) || node.get("function") != null && node.get("columnName") == null) { - TdsOlapRank p = om.treeToValue(node, TdsOlapRank.class); + TdsOlapRank p = codec.treeToValue(node, TdsOlapRank.class); return new ClassInstance("tdsOlapRank", p, p.sourceInformation); } if ("tdsOlapAggregation".equals(type) || node.get("function") != null && node.get("columnName") != null) { - TdsOlapAggregation p = om.treeToValue(node, TdsOlapAggregation.class); + TdsOlapAggregation p = codec.treeToValue(node, TdsOlapAggregation.class); return new ClassInstance("tdsOlapAggregation", p, p.sourceInformation); } if ("runtimeInstance".equals(type) || node.get("runtime") != null) { - RuntimeInstance p = om.treeToValue(node, RuntimeInstance.class); + RuntimeInstance p = codec.treeToValue(node, RuntimeInstance.class); return new ClassInstance("runtimeInstance", p, p.sourceInformation); } if ("executionContextInstance".equals(type) || node.get("executionContext") != null) { - ExecutionContextInstance p = om.treeToValue(node, ExecutionContextInstance.class); + ExecutionContextInstance p = codec.treeToValue(node, ExecutionContextInstance.class); return new ClassInstance("executionContextInstance", p, p.sourceInformation); } if ("alloySerializationConfig".equals(type) || node.get("typeKeyName") != null) { - SerializationConfig p = om.treeToValue(node, SerializationConfig.class); + SerializationConfig p = codec.treeToValue(node, SerializationConfig.class); return new ClassInstance("alloySerializationConfig", p, p.sourceInformation); } throw new RuntimeException("NOT SUPPORTED\n" + node.toPrettyString()); 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 86f53709d91..eef315160bf 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 @@ -15,25 +15,20 @@ package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification; 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.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 java.io.IOException; 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.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; @@ -69,7 +64,8 @@ public static class VariableDeserializer extends JsonDeserializer classMap = PureProtocolObjectMapperFactory.getClassInstanceTypeMappings(); public String type; @@ -77,7 +76,7 @@ public ClassInstance deserialize(JsonParser jsonParser, DeserializationContext d { ((ObjectNode) node.get("value")).set("_type", new TextNode(result.type)); // For backward compatibility } - result.value = om.treeToValue(node.get("value"), _class); + result.value = oc.treeToValue(node.get("value"), _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/datatype/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 index 7354afded50..4d9a22e3b64 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/datatype/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 @@ -48,7 +48,7 @@ public static class CBooleanDeserializer extends JsonDeserializer new CBoolean(Boolean.parseBoolean(x.asText()))); + return customParsePrimitive(jsonParser, x -> new CBoolean(Boolean.parseBoolean(x.asText()))); } } } 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/datatype/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 index 2537af20838..ee73ab8cf6d 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/datatype/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 @@ -48,7 +48,7 @@ public static class CDateTimeDeserializer extends JsonDeserializer new CDateTime(x.asText())); + return customParsePrimitive(jsonParser, x -> new CDateTime(x.asText())); } } } 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/datatype/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 index d4c5377b2ca..c73e9de0067 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/datatype/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 @@ -49,7 +49,7 @@ public static class CDecimalDeserializer extends JsonDeserializer new CDecimal(new BigDecimal((x.asText())))); + return customParsePrimitive(jsonParser, x -> new CDecimal(new BigDecimal((x.asText())))); } } } 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/datatype/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 index 4eba4d0b6ab..b2e557fd8bf 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/datatype/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 @@ -48,7 +48,7 @@ public static class CFloatDeserializer extends JsonDeserializer new CFloat(Double.parseDouble((x.asText())))); + return customParsePrimitive(jsonParser, x -> new CFloat(Double.parseDouble((x.asText())))); } } } \ 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/model/valueSpecification/raw/datatype/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 index 9fcfb6340d7..8f228b7bbf4 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/datatype/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 @@ -48,7 +48,7 @@ public static class CIntegerDeserializer extends JsonDeserializer new CInteger(x.asLong())); + return customParsePrimitive(jsonParser, x -> new CInteger(x.asLong())); } } } 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/datatype/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 index 0e4cc8b6b48..83529bbbe8f 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/datatype/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 @@ -37,7 +37,7 @@ public static class CLatestDateDeserializer extends JsonDeserializer new CLatestDate()); + return customParsePrimitive(jsonParser, x -> new CLatestDate()); } } } \ 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/model/valueSpecification/raw/datatype/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 index c5baae3c709..37c80e90976 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/datatype/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 @@ -48,7 +48,7 @@ public static class CStrictDateDeserializer extends JsonDeserializer new CStrictDate(x.asText())); + return customParsePrimitive(jsonParser, x -> new CStrictDate(x.asText())); } } } 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/datatype/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 index 6a83ecb8ef9..f2ae65850f3 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/datatype/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 @@ -57,7 +57,7 @@ public ValueSpecification deserialize(JsonParser jsonParser, DeserializationCont { return new CString(""); } - return customParsePrimitive(node, x -> new CString(x.asText())); + return customParsePrimitive(jsonParser.getCodec(), node, x -> new CString(x.asText())); } } } 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/datatype/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 index 7d757868e59..12db09b5fe9 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/datatype/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 @@ -14,23 +14,26 @@ package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.datatype; +import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.util.function.Function; import org.eclipse.collections.impl.factory.Lists; import org.eclipse.collections.impl.utility.Iterate; -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; - public abstract class PrimitiveValueSpecification extends DataTypeValueSpecification { - private static ObjectMapper om = PureProtocolObjectMapperFactory.getNewObjectMapper(); + public static ValueSpecification customParsePrimitive(JsonParser parser, Function func) throws IOException + { + return customParsePrimitive(parser.getCodec(), parser.readValueAsTree(), func); + } - public static ValueSpecification customParsePrimitive(JsonNode node, Function func) throws JsonProcessingException + public static ValueSpecification customParsePrimitive(ObjectCodec oc, JsonNode node, Function func) throws JsonProcessingException { JsonNode values = node.get("values"); ValueSpecification result; @@ -56,7 +59,7 @@ else if (values.size() == 1) JsonNode sourceInformation = node.get("sourceInformation"); if (sourceInformation != null) { - result.sourceInformation = om.treeToValue(sourceInformation, SourceInformation.class); + result.sourceInformation = oc.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/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 index 66e3f361864..bcd5bc569ba 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/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 @@ -15,6 +15,7 @@ package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement; 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; @@ -33,8 +34,6 @@ @JsonDeserialize(using = GenericTypeInstance.GenericTypeInstanceDeserializer.class) public class GenericTypeInstance extends One { - protected static ObjectMapper om = PureProtocolObjectMapperFactory.getNewObjectMapper(); - public GenericType genericType; public GenericTypeInstance() @@ -62,7 +61,8 @@ public static class GenericTypeInstanceDeserializer extends JsonDeserializer T accept(ValueSpecificationVisitor visitor) } - protected static ValueSpecification convert(JsonNode node) throws IOException + protected static ValueSpecification convert(JsonParser parser) throws IOException { + JsonNode node = parser.readValueAsTree(); JsonNode name = node.get("fullPath"); ValueSpecification result = new PackageableElementPtr(name.asText()); JsonNode sourceInformation = node.get("sourceInformation"); if (sourceInformation != null) { - result.sourceInformation = om.treeToValue(sourceInformation, SourceInformation.class); + result.sourceInformation = parser.getCodec().treeToValue(sourceInformation, SourceInformation.class); } return result; } 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 c234bb055b8..c5e21942579 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,9 +18,8 @@ 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.packageableElement.PackageableElementPtr; - import java.io.IOException; +import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw.packageableElement.PackageableElementPtr; @Deprecated @JsonDeserialize(using = DatabaseInstance.DatabaseInstanceDeserializer.class) @@ -37,7 +36,7 @@ public static class DatabaseInstanceDeserializer extends JsonDeserializer Date: Tue, 26 Nov 2024 08:33:22 -0500 Subject: [PATCH 10/17] Avoid dropping source information --- .../TestDomainCompilationFromProtocol.java | 2 +- .../api/test/TestGrammarToJsonApi.java | 4 +- .../context/PackageableElementPointer.java | 10 ---- .../v1/model/data/DataElementReference.java | 49 ------------------- .../packageableElement/domain/Class.java | 7 +-- .../packageableElement/domain/Profile.java | 8 +-- .../domain/ProfileStereotype.java | 16 ++---- .../packageableElement/domain/ProfileTag.java | 16 ++---- .../mapping/AssociationMapping.java | 7 +-- .../mapping/EnumerationMapping.java | 5 +- .../mapping/mappingTest/StoreTestData.java | 3 -- .../model/packageableElement/store/Store.java | 7 +-- .../test/TestCompatibilityAndMigration.java | 22 +-------- .../persistence/Persistence.java | 4 +- .../persistence/PersistenceContext.java | 5 +- .../persister/sink/ObjectStorageSink.java | 2 - .../persister/sink/RelationalSink.java | 2 - .../sink/RelationalPersistenceTarget.java | 2 - 18 files changed, 26 insertions(+), 145 deletions(-) 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/fromProtocol/TestDomainCompilationFromProtocol.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/fromProtocol/TestDomainCompilationFromProtocol.java index c2ffc9394d4..3485a1c21d5 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/fromProtocol/TestDomainCompilationFromProtocol.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/fromProtocol/TestDomainCompilationFromProtocol.java @@ -97,7 +97,7 @@ public void testNewConstructorWithMissingTypeArgumentsCompiles() " {\n" + // ---------- type to construct, no type arguments " \"_type\": \"packageableElementPtr\",\n" + - " \"fullPath\": \"BasicColumnSpecification\"\n" + + " \"fullPath\": \"TdsOlapRank\"\n" + // ---------- type to construct, no type arguments " },\n" + " {\n" + 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 3846046dc5f..e5be6bd2a29 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 @@ -40,7 +40,7 @@ public void testProtocolGeneration() @Test public void testImportParsing() { - 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(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\":[{\"path\":\"VersionClass\",\"sourceInformation\":{\"endColumn\":56,\"endLine\":2,\"sourceId\":\"\",\"startColumn\":45,\"startLine\":2},\"type\":\"CLASS\"}],\"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 @@ -96,7 +96,7 @@ public void testMappingIncludeSerialization() @Test public void testEnumerationMappingWithStructuredSourceValueSerialization() { - test("{\"code\": \"###Mapping\\nMapping a::mapping\\n(test::IncType : EnumerationMapping a\\n{ CORP : [1], LLC : [2] })\"}", "{\"isolatedLambdas\":{\"lambdas\":{}},\"modelDataContext\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"mapping\",\"associationMappings\":[],\"classMappings\":[],\"enumerationMappings\":[{\"enumValueMappings\":[{\"enumValue\":\"CORP\",\"sourceValues\":[{\"_type\":\"integerSourceValue\",\"value\":1}]},{\"enumValue\":\"LLC\",\"sourceValues\":[{\"_type\":\"integerSourceValue\",\"value\":2}]}],\"enumeration\":\"test::IncType\",\"id\":\"a\",\"sourceInformation\":{\"endColumn\":25,\"endLine\":4,\"sourceId\":\"\",\"startColumn\":2,\"startLine\":3}}],\"includedMappings\":[],\"name\":\"mapping\",\"package\":\"a\",\"sourceInformation\":{\"endColumn\":26,\"endLine\":4,\"sourceId\":\"\",\"startColumn\":1,\"startLine\":2},\"tests\":[]},{\"_type\":\"sectionIndex\",\"name\":\"SectionIndex\",\"package\":\"__internal__\",\"sections\":[{\"_type\":\"importAware\",\"elements\":[],\"imports\":[],\"parserName\":\"Pure\",\"sourceInformation\":{\"endColumn\":8,\"endLine\":1,\"sourceId\":\"\",\"startColumn\":1,\"startLine\":1}},{\"_type\":\"importAware\",\"elements\":[\"a::mapping\"],\"imports\":[],\"parserName\":\"Mapping\",\"sourceInformation\":{\"endColumn\":26,\"endLine\":6,\"sourceId\":\"\",\"startColumn\":8,\"startLine\":2}}]}]},\"renderStyle\":\"STANDARD\"}"); + test("{\"code\": \"###Mapping\\nMapping a::mapping\\n(test::IncType : EnumerationMapping a\\n{ CORP : [1], LLC : [2] })\"}", "{\"isolatedLambdas\":{\"lambdas\":{}},\"modelDataContext\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"mapping\",\"associationMappings\":[],\"classMappings\":[],\"enumerationMappings\":[{\"enumValueMappings\":[{\"enumValue\":\"CORP\",\"sourceValues\":[{\"_type\":\"integerSourceValue\",\"value\":1}]},{\"enumValue\":\"LLC\",\"sourceValues\":[{\"_type\":\"integerSourceValue\",\"value\":2}]}],\"enumeration\":{\"path\":\"test::IncType\",\"sourceInformation\":{\"endColumn\":14,\"endLine\":3,\"sourceId\":\"\",\"startColumn\":2,\"startLine\":3},\"type\":\"ENUMERATION\"},\"id\":\"a\",\"sourceInformation\":{\"endColumn\":25,\"endLine\":4,\"sourceId\":\"\",\"startColumn\":2,\"startLine\":3}}],\"includedMappings\":[],\"name\":\"mapping\",\"package\":\"a\",\"sourceInformation\":{\"endColumn\":26,\"endLine\":4,\"sourceId\":\"\",\"startColumn\":1,\"startLine\":2},\"tests\":[]},{\"_type\":\"sectionIndex\",\"name\":\"SectionIndex\",\"package\":\"__internal__\",\"sections\":[{\"_type\":\"importAware\",\"elements\":[],\"imports\":[],\"parserName\":\"Pure\",\"sourceInformation\":{\"endColumn\":8,\"endLine\":1,\"sourceId\":\"\",\"startColumn\":1,\"startLine\":1}},{\"_type\":\"importAware\",\"elements\":[\"a::mapping\"],\"imports\":[],\"parserName\":\"Mapping\",\"sourceInformation\":{\"endColumn\":26,\"endLine\":6,\"sourceId\":\"\",\"startColumn\":8,\"startLine\":2}}]}]},\"renderStyle\":\"STANDARD\"}"); } @Test 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/context/PackageableElementPointer.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/context/PackageableElementPointer.java index cdc61c31853..4484f622aa7 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/context/PackageableElementPointer.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/context/PackageableElementPointer.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.util.StdConverter; import java.util.Objects; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; @@ -81,15 +80,6 @@ public int hashCode() { return Objects.hash(type, path); } - - public static class ToPathSerializerConverter extends StdConverter - { - @Override - public String convert(PackageableElementPointer value) - { - return value.path; - } - } } 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/data/DataElementReference.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/data/DataElementReference.java index bb7aa303bd5..7c5d23a7624 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/data/DataElementReference.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/data/DataElementReference.java @@ -14,58 +14,9 @@ package org.finos.legend.engine.protocol.pure.v1.model.data; -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 java.io.IOException; -import java.util.Objects; -import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; -import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementType; -@JsonDeserialize(using = DataElementReference.DataElementReferenceDeserializer.class) public class DataElementReference extends EmbeddedData { public PackageableElementPointer dataElement; - - public static class DataElementReferenceDeserializer extends JsonDeserializer - { - @Override - public DataElementReference deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException - { - ObjectCodec codec = jsonParser.getCodec(); - JsonNode node = codec.readTree(jsonParser); - JsonNode dataElementNode = node.get("dataElement"); - DataElementReference dataElementReference = new DataElementReference(); - if (dataElementNode != null) - { - if (dataElementNode.isTextual()) - { - dataElementReference.dataElement = new PackageableElementPointer( - PackageableElementType.DATA, - dataElementNode.textValue(), - Objects.isNull(node.get("sourceInformation")) ? null : codec.treeToValue(node.get("sourceInformation"), SourceInformation.class) - ); - } - else if (dataElementNode.isObject()) - { - dataElementReference.dataElement = codec.treeToValue(dataElementNode, PackageableElementPointer.class); - } - else - { - throw new IOException("DataElementReference expects property 'dataElement' to be a PackageableElementPointer"); - } - } - // for backward compatability - else - { - throw new IOException("DataElementReference requires attribute dataElement."); - } - return dataElementReference; - } - } - } 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/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/packageableElement/domain/Class.java index df86f6d9214..c5d0c17ad9b 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/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/packageableElement/domain/Class.java @@ -14,17 +14,14 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.Collections; +import java.util.List; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElementVisitor; -import java.util.Collections; -import java.util.List; - public class Class extends PackageableElement { - @JsonSerialize(contentConverter = PackageableElementPointer.ToPathSerializerConverter.class) public List superTypes = Collections.emptyList(); public List originalMilestonedProperties = Collections.emptyList(); public List properties = Collections.emptyList(); 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/Profile.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/Profile.java index e493d2f4337..8a9312def82 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/Profile.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/Profile.java @@ -14,18 +14,14 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; -import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElementVisitor; - import java.util.Collections; import java.util.List; +import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; +import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElementVisitor; public class Profile extends PackageableElement { - @JsonSerialize(contentConverter = ProfileStereotype.ToPathSerializerConverter.class) public List stereotypes = Collections.emptyList(); - @JsonSerialize(contentConverter = ProfileTag.ToPathSerializerConverter.class) public List tags = Collections.emptyList(); @Override 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/ProfileStereotype.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/ProfileStereotype.java index 91f48e64de5..6a46ce7421a 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/ProfileStereotype.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/ProfileStereotype.java @@ -14,7 +14,8 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain; -import com.fasterxml.jackson.databind.util.StdConverter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; public class ProfileStereotype @@ -22,24 +23,17 @@ public class ProfileStereotype public String value; public SourceInformation sourceInformation; - public ProfileStereotype(String value, SourceInformation sourceInformation) + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + public ProfileStereotype(@JsonProperty("value") String value, @JsonProperty("sourceInformation") SourceInformation sourceInformation) { this.value = value; this.sourceInformation = sourceInformation; } + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public ProfileStereotype(String value) { this.value = value; this.sourceInformation = null; } - - public static class ToPathSerializerConverter extends StdConverter - { - @Override - public String convert(ProfileStereotype stereotype) - { - return stereotype.value; - } - } } 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/ProfileTag.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/ProfileTag.java index c3cd3e6728f..ec3e4fce69a 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/ProfileTag.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/ProfileTag.java @@ -14,7 +14,8 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain; -import com.fasterxml.jackson.databind.util.StdConverter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; public class ProfileTag @@ -22,24 +23,17 @@ public class ProfileTag public String value; public SourceInformation sourceInformation; - public ProfileTag(String value, SourceInformation sourceInformation) + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + public ProfileTag(@JsonProperty("value") String value, @JsonProperty("sourceInformation") SourceInformation sourceInformation) { this.value = value; this.sourceInformation = sourceInformation; } + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public ProfileTag(String value) { this.value = value; this.sourceInformation = null; } - - public static class ToPathSerializerConverter extends StdConverter - { - @Override - public String convert(ProfileTag tag) - { - return tag.value; - } - } } 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/mapping/AssociationMapping.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/mapping/AssociationMapping.java index cab2ed6953b..a25fd3ac7e7 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/mapping/AssociationMapping.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/mapping/AssociationMapping.java @@ -16,14 +16,12 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.Collections; +import java.util.List; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.xStore.XStoreAssociationMapping; -import java.util.Collections; -import java.util.List; - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "_type") @JsonSubTypes({ @JsonSubTypes.Type(value = XStoreAssociationMapping.class, name = "xStore") @@ -31,7 +29,6 @@ public abstract class AssociationMapping { public String id; - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) public PackageableElementPointer association; public List stores = Collections.emptyList(); public SourceInformation sourceInformation; 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/mapping/EnumerationMapping.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/mapping/EnumerationMapping.java index 2ff63b18918..7e8f3d768f1 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/mapping/EnumerationMapping.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/mapping/EnumerationMapping.java @@ -15,16 +15,13 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.List; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; -import java.util.List; - public class EnumerationMapping { public String id; - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) public PackageableElementPointer enumeration; public List enumValueMappings; @Deprecated 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/mapping/mappingTest/StoreTestData.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/mapping/mappingTest/StoreTestData.java index 6cc22c0ae5c..60f523b8233 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/mapping/mappingTest/StoreTestData.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/mapping/mappingTest/StoreTestData.java @@ -15,16 +15,13 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.mapping.mappingTest; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.finos.legend.engine.protocol.pure.v1.model.SourceInformation; -import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; import org.finos.legend.engine.protocol.pure.v1.model.data.EmbeddedData; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.StoreProviderPointer; public class StoreTestData { public String doc; - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) public StoreProviderPointer store; public EmbeddedData data; public SourceInformation sourceInformation; 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/store/Store.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/store/Store.java index e9fe1cf5f2f..c39249d7ed5 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/store/Store.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/store/Store.java @@ -14,15 +14,12 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store; -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.packageableElement.PackageableElement; - import java.util.Collections; import java.util.List; +import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; +import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; public abstract class Store extends PackageableElement { - @JsonSerialize(contentConverter = PackageableElementPointer.ToPathSerializerConverter.class) public List includedStores = Collections.emptyList(); } 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 295a037a336..300df9fa20c 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 @@ -16,7 +16,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.Objects; +import java.util.Scanner; import net.javacrumbs.jsonunit.JsonAssert; import org.finos.legend.engine.protocol.pure.v1.PureProtocolObjectMapperFactory; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; @@ -24,9 +25,6 @@ import org.junit.Assert; import org.junit.Test; -import java.util.Objects; -import java.util.Scanner; - public class TestCompatibilityAndMigration { private static final ObjectMapper objectMapper = PureProtocolObjectMapperFactory.getNewObjectMapper() @@ -1853,26 +1851,10 @@ public void testPackageableElementPointerCompatibility() throws Exception Assert.assertEquals(expectedPointerFromObjectConstructor, pointerFromStringConstructor); } - @Test - public void testPackageableElementPointerToPathSerializerConverter() throws Exception - { - String expected = "{\"pointer\":\"abc::myPath::MyName\"}"; - SampleElementWithPackageableElementPointer sampleUsingPtr = objectMapper.readValue(expected, SampleElementWithPackageableElementPointer.class); - String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(sampleUsingPtr); - JsonAssert.assertJsonEquals(expected, json); - Assert.assertEquals("abc::myPath::MyName", sampleUsingPtr.pointer.path); - } - private void check(String input, String output) throws Exception { PureModelContextData context = objectMapper.readValue(input, PureModelContextData.class); String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(context); JsonAssert.assertJsonEquals(output, json); } - - public static class SampleElementWithPackageableElementPointer - { - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) - public PackageableElementPointer pointer; - } } diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/Persistence.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/Persistence.java index 36b4c7e9182..6eae543db2b 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/Persistence.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/Persistence.java @@ -14,22 +14,20 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.List; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; 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.persistence.notifier.Notifier; +import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.persister.Persister; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.service.output.ServiceOutputTarget; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.test.PersistenceTest; -import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.persister.Persister; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.trigger.Trigger; public class Persistence extends PackageableElement { public String documentation; public Trigger trigger; - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) public PackageableElementPointer service; public List serviceOutputTargets; public Persister persister; diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/PersistenceContext.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/PersistenceContext.java index d0ea198855e..a7cab0c126b 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/PersistenceContext.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/PersistenceContext.java @@ -14,7 +14,7 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.List; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElementVisitor; @@ -22,11 +22,8 @@ import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.context.PersistencePlatform; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.service.parameter.ServiceParameter; -import java.util.List; - public class PersistenceContext extends PackageableElement { - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) public PackageableElementPointer persistence; public PersistencePlatform platform; public List serviceParameters; diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/persister/sink/ObjectStorageSink.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/persister/sink/ObjectStorageSink.java index 781369f4400..13183e026b2 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/persister/sink/ObjectStorageSink.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/persister/sink/ObjectStorageSink.java @@ -14,12 +14,10 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.persister.sink; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; public class ObjectStorageSink extends Sink { - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) public PackageableElementPointer binding; @Override diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/persister/sink/RelationalSink.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/persister/sink/RelationalSink.java index 3782175217e..1208bcc65b2 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/persister/sink/RelationalSink.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/persister/sink/RelationalSink.java @@ -14,12 +14,10 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.persister.sink; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.finos.legend.engine.protocol.pure.v1.model.context.PackageableElementPointer; public class RelationalSink extends Sink { - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) public PackageableElementPointer database; @Override diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-target-relational-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/relational/sink/RelationalPersistenceTarget.java b/legend-engine-xts-persistence/legend-engine-xt-persistence-target-relational-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/relational/sink/RelationalPersistenceTarget.java index bb4942b7ed4..f32c8a72789 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-target-relational-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/relational/sink/RelationalPersistenceTarget.java +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-target-relational-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/persistence/relational/sink/RelationalPersistenceTarget.java @@ -14,7 +14,6 @@ package org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.relational.sink; -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.packageableElement.persistence.relational.temporality.Temporality; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.persistence.sink.PersistenceTarget; @@ -23,7 +22,6 @@ public class RelationalPersistenceTarget extends PersistenceTarget { public String table; - @JsonSerialize(converter = PackageableElementPointer.ToPathSerializerConverter.class) public PackageableElementPointer database; public Temporality temporality; From 57d85d674f7aec65628083e98926135d5ce7d836 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Tue, 26 Nov 2024 09:48:24 -0500 Subject: [PATCH 11/17] Remove unused dependency --- .../legend-engine-xt-persistence-protocol/pom.xml | 4 ---- .../pom.xml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/pom.xml b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/pom.xml index 48d5287dac1..f18b4d2bc87 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/pom.xml +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-protocol/pom.xml @@ -43,10 +43,6 @@ com.fasterxml.jackson.core jackson-annotations - - com.fasterxml.jackson.core - jackson-databind - diff --git a/legend-engine-xts-persistence/legend-engine-xt-persistence-target-relational-protocol/pom.xml b/legend-engine-xts-persistence/legend-engine-xt-persistence-target-relational-protocol/pom.xml index 9ca012fa8c0..e84dcdce339 100644 --- a/legend-engine-xts-persistence/legend-engine-xt-persistence-target-relational-protocol/pom.xml +++ b/legend-engine-xts-persistence/legend-engine-xt-persistence-target-relational-protocol/pom.xml @@ -47,10 +47,6 @@ com.fasterxml.jackson.core jackson-annotations - - com.fasterxml.jackson.core - jackson-databind - From 8c8823f8de5b7f9d8ad16fdbc97f082086942c9d Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Tue, 26 Nov 2024 11:29:35 -0500 Subject: [PATCH 12/17] More test fixes --- .../engine/protocol/test/TestCompatibilityAndMigration.java | 2 +- .../src/test/resources/simpleFunctionAfter.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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 300df9fa20c..327f6860feb 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 @@ -1323,7 +1323,7 @@ public void testDataElementReference() throws Exception " \"_type\": \"dataElement\",\n" + " \"data\": {\n" + " \"_type\": \"reference\",\n" + - " \"dataElement\":{\"path\":\"com::path::exampleReference\",\"type\":\"DATA\"}" + + " \"dataElement\":{\"path\":\"com::path::exampleReference\"}" + " },\n" + " \"name\": \"dataElementReferenceExample\",\n" + " \"package\": \"my\"\n" + 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 9e97cbce98d..50fd7b3e19f 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 @@ -767,7 +767,6 @@ "data" : { "_type" : "reference", "dataElement" : { - "type" : "DATA", "path" : "test::other" } } From 8f7187d65cffef1977ff0102de4f5ecbd12ac0cf Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Tue, 26 Nov 2024 14:38:17 -0500 Subject: [PATCH 13/17] More test fixes --- ...eAnalyticsArtifactGenerationExtension.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) 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 915b28df5d5..2a5f4f70b93 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 @@ -131,7 +131,7 @@ public void testAnalyticsForBasicDataSpace() throws Exception "model::dummyMapping2", "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"model::dummyMapping2\",\"model\":{\"_type\":\"data\",\"elements\":[]}}", "model::dummyMapping", "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"model::dummyMapping\",\"model\":{\"_type\":\"data\",\"elements\":[]}}" ); - String expectedContent = "{\"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\":{\"_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\"}]}"; + String expectedContent = "{\"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\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"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\":[{\"path\":\"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_Old", expectedContent, mappingAnalysisMap, @@ -145,13 +145,13 @@ public void testAnalyticsForBasicDataSpace() throws Exception 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\":{\"_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\":[]}", + "{\"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\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"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\":[{\"path\":\"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\":[]}", mappingAnalysisMap, Maps.mutable.empty(), false ); 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\":{\"_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\":[]}", + "{\"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\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"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\":[{\"path\":\"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\":[]}", mappingAnalysisMap, Maps.mutable.empty(), false @@ -171,7 +171,7 @@ 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\":{},\"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\"}", + "{\"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\":{},\"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\":[{\"value\":\"bitemporal\"},{\"value\":\"businesstemporal\"},{\"value\":\"processingtemporal\"}],\"tags\":[]}]},\"name\":\"COVIDDatapace\",\"package\":\"domain\",\"path\":\"domain::COVIDDatapace\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"COVID Sample Data\"}", mappingAnalysisMap, mappingModelMap, true); @@ -187,13 +187,13 @@ public void testAnalyticsForDataSpaceWithSubstantialMapping() throws Exception ); MutableMap mappingModelMap = Maps.mutable.with( - "model::dummyMapping", "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"model::dummyMapping\",\"model\":{\"_type\":\"data\",\"elements\":[{\"_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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"string\",\"value\":\"\"}],\"name\":\"name2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]}]}}", - "model::dummyMapping2", "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"model::dummyMapping2\",\"model\":{\"_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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"string\",\"value\":\"\"}],\"name\":\"name2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"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\":[\"meta::pure::metamodel::type::Any\"],\"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::Animal2\",\"model::animal::Animal\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]}}" + "model::dummyMapping", "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"model::dummyMapping\",\"model\":{\"_type\":\"data\",\"elements\":[{\"_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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"string\",\"value\":\"\"}],\"name\":\"name2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"GenericAnimal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[]}]}}", + "model::dummyMapping2", "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"model::dummyMapping2\",\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"Animal2\",\"originalMilestonedProperties\":[],\"package\":\"model::animal\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[{\"body\":[{\"_type\":\"string\",\"value\":\"\"}],\"name\":\"name2\",\"parameters\":[],\"returnGenericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"returnMultiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"stereotypes\":[],\"taggedValues\":[]}],\"stereotypes\":[],\"superTypes\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"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\":[{\"path\":\"model::animal::Animal2\"},{\"path\":\"model::animal::Animal\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"\"}]}]}}" ); 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\":{\"_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\"}]}", + "{\"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\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"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\":[{\"path\":\"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\"}]}", mappingAnalysisMap, mappingModelMap, true); @@ -207,7 +207,7 @@ public void testAnalyticsForDataSpaceWithElements() throws Exception ); MutableMap mappingModelMap = Maps.mutable.with( "mapping::ModelToModelMapping", - "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::ModelToModelMapping\",\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"Enumeration\",\"name\":\"IncType\",\"package\":\"model::target\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"LLC\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"CORP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"_Firm\",\"originalMilestonedProperties\":[],\"package\":\"model::target\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::target::_Person\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::target::IncType\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"_Person\",\"originalMilestonedProperties\":[],\"package\":\"model::target\",\"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\":[]}]}}" + "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::ModelToModelMapping\",\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"Enumeration\",\"name\":\"IncType\",\"package\":\"model::target\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"LLC\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"CORP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"_Firm\",\"originalMilestonedProperties\":[],\"package\":\"model::target\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::target::_Person\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::target::IncType\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"stereotypes\":[],\"taggedValues\":[]},{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"_Person\",\"originalMilestonedProperties\":[],\"package\":\"model::target\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fullName\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[]}]}}" ); testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithElements.pure", "dataSpace::_FirmDataSpace", @@ -226,7 +226,7 @@ public void testAnalyticsForDataSpaceWithMilestoningElements() throws Exception ); MutableMap mappingModelMap = Maps.mutable.with( "mapping::ModelToModelMapping", - "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::ModelToModelMapping\",\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"BiTemporalMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"profile\",\"name\":\"temporal\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"bitemporal\",\"businesstemporal\",\"processingtemporal\"],\"tags\":[]},{\"_type\":\"Enumeration\",\"name\":\"IncType\",\"package\":\"model::target\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"LLC\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"CORP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"_Firm\",\"originalMilestonedProperties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::target::_Person\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[]}],\"package\":\"model::target\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::target::IncType\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"stereotypes\":[],\"taggedValues\":[]},{\"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::target::_Person\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"_Person\",\"originalMilestonedProperties\":[],\"package\":\"model::target\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fullName\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"bitemporal\"}],\"superTypes\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[]}]}}" + "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::ModelToModelMapping\",\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"class\",\"constraints\":[],\"name\":\"BiTemporalMilestoning\",\"originalMilestonedProperties\":[],\"package\":\"meta::pure::milestoning\",\"properties\":[],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[],\"taggedValues\":[]},{\"_type\":\"profile\",\"name\":\"temporal\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"bitemporal\"},{\"value\":\"businesstemporal\"},{\"value\":\"processingtemporal\"}],\"tags\":[]},{\"_type\":\"Enumeration\",\"name\":\"IncType\",\"package\":\"model::target\",\"stereotypes\":[],\"taggedValues\":[],\"values\":[{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"LLC\"},{\"stereotypes\":[],\"taggedValues\":[],\"value\":\"CORP\"}]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"_Firm\",\"originalMilestonedProperties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::target::_Person\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[]}],\"package\":\"model::target\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"model::target::IncType\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"stereotypes\":[],\"taggedValues\":[]},{\"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::target::_Person\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[],\"superTypes\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[]},{\"_type\":\"class\",\"constraints\":[],\"name\":\"_Person\",\"originalMilestonedProperties\":[],\"package\":\"model::target\",\"properties\":[{\"genericType\":{\"multiplicityArguments\":[],\"rawType\":{\"_type\":\"packageableType\",\"fullPath\":\"String\"},\"typeArguments\":[],\"typeVariableValues\":[]},\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fullName\",\"stereotypes\":[],\"taggedValues\":[]}],\"qualifiedProperties\":[],\"stereotypes\":[{\"profile\":\"meta::pure::profiles::temporal\",\"value\":\"bitemporal\"}],\"superTypes\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[]}]}}" ); testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithMilestoningElements.pure", "dataSpace::_FirmDataSpace", "{\"defaultExecutionContext\":\"dummyContext\",\"diagrams\":[],\"elementDocs\":[{\"_type\":\"class\",\"docs\":[\"Animal class\"],\"name\":\"Animal\",\"path\":\"model::Animal\",\"properties\":[{\"docs\":[\"age\"],\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"age\",\"type\":\"Integer\"}]},{\"_type\":\"class\",\"docs\":[\"The Firm concept\"],\"milestoning\":\"processingtemporal\",\"name\":\"Firm\",\"path\":\"model::Firm\",\"properties\":[{\"docs\":[\"type of firm: e.g. CORP, LTD\"],\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"type\":\"String\"},{\"docs\":[\"some doc for employees\"],\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"type\":\"model::Person\"}]},{\"_type\":\"association\",\"docs\":[],\"name\":\"Firm_Person\",\"path\":\"model::Firm_Person\",\"properties\":[{\"docs\":[\"some doc for employees\"],\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"type\":\"model::Person\"},{\"docs\":[],\"milestoning\":\"processingtemporal\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"firm\",\"type\":\"model::Firm\"}]},{\"_type\":\"class\",\"docs\":[],\"name\":\"LegalEntity\",\"path\":\"model::LegalEntity\",\"properties\":[{\"docs\":[\"name of the entity\"],\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"legalName\",\"type\":\"String\"}]},{\"_type\":\"class\",\"docs\":[],\"name\":\"NotRelevant\",\"path\":\"model::NotRelevant\",\"properties\":[]},{\"_type\":\"class\",\"docs\":[\"Homo Sapien\"],\"name\":\"Person\",\"path\":\"model::Person\",\"properties\":[{\"docs\":[],\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"firstName\",\"type\":\"String\"},{\"docs\":[],\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"lastName\",\"type\":\"String\"},{\"docs\":[],\"milestoning\":\"processingtemporal\",\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"firm\",\"type\":\"model::Firm\"}]},{\"_type\":\"class\",\"docs\":[],\"milestoning\":\"businesstemporal\",\"name\":\"Animal\",\"path\":\"model::experiment::Animal\",\"properties\":[]},{\"_type\":\"class\",\"docs\":[],\"milestoning\":\"businesstemporal\",\"name\":\"Human\",\"path\":\"model::experiment::Human\",\"properties\":[]},{\"_type\":\"enumeration\",\"docs\":[\"Types of company\"],\"enumValues\":[{\"docs\":[\"Limited\"],\"name\":\"LLC\"},{\"docs\":[],\"name\":\"CORP\"}],\"name\":\"IncType\",\"path\":\"model::target::IncType\"},{\"_type\":\"class\",\"docs\":[],\"name\":\"_Firm\",\"path\":\"model::target::_Firm\",\"properties\":[{\"docs\":[],\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"type\",\"type\":\"model::target::IncType\"},{\"docs\":[],\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"name\",\"type\":\"String\"},{\"docs\":[],\"milestoning\":\"bitemporal\",\"multiplicity\":{\"lowerBound\":1},\"name\":\"employees\",\"type\":\"model::target::_Person\"}]},{\"_type\":\"class\",\"docs\":[],\"milestoning\":\"bitemporal\",\"name\":\"_Person\",\"path\":\"model::target::_Person\",\"properties\":[{\"docs\":[],\"multiplicity\":{\"lowerBound\":1,\"upperBound\":1},\"name\":\"fullName\",\"type\":\"String\"}]}],\"elements\":[\"model::Animal\",\"model::Firm\",\"model::Firm_Person\",\"model::LegalEntity\",\"model::NotRelevant\",\"model::Person\",\"model::experiment::Animal\",\"model::experiment::Human\",\"model::target::IncType\",\"model::target::_Firm\",\"model::target::_Person\"],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"mapping::ModelToModelRuntime\"],\"datasets\":[],\"defaultRuntime\":\"mapping::ModelToModelRuntime\",\"mapping\":\"mapping::ModelToModelMapping\",\"name\":\"dummyContext\"}],\"mappingToMappingCoverageResult\":{},\"model\":{\"_type\":\"data\",\"elements\":[]},\"name\":\"_FirmDataSpace\",\"package\":\"dataSpace\",\"path\":\"dataSpace::_FirmDataSpace\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"Firm Dataspace\"}", @@ -244,7 +244,7 @@ public void testAnalyticsForDataSpaceWithExecutables() throws Exception ); MutableMap mappingModelMap = Maps.mutable.with( "mapping::CovidDataMapping", - "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]}]}}" + "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"todo\"}]}]}}" ); testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithExecutables.pure", "domain::COVIDDataspace", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"# Peleus rupit\\n\\n## Sum super gerens paterque\\n\\nLorem markdownum presso, et tamen cogitis, Taenarius lactantia fluxerunt\\nterrita, vota. Tempore flumina ferrumque bella.\\n\\n- Per dixit\\n- Truces tellusque indignata ducem\\n- Cervice venitis cavernis minus\\n\\n## Tum ausus fovebam incursus magis dici extemplo\\n\\nPiscator degenerat desertaque quid scelus tyranni feror ipsa mortis nec silva\\nsparsus neci cum? Est patulas meam decorem, dat demit corpora exuritque Ulixes,\\ngenitore. Captare certa amore pressos, Diamque\\n[traxit](http://istecondar.net/ministropudoris) devorat duritia ecce, capillos\\nfuerint progenitore curva relictas. Iubae pectus et quateret, non vires tibi\\ncacumina figuram Antigonen rursus verti.\\n\\n## Dicta nec Thestiadae tristi exempla sed suoque\\n\\nFlumina quae loricaeque meruique defensae *me terram* tamen attollere totum\\nneque nullos. Quem plus, stratum.\\n\\n## Quaeque si reddite summoque vultu Teleboasque vincere\\n\\nIsmariae me munus umbram. Usum pedem multis quotiensque mirantum Cephenum et\\namori Procne locutum auctor Volturnus pavent virgineas.\\n\\n if (edi + sidebarTooltip < aiffDisk) {\\n drive_key_firewire += bank(searchHardBoot(bus, packet_click));\\n }\\n var adRow = dlc_rootkit(rdramMegabit) - hertzBanner * 2 +\\n memory_adc.horizontal(class_box_rte, disk, lte_grep);\\n if (grayscale) {\\n spool_windows_metal.zif_firewire *= 3;\\n emoticon_mp = user.thunderboltIcqBus.installer_remote(4, searchCable) *\\n kibibyteYoutubeRaster.simm(-3, nosqlCharacter, sip);\\n }\\n var blob = -2;\\n\\n## Est magis interdum in luctus\\n\\nPrimus illa sub bis infregit saepe agrestem Cyllare lumen cultrosque **Cnosia**.\\nSuis est fero durisque satis.\\n\\n- Nos quas est maesta aliquis se unum\\n- Tu ossa Cupido sagitta hanc inflati profuso\\n- Modo est proles pavor\\n- Stillabant pallada invitaque et tantum dictaque in\\n- Generum coegi tum edaci\\n\\nSuo nec cerae me omnem Famemque, passi si auditque ullo, praebita. Gravi annos\\npudore formidabilis erat pectora perpetuo qua oscula cum ad sed Nabataeus\\nRomethiumque deum Erectheus? O Victoria rostro utque terras vitisque classe.\\nTibi [miserrima hirta](http://decentia-qui.net/docta-petentem), eratis saepius\\ntuus.\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[{\"description\":\"Some exec description\",\"executable\":\"service::CovidDataMulti\",\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"Exec 1\"},{\"description\":\"Some more exec description\",\"executable\":\"service::CovidDataSingle\",\"info\":{\"_type\":\"service\",\"datasets\":[{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.DEMOGRAPHICS\",\"schema\":\"default\",\"table\":\"DEMOGRAPHICS\",\"type\":\"H2\"},{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.COVID_DATA\",\"schema\":\"default\",\"table\":\"COVID_DATA\",\"type\":\"H2\"}],\"mapping\":\"mapping::CovidDataMapping\",\"pattern\":\"/9566f101-2108-408f-863f-6d7e154dc17b\",\"query\":\"|domain::COVIDData.all()->project(\\n [\\n x: domain::COVIDData[1]|$x.cases\\n ],\\n ['Cases']\\n)\",\"runtime\":\"runtime::H2Runtime\"},\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"Exec 2\"}],\"executionContexts\":[{\"compatibleRuntimes\":[\"runtime::H2Runtime\"],\"datasets\":[{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.DEMOGRAPHICS\",\"schema\":\"default\",\"table\":\"DEMOGRAPHICS\",\"type\":\"H2\"},{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.COVID_DATA\",\"schema\":\"default\",\"table\":\"COVID_DATA\",\"type\":\"H2\"}],\"defaultRuntime\":\"runtime::H2Runtime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::H2Connection\",\"connectionType\":\"H2\",\"storePath\":\"store::CovidDataStore\"}}],\"mappingToMappingCoverageResult\":{},\"model\":{\"_type\":\"data\",\"elements\":[]},\"name\":\"COVIDDataspace\",\"package\":\"domain\",\"path\":\"domain::COVIDDataspace\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"COVID Sample Data\"}", @@ -262,7 +262,7 @@ public void testAnalyticsForDataSpaceTemplateWithExecutablesWithInlineQuery() th ); MutableMap mappingModelMap = Maps.mutable.with( "mapping::CovidDataMapping", - "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]}]}}" + "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"todo\"}]}]}}" ); testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithTemplateExecutablesWithInlineQuery.pure", "domain::COVIDDataspace", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"this is description of this COVIDDataspace\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[{\"description\":\"Some more exec description\",\"info\":{\"_type\":\"templateExecutableInfo\",\"executionContextKey\":\"dummyContext\",\"id\":\"1\",\"query\":\"|domain::COVIDData.all()->project([x: domain::COVIDData[1]|$x.cases], ['Cases'])\"},\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"this is template\"},{\"info\":{\"_type\":\"templateExecutableInfo\",\"executionContextKey\":\"dummyContext\",\"id\":\"2\",\"query\":\"|domain::COVIDData.all()->project([x: domain::COVIDData[1]|$x.fips], ['Fips'])\"},\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Fips\",\"relationalType\":\"VARCHAR(200)\",\"type\":\"String\"}]},\"title\":\"this is template2\"}],\"executionContexts\":[{\"compatibleRuntimes\":[\"runtime::H2Runtime\"],\"datasets\":[{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.DEMOGRAPHICS\",\"schema\":\"default\",\"table\":\"DEMOGRAPHICS\",\"type\":\"H2\"},{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.COVID_DATA\",\"schema\":\"default\",\"table\":\"COVID_DATA\",\"type\":\"H2\"}],\"defaultRuntime\":\"runtime::H2Runtime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::H2Connection\",\"connectionType\":\"H2\",\"storePath\":\"store::CovidDataStore\"}}],\"mappingToMappingCoverageResult\":{},\"model\":{\"_type\":\"data\",\"elements\":[]},\"name\":\"COVIDDataspace\",\"package\":\"domain\",\"path\":\"domain::COVIDDataspace\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"COVID Sample Data\"}", @@ -280,7 +280,7 @@ public void testAnalyticsForDataSpaceWithExecutableWithFunctionPointer() throws ); MutableMap mappingModelMap = Maps.mutable.with( "mapping::CovidDataMapping", - "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]}]}}" + "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"todo\"}]}]}}" ); testDataSpaceAnalyticsArtifactGenerationExtension("models/dataSpaceWithExecutablesWithFunctionPointer.pure", "domain::COVIDDataspace", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"this is description of this COVIDDataspace\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[{\"description\":\"Some more exec description\",\"executable\":\"domain::COVIDData_QueryFunction__TabularDataSet_1_\",\"info\":{\"_type\":\"functionPointerExecutableInfo\",\"executionContextKey\":\"dummyContext\",\"function\":\"domain::COVIDData_QueryFunction__TabularDataSet_1_\",\"id\":\"1\",\"query\":\"|domain::COVIDData.all()->project([x: domain::COVIDData[1]|$x.cases], ['Cases'])->from(mapping::CovidDataMapping, runtime::H2Runtime)\"},\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"this is template\"},{\"executable\":\"domain::COVIDData_QueryFunction__TabularDataSet_1_\",\"info\":{\"_type\":\"functionPointerExecutableInfo\",\"executionContextKey\":\"dummyContext\",\"function\":\"domain::COVIDData_QueryFunction__TabularDataSet_1_\",\"id\":\"2\",\"query\":\"|domain::COVIDData.all()->project([x: domain::COVIDData[1]|$x.cases], ['Cases'])->from(mapping::CovidDataMapping, runtime::H2Runtime)\"},\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"this is template2\"}],\"executionContexts\":[{\"compatibleRuntimes\":[\"runtime::H2Runtime\"],\"datasets\":[{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.DEMOGRAPHICS\",\"schema\":\"default\",\"table\":\"DEMOGRAPHICS\",\"type\":\"H2\"},{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.COVID_DATA\",\"schema\":\"default\",\"table\":\"COVID_DATA\",\"type\":\"H2\"}],\"defaultRuntime\":\"runtime::H2Runtime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::H2Connection\",\"connectionType\":\"H2\",\"storePath\":\"store::CovidDataStore\"}}],\"mappingToMappingCoverageResult\":{},\"model\":{\"_type\":\"data\",\"elements\":[]},\"name\":\"COVIDDataspace\",\"package\":\"domain\",\"path\":\"domain::COVIDDataspace\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"COVID Sample Data\"}", @@ -297,7 +297,7 @@ public void testAnalyticsForDataSpaceWithAccessEntitlementsToH2() throws Excepti ); MutableMap mappingModelMap = Maps.mutable.with( "mapping::CovidDataMapping", - "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]}]}}" + "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"todo\"}]}]}}" ); testDataSpaceAnalyticsArtifactGenerationExtension("models/dataspaceAccessAnalytics.pure", "domain::COVIDDataspace", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"# Peleus rupit\\n\\n## Sum super gerens paterque\\n\\nLorem markdownum presso, et tamen cogitis, Taenarius lactantia fluxerunt\\nterrita, vota. Tempore flumina ferrumque bella.\\n\\n- Per dixit\\n- Truces tellusque indignata ducem\\n- Cervice venitis cavernis minus\\n\\n## Tum ausus fovebam incursus magis dici extemplo\\n\\nPiscator degenerat desertaque quid scelus tyranni feror ipsa mortis nec silva\\nsparsus neci cum? Est patulas meam decorem, dat demit corpora exuritque Ulixes,\\ngenitore. Captare certa amore pressos, Diamque\\n[traxit](http://istecondar.net/ministropudoris) devorat duritia ecce, capillos\\nfuerint progenitore curva relictas. Iubae pectus et quateret, non vires tibi\\ncacumina figuram Antigonen rursus verti.\\n\\n## Dicta nec Thestiadae tristi exempla sed suoque\\n\\nFlumina quae loricaeque meruique defensae *me terram* tamen attollere totum\\nneque nullos. Quem plus, stratum.\\n\\n## Quaeque si reddite summoque vultu Teleboasque vincere\\n\\nIsmariae me munus umbram. Usum pedem multis quotiensque mirantum Cephenum et\\namori Procne locutum auctor Volturnus pavent virgineas.\\n\\n if (edi + sidebarTooltip < aiffDisk) {\\n drive_key_firewire += bank(searchHardBoot(bus, packet_click));\\n }\\n var adRow = dlc_rootkit(rdramMegabit) - hertzBanner * 2 +\\n memory_adc.horizontal(class_box_rte, disk, lte_grep);\\n if (grayscale) {\\n spool_windows_metal.zif_firewire *= 3;\\n emoticon_mp = user.thunderboltIcqBus.installer_remote(4, searchCable) *\\n kibibyteYoutubeRaster.simm(-3, nosqlCharacter, sip);\\n }\\n var blob = -2;\\n\\n## Est magis interdum in luctus\\n\\nPrimus illa sub bis infregit saepe agrestem Cyllare lumen cultrosque **Cnosia**.\\nSuis est fero durisque satis.\\n\\n- Nos quas est maesta aliquis se unum\\n- Tu ossa Cupido sagitta hanc inflati profuso\\n- Modo est proles pavor\\n- Stillabant pallada invitaque et tantum dictaque in\\n- Generum coegi tum edaci\\n\\nSuo nec cerae me omnem Famemque, passi si auditque ullo, praebita. Gravi annos\\npudore formidabilis erat pectora perpetuo qua oscula cum ad sed Nabataeus\\nRomethiumque deum Erectheus? O Victoria rostro utque terras vitisque classe.\\nTibi [miserrima hirta](http://decentia-qui.net/docta-petentem), eratis saepius\\ntuus.\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[{\"description\":\"Some exec description\",\"executable\":\"service::CovidDataMulti\",\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"Exec 1\"},{\"description\":\"Some more exec description\",\"executable\":\"service::CovidDataSingle\",\"info\":{\"_type\":\"service\",\"datasets\":[{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.DEMOGRAPHICS\",\"schema\":\"default\",\"table\":\"DEMOGRAPHICS\",\"type\":\"H2\"},{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.COVID_DATA\",\"schema\":\"default\",\"table\":\"COVID_DATA\",\"type\":\"H2\"}],\"mapping\":\"mapping::CovidDataMapping\",\"pattern\":\"/9566f101-2108-408f-863f-6d7e154dc17b\",\"query\":\"|domain::COVIDData.all()->project(\\n [\\n x: domain::COVIDData[1]|$x.cases\\n ],\\n ['Cases']\\n)\",\"runtime\":\"runtime::H2Runtime\"},\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"Exec 2\"}],\"executionContexts\":[{\"compatibleRuntimes\":[\"runtime::H2Runtime\",\"runtime::SnowflakeRuntime\"],\"datasets\":[{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.DEMOGRAPHICS\",\"schema\":\"default\",\"table\":\"DEMOGRAPHICS\",\"type\":\"H2\"},{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.COVID_DATA\",\"schema\":\"default\",\"table\":\"COVID_DATA\",\"type\":\"H2\"}],\"defaultRuntime\":\"runtime::H2Runtime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::H2Connection\",\"connectionType\":\"H2\",\"storePath\":\"store::CovidDataStore\"}}],\"mappingToMappingCoverageResult\":{},\"model\":{\"_type\":\"data\",\"elements\":[]},\"name\":\"COVIDDataspace\",\"package\":\"domain\",\"path\":\"domain::COVIDDataspace\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"COVID Sample Data\"}", @@ -315,7 +315,7 @@ public void testAnalyticsForDataSpaceWithAccessEntitlementsToSnowflake() throws ); MutableMap mappingModelMap = Maps.mutable.with( "mapping::CovidDataMapping", - "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[\"meta::pure::metamodel::type::Any\"],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[\"deprecated\"],\"tags\":[\"doc\",\"todo\"]}]}}" + "{\"_type\":\"MappingModelCoveragePartition\",\"mapping\":\"mapping::CovidDataMapping\",\"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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data report consisting of case statistics details and basic information on demographics\"}]},{\"_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\":[{\"path\":\"meta::pure::metamodel::type::Any\"}],\"taggedValues\":[{\"tag\":{\"profile\":\"meta::pure::profiles::doc\",\"value\":\"doc\"},\"value\":\"COVID-19 data demographics consisting of geolocation information\"}]},{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"todo\"}]}]}}" ); testDataSpaceAnalyticsArtifactGenerationExtension("models/dataspaceAccessAnalytics.pure", "domain::COVIDDataspaceSnowflake", "{\"defaultExecutionContext\":\"dummyContext\",\"description\":\"# Peleus rupit\\n\\n## Sum super gerens paterque\\n\\nLorem markdownum presso, et tamen cogitis, Taenarius lactantia fluxerunt\\nterrita, vota. Tempore flumina ferrumque bella.\\n\\n- Per dixit\\n- Truces tellusque indignata ducem\\n- Cervice venitis cavernis minus\\n\\n## Tum ausus fovebam incursus magis dici extemplo\\n\\nPiscator degenerat desertaque quid scelus tyranni feror ipsa mortis nec silva\\nsparsus neci cum? Est patulas meam decorem, dat demit corpora exuritque Ulixes,\\ngenitore. Captare certa amore pressos, Diamque\\n[traxit](http://istecondar.net/ministropudoris) devorat duritia ecce, capillos\\nfuerint progenitore curva relictas. Iubae pectus et quateret, non vires tibi\\ncacumina figuram Antigonen rursus verti.\\n\\n## Dicta nec Thestiadae tristi exempla sed suoque\\n\\nFlumina quae loricaeque meruique defensae *me terram* tamen attollere totum\\nneque nullos. Quem plus, stratum.\\n\\n## Quaeque si reddite summoque vultu Teleboasque vincere\\n\\nIsmariae me munus umbram. Usum pedem multis quotiensque mirantum Cephenum et\\namori Procne locutum auctor Volturnus pavent virgineas.\\n\\n if (edi + sidebarTooltip < aiffDisk) {\\n drive_key_firewire += bank(searchHardBoot(bus, packet_click));\\n }\\n var adRow = dlc_rootkit(rdramMegabit) - hertzBanner * 2 +\\n memory_adc.horizontal(class_box_rte, disk, lte_grep);\\n if (grayscale) {\\n spool_windows_metal.zif_firewire *= 3;\\n emoticon_mp = user.thunderboltIcqBus.installer_remote(4, searchCable) *\\n kibibyteYoutubeRaster.simm(-3, nosqlCharacter, sip);\\n }\\n var blob = -2;\\n\\n## Est magis interdum in luctus\\n\\nPrimus illa sub bis infregit saepe agrestem Cyllare lumen cultrosque **Cnosia**.\\nSuis est fero durisque satis.\\n\\n- Nos quas est maesta aliquis se unum\\n- Tu ossa Cupido sagitta hanc inflati profuso\\n- Modo est proles pavor\\n- Stillabant pallada invitaque et tantum dictaque in\\n- Generum coegi tum edaci\\n\\nSuo nec cerae me omnem Famemque, passi si auditque ullo, praebita. Gravi annos\\npudore formidabilis erat pectora perpetuo qua oscula cum ad sed Nabataeus\\nRomethiumque deum Erectheus? O Victoria rostro utque terras vitisque classe.\\nTibi [miserrima hirta](http://decentia-qui.net/docta-petentem), eratis saepius\\ntuus.\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[{\"description\":\"Some exec description\",\"executable\":\"service::CovidDataMulti\",\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"Exec 1\"},{\"description\":\"Some more exec description\",\"executable\":\"service::CovidDataSingle\",\"info\":{\"_type\":\"service\",\"datasets\":[{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.DEMOGRAPHICS\",\"schema\":\"default\",\"table\":\"DEMOGRAPHICS\",\"type\":\"H2\"},{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.COVID_DATA\",\"schema\":\"default\",\"table\":\"COVID_DATA\",\"type\":\"H2\"}],\"mapping\":\"mapping::CovidDataMapping\",\"pattern\":\"/9566f101-2108-408f-863f-6d7e154dc17b\",\"query\":\"|domain::COVIDData.all()->project(\\n [\\n x: domain::COVIDData[1]|$x.cases\\n ],\\n ['Cases']\\n)\",\"runtime\":\"runtime::H2Runtime\"},\"result\":{\"_type\":\"tds\",\"columns\":[{\"name\":\"Cases\",\"relationalType\":\"INTEGER\",\"type\":\"Float\"}]},\"title\":\"Exec 2\"}],\"executionContexts\":[{\"compatibleRuntimes\":[\"runtime::H2Runtime\",\"runtime::SnowflakeRuntime\"],\"datasets\":[{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.DEMOGRAPHICS\",\"schema\":\"default\",\"table\":\"DEMOGRAPHICS\",\"type\":\"Snowflake\"},{\"_type\":\"relationalDatabaseTable\",\"database\":\"CovidDataStore\",\"name\":\"default.COVID_DATA\",\"schema\":\"default\",\"table\":\"COVID_DATA\",\"type\":\"Snowflake\"}],\"defaultRuntime\":\"runtime::SnowflakeRuntime\",\"mapping\":\"mapping::CovidDataMapping\",\"name\":\"dummyContext\",\"runtimeMetadata\":{\"connectionPath\":\"runtime::connection::SnowflakeConnection\",\"connectionType\":\"Snowflake\",\"storePath\":\"store::CovidDataStore\"}}],\"mappingToMappingCoverageResult\":{},\"model\":{\"_type\":\"data\",\"elements\":[]},\"name\":\"COVIDDataspaceSnowflake\",\"package\":\"domain\",\"path\":\"domain::COVIDDataspaceSnowflake\",\"stereotypes\":[],\"taggedValues\":[],\"title\":\"COVID Sample Data\"}", From d9321ee92372a992f4f40cf72733c4f164da15ab Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Wed, 27 Nov 2024 11:52:03 -0500 Subject: [PATCH 14/17] Fix gql ser/deser --- .../GraphQLPureProtocolExtension.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/legend-engine-xts-graphQL/legend-engine-xt-graphQL-grammar-integration/src/main/java/org/finos/legend/engine/language/graphQL/grammar/integration/GraphQLPureProtocolExtension.java b/legend-engine-xts-graphQL/legend-engine-xt-graphQL-grammar-integration/src/main/java/org/finos/legend/engine/language/graphQL/grammar/integration/GraphQLPureProtocolExtension.java index 7eaa0b49a89..51bad7a3245 100644 --- a/legend-engine-xts-graphQL/legend-engine-xt-graphQL-grammar-integration/src/main/java/org/finos/legend/engine/language/graphQL/grammar/integration/GraphQLPureProtocolExtension.java +++ b/legend-engine-xts-graphQL/legend-engine-xt-graphQL-grammar-integration/src/main/java/org/finos/legend/engine/language/graphQL/grammar/integration/GraphQLPureProtocolExtension.java @@ -14,9 +14,14 @@ package org.finos.legend.engine.language.graphQL.grammar.integration; +import java.util.List; +import org.eclipse.collections.api.block.function.Function0; +import org.eclipse.collections.api.factory.Lists; import org.eclipse.collections.api.list.MutableList; import org.eclipse.collections.impl.factory.Maps; import org.finos.legend.engine.protocol.graphQL.metamodel.Document; +import org.finos.legend.engine.protocol.graphQL.metamodel.ExecutableDocument; +import org.finos.legend.engine.protocol.pure.v1.extension.ProtocolSubTypeInfo; import org.finos.legend.engine.protocol.pure.v1.extension.PureProtocolExtension; import java.util.Map; @@ -29,6 +34,18 @@ public MutableList group() return org.eclipse.collections.impl.factory.Lists.mutable.with("Query", "GraphQL"); } + @Override + public List>>> getExtraProtocolSubTypeInfoCollectors() + { + // during classinstance ser/deser, jackson is not adding the _type of the value + // this leads to deser exceptions + return Lists.fixedSize.with(() -> Lists.fixedSize.with( + ProtocolSubTypeInfo.newBuilder(Document.class) + .withDefaultSubType(ExecutableDocument.class) + .build() + )); + } + @Override public Map getExtraClassInstanceTypeMappings() { From 280af0737442a0c6612c16a91643118ae2bdfd88 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Wed, 27 Nov 2024 19:08:33 -0500 Subject: [PATCH 15/17] Fix ClassInstance serializer --- .../valueSpecification/raw/ClassInstance.java | 22 +++++++++++++++++++ .../test/TestMappingAnalyticsApi.java | 2 +- .../test/TestDiagramAnalyticsApi.java | 10 ++++----- .../GraphQLPureProtocolExtension.java | 17 -------------- 4 files changed, 28 insertions(+), 23 deletions(-) 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/ClassInstance.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/ClassInstance.java index f05e2d577ab..10577dfcc2f 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/ClassInstance.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/ClassInstance.java @@ -14,13 +14,17 @@ package org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.raw; +import com.fasterxml.jackson.core.JsonGenerator; 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.JsonSerializer; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; import org.eclipse.collections.api.factory.Lists; @@ -38,6 +42,7 @@ public class ClassInstance extends One private static Map classMap = PureProtocolObjectMapperFactory.getClassInstanceTypeMappings(); public String type; + @JsonSerialize(using = ClassInstance.ValueSerializer.class, contentUsing = ClassInstance.ValueSerializer.class) public Object value = Lists.mutable.empty(); public ClassInstance() @@ -80,5 +85,22 @@ public ClassInstance deserialize(JsonParser jsonParser, DeserializationContext d return result; } } + + public static class ValueSerializer extends JsonSerializer + { + @Override + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException + { + if (value != null) + { + // force to serialize for the actual type as the default Object serializer is not including "_type" property + gen.writeObject(value); + } + else + { + gen.writeNull(); + } + } + } } 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 9dcdea0dc88..f3b54c5426f 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\":[{\"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\":[]}]}}", + "{\"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\":[{\"path\":\"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\":[{\"path\":\"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-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 dbc52055f3f..7ce900aad05 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\":[{\"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()); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"todo\"}]},{\"_type\":\"profile\",\"name\":\"typemodifiers\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"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\":[{\"path\":\"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\":[{\"path\":\"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\":[{\"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()); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"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\":[{\"path\":\"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\":[{\"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()); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"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\":[{\"path\":\"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\":[{\"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()); + Assert.assertEquals("{\"_type\":\"data\",\"elements\":[{\"_type\":\"profile\",\"name\":\"doc\",\"package\":\"meta::pure::profiles\",\"stereotypes\":[{\"value\":\"deprecated\"}],\"tags\":[{\"value\":\"doc\"},{\"value\":\"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\":[{\"path\":\"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("{\"_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()); + 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\":[{\"value\":\"bitemporal\"},{\"value\":\"businesstemporal\"},{\"value\":\"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-graphQL/legend-engine-xt-graphQL-grammar-integration/src/main/java/org/finos/legend/engine/language/graphQL/grammar/integration/GraphQLPureProtocolExtension.java b/legend-engine-xts-graphQL/legend-engine-xt-graphQL-grammar-integration/src/main/java/org/finos/legend/engine/language/graphQL/grammar/integration/GraphQLPureProtocolExtension.java index 51bad7a3245..7eaa0b49a89 100644 --- a/legend-engine-xts-graphQL/legend-engine-xt-graphQL-grammar-integration/src/main/java/org/finos/legend/engine/language/graphQL/grammar/integration/GraphQLPureProtocolExtension.java +++ b/legend-engine-xts-graphQL/legend-engine-xt-graphQL-grammar-integration/src/main/java/org/finos/legend/engine/language/graphQL/grammar/integration/GraphQLPureProtocolExtension.java @@ -14,14 +14,9 @@ package org.finos.legend.engine.language.graphQL.grammar.integration; -import java.util.List; -import org.eclipse.collections.api.block.function.Function0; -import org.eclipse.collections.api.factory.Lists; import org.eclipse.collections.api.list.MutableList; import org.eclipse.collections.impl.factory.Maps; import org.finos.legend.engine.protocol.graphQL.metamodel.Document; -import org.finos.legend.engine.protocol.graphQL.metamodel.ExecutableDocument; -import org.finos.legend.engine.protocol.pure.v1.extension.ProtocolSubTypeInfo; import org.finos.legend.engine.protocol.pure.v1.extension.PureProtocolExtension; import java.util.Map; @@ -34,18 +29,6 @@ public MutableList group() return org.eclipse.collections.impl.factory.Lists.mutable.with("Query", "GraphQL"); } - @Override - public List>>> getExtraProtocolSubTypeInfoCollectors() - { - // during classinstance ser/deser, jackson is not adding the _type of the value - // this leads to deser exceptions - return Lists.fixedSize.with(() -> Lists.fixedSize.with( - ProtocolSubTypeInfo.newBuilder(Document.class) - .withDefaultSubType(ExecutableDocument.class) - .build() - )); - } - @Override public Map getExtraClassInstanceTypeMappings() { From 78d3bf77e664637829e66315374458176e80e311 Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Wed, 27 Nov 2024 22:14:21 -0500 Subject: [PATCH 16/17] Fix another test case --- .../v1/PureProtocolObjectMapperFactory.java | 42 ++++++++++--------- .../pure/v1/extension/ProtocolConverter.java | 10 ++--- .../valueSpecification/raw/ClassInstance.java | 10 ++--- .../service/TestServiceTestSuite.java | 2 +- 4 files changed, 33 insertions(+), 31 deletions(-) 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/PureProtocolObjectMapperFactory.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/PureProtocolObjectMapperFactory.java index cd1b3ff22f0..9c076d282a2 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/PureProtocolObjectMapperFactory.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/PureProtocolObjectMapperFactory.java @@ -32,7 +32,6 @@ import com.fasterxml.jackson.databind.jsontype.TypeIdResolver; import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.databind.type.TypeFactory; import com.fasterxml.jackson.databind.util.ClassUtil; import java.util.Collection; import java.util.List; @@ -40,14 +39,13 @@ import java.util.Objects; import java.util.Set; import java.util.function.BiConsumer; +import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; import org.eclipse.collections.api.block.function.Function0; import org.eclipse.collections.api.factory.Maps; -import org.eclipse.collections.api.list.MutableList; -import org.eclipse.collections.impl.multimap.list.FastListMultimap; +import org.eclipse.collections.impl.factory.Lists; import org.eclipse.collections.impl.utility.LazyIterate; -import org.eclipse.collections.impl.utility.ListIterate; import org.finos.legend.engine.protocol.pure.v1.extension.ProtocolConverter; import org.finos.legend.engine.protocol.pure.v1.extension.ProtocolSubTypeInfo; import org.finos.legend.engine.protocol.pure.v1.extension.PureProtocolExtension; @@ -101,9 +99,9 @@ public static T withPureProtocolExtensions(T objectMapp return withPureProtocolExtensions(objectMapper, ObjectMapper::registerModule, ObjectMapper::registerSubtypes, excludeSubType); } - public static Map getClassInstanceTypeMappings() + public static Map> getClassInstanceTypeMappings() { - Map result = Maps.mutable.empty(); + Map> result = Maps.mutable.empty(); result.put("path", Path.class); result.put("rootGraphFetchTree", RootGraphFetchTree.class); result.put(">", RelationStoreAccessor.class); @@ -123,7 +121,7 @@ public static Map getClassInstanceTypeMappings() result.put("runtimeInstance", RuntimeInstance.class); result.put("executionContextInstance", ExecutionContextInstance.class); result.put("alloySerializationConfig", SerializationConfig.class); - PureProtocolExtensionLoader.extensions().forEach(extension -> extension.getExtraClassInstanceTypeMappings().entrySet().forEach(e -> result.put(e.getKey(), e.getValue()))); + PureProtocolExtensionLoader.extensions().forEach(extension -> extension.getExtraClassInstanceTypeMappings().forEach(result::put)); return result; } @@ -189,7 +187,13 @@ public static ObjectMapper withPureProtocolConverter(ObjectMapper objectMapper) .flatMap(List::stream) .collect(Collectors.toList()); - FastListMultimap> converterByType = ListIterate.groupBy(protocolConverters, x -> x.getInputType(TypeFactory.defaultInstance())); + Map> converterByType = protocolConverters + .stream() + .collect(Collectors.toMap( + x -> x.getInputType(objectMapper.getTypeFactory()), + Function.identity(), + (a, b) -> ProtocolConverter.merge((ProtocolConverter) a, (ProtocolConverter) b)) + ); DeserializationConfig deserializationConfig = objectMapper .getDeserializationConfig() @@ -203,9 +207,9 @@ public static ObjectMapper withPureProtocolConverter(ObjectMapper objectMapper) private static class ConverterHandlerInstantiator extends HandlerInstantiator { - private final FastListMultimap> converterByType; + private final Map> converterByType; - public ConverterHandlerInstantiator(FastListMultimap> converterByType) + public ConverterHandlerInstantiator(Map> converterByType) { this.converterByType = converterByType; } @@ -213,11 +217,11 @@ public ConverterHandlerInstantiator(FastListMultimap deserializerInstance(DeserializationConfig config, Annotated annotated, Class deserClass) { - MutableList> converters = this.converterByType.get(annotated.getType()); - if (!converters.isEmpty()) + ProtocolConverter converter = this.converterByType.get(annotated.getType()); + if (converter != null) { - JsonDeserializer deser = (JsonDeserializer) ClassUtil.createInstance(deserClass, config.canOverrideAccessModifiers()); - return new StdDelegatingDeserializer<>(ProtocolConverter.merge((List) converters), annotated.getType(), deser); + JsonDeserializer deserializer = (JsonDeserializer) ClassUtil.createInstance(deserClass, config.canOverrideAccessModifiers()); + return new StdDelegatingDeserializer(converter, annotated.getType(), deserializer); } return null; } @@ -249,9 +253,9 @@ public TypeIdResolver typeIdResolverInstance(MapperConfig config, Annotated a private static class ConverterBeanDeserializerModifier extends BeanDeserializerModifier { - private final FastListMultimap> converterByType; + private final Map> converterByType; - public ConverterBeanDeserializerModifier(FastListMultimap> converterByType) + public ConverterBeanDeserializerModifier(Map> converterByType) { this.converterByType = converterByType; } @@ -259,10 +263,10 @@ public ConverterBeanDeserializerModifier(FastListMultimap modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer deserializer) { - MutableList> converters = this.converterByType.get(beanDesc.getType()); - if (!converters.isEmpty()) + ProtocolConverter converter = this.converterByType.get(beanDesc.getType()); + if (converter != null) { - return new StdDelegatingDeserializer(ProtocolConverter.merge((List) converters), beanDesc.getType(), deserializer); + return new StdDelegatingDeserializer(converter, beanDesc.getType(), deserializer); } return deserializer; } 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/extension/ProtocolConverter.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/extension/ProtocolConverter.java index 2cf4daa96a2..061932e5bbd 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/extension/ProtocolConverter.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/extension/ProtocolConverter.java @@ -19,20 +19,20 @@ import com.fasterxml.jackson.databind.type.TypeFactory; import com.fasterxml.jackson.databind.util.Converter; import java.util.List; -import java.util.stream.Collectors; +import org.eclipse.collections.api.list.MutableList; import org.eclipse.collections.impl.factory.Lists; import org.eclipse.collections.impl.utility.ListIterate; public class ProtocolConverter implements Converter { - private final List> converters; + private final List> converters; public ProtocolConverter(Converter converters) { this(Lists.fixedSize.of(converters)); } - public ProtocolConverter(List> converters) + public ProtocolConverter(List> converters) { this.converters = converters; } @@ -55,9 +55,9 @@ public T convert(T value) return ListIterate.injectInto(value, this.converters, (t, c) -> c.convert(t)); } - public static ProtocolConverter merge(List> converters) + public static ProtocolConverter merge(ProtocolConverter one, ProtocolConverter two) { - List> allConverters = converters.stream().flatMap(x -> x.converters.stream()).collect(Collectors.toList()); + MutableList> allConverters = Lists.mutable.withAll(one.converters).withAll(two.converters); return new ProtocolConverter<>(allConverters); } } 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/ClassInstance.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/ClassInstance.java index 10577dfcc2f..25b7f915895 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/ClassInstance.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/ClassInstance.java @@ -21,25 +21,23 @@ import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; +import java.io.IOException; +import java.util.Map; 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.valueSpecification.ValueSpecification; import org.finos.legend.engine.protocol.pure.v1.model.valueSpecification.ValueSpecificationVisitor; -import java.io.IOException; -import java.util.Map; - @JsonDeserialize(using = ClassInstance.InstanceValueDeserializer.class) public class ClassInstance extends One { - private static Map classMap = PureProtocolObjectMapperFactory.getClassInstanceTypeMappings(); + private static final Map> classMap = PureProtocolObjectMapperFactory.getClassInstanceTypeMappings(); public String type; @JsonSerialize(using = ClassInstance.ValueSerializer.class, contentUsing = ClassInstance.ValueSerializer.class) @@ -72,7 +70,7 @@ public ClassInstance deserialize(JsonParser jsonParser, DeserializationContext d JsonNode node = oc.readTree(jsonParser); ClassInstance result = new ClassInstance(); result.type = node.get("type").textValue(); - java.lang.Class _class = classMap.get(result.type); + Class _class = classMap.get(result.type); if (_class == null) { throw new RuntimeException("Can't parse the ClassInstance value for type '" + result.type + "'"); diff --git a/legend-engine-xts-service/legend-engine-test-runner-service/src/test/java/org/finos/legend/engine/testable/service/TestServiceTestSuite.java b/legend-engine-xts-service/legend-engine-test-runner-service/src/test/java/org/finos/legend/engine/testable/service/TestServiceTestSuite.java index c0f36932332..595f1f829c4 100644 --- a/legend-engine-xts-service/legend-engine-test-runner-service/src/test/java/org/finos/legend/engine/testable/service/TestServiceTestSuite.java +++ b/legend-engine-xts-service/legend-engine-test-runner-service/src/test/java/org/finos/legend/engine/testable/service/TestServiceTestSuite.java @@ -1204,8 +1204,8 @@ public void testServiceTestSuiteWithServiceStore() " | gerParam=1&floatParam=1.123&booleanParam=false\n" + " |\n" + "Query: booleanParam = false | booleanParam: false\n" + - "Query: stringParam = dummy | stringParam: dummy\n" + "Query: floatParam = 1.123 | floatParam: 1.123\n" + + "Query: stringParam = dummy | stringParam: dummy\n" + " |\n" + " |\n" + "-----------------------------------------------------------------------------------------------------------------------\n"))); From be8bcb7560d8e4ab01488d10c369ac8c7aeeef7b Mon Sep 17 00:00:00 2001 From: Rafael Bey Date: Thu, 28 Nov 2024 08:34:02 -0500 Subject: [PATCH 17/17] BugFix - deserialize ClassInstance source information --- .../valueSpecification/raw/ClassInstance.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) 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/ClassInstance.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/ClassInstance.java index 25b7f915895..054368dccde 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/ClassInstance.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/ClassInstance.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.util.Map; import org.eclipse.collections.api.factory.Lists; +import org.finos.legend.engine.protocol.pure.v1.ProcessHelper; 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; @@ -40,7 +41,7 @@ public class ClassInstance extends One private static final Map> classMap = PureProtocolObjectMapperFactory.getClassInstanceTypeMappings(); public String type; - @JsonSerialize(using = ClassInstance.ValueSerializer.class, contentUsing = ClassInstance.ValueSerializer.class) + @JsonSerialize(using = ClassInstance.ValueSerializer.class) public Object value = Lists.mutable.empty(); public ClassInstance() @@ -80,10 +81,13 @@ public ClassInstance deserialize(JsonParser jsonParser, DeserializationContext d ((ObjectNode) node.get("value")).set("_type", new TextNode(result.type)); // For backward compatibility } result.value = oc.treeToValue(node.get("value"), _class); + result.sourceInformation = ProcessHelper.processOne(node, "sourceInformation", SourceInformation.class, oc); return result; } } + // Jackson prefer static typing, and value is of type Object, preventing Jackson from figuring out the proper serializer + // Hence, his forces to serialize for the actual type in a dynamic manner and ensure "_type" property is uncluded public static class ValueSerializer extends JsonSerializer { @Override @@ -91,8 +95,19 @@ public void serialize(Object value, JsonGenerator gen, SerializerProvider serial { if (value != null) { - // force to serialize for the actual type as the default Object serializer is not including "_type" property - gen.writeObject(value); + if (value instanceof Iterable) + { + gen.writeStartArray(); + for (Object v : (Iterable) value) + { + gen.writeObject(v); + } + gen.writeEndArray(); + } + else + { + gen.writeObject(value); + } } else {