From 88ccfb4cb1caae3e4ea3801846973b28d0bf4dfc Mon Sep 17 00:00:00 2001 From: FINOS Administrator <37706051+finos-admin@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:58:14 +0000 Subject: [PATCH] Update showcases index --- website/static/showcases/data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/static/showcases/data.json b/website/static/showcases/data.json index 62fd8595d..b7a96b854 100644 --- a/website/static/showcases/data.json +++ b/website/static/showcases/data.json @@ -1 +1 @@ -[{"title":"Build a Relational service","documentation":"TODO: Some dummy description","development":true,"path":"End To End Examples/Build a relational service","code":""},{"title":"Build an M2M hosted service","documentation":"TODO: Some dummy description","development":true,"path":"End To End Examples/Build an M2M hosted service","code":""},{"title":"Integrate Mappings","description":"How to integrate your mapping with another group's model without tying yourself to their underlying physical implementation or specific mapping.","documentation":"In this example, the producer of the LegalEntityMapping has released a mapping of LegalEntity. The consumers have created their own mapping (TradeMapping) which they would like to join against the producer mapping for legal entity.\n\nIn order to prevent unnecessarily tying their model to the implementation details of the producer's mapping, they include the producer's dataspace in TradeMapping. Including a dataspace, rather than a mapping, creates a layer of abstraction that protects both parties from unnecessary difficulty when a producer needs to migrate users onto a new mapping. Instead, the dataspace's underlying default mapping is always included behind-the-scenes by the compiler.\n\nThe consumer then defines a XStore Association between their trade class and the default class mapping ID of the Legal Entity class (com_entity_LegalEntity), which is derived from the package address of the target class. This cross store join allows the consumer to tie their mapping to the target class without explicitly defining the SQL joins occurring behind the scenes. The TradeDB and EntityDB can exist independently as packageable elements without hard-coded dependencies on one another.\n\nThe consumer then defines the locality of the stores within the runtime, by co-locating them underneath the same connection. With this language, the compiler can immediately understand whether to treat the XStore Associations between mappings as truly Cross-Store or Local. If a consumer's runtime only has a single connection, they can leverage a SingleConnectionRuntime to inform the platform that all stores underneath the listed mappings of this runtime are co-located.\n\nFinally, when setting up their service or function, the consumer can leverage the test data provided by the producers in their dataspace. For a service, the consumer can place the data underneath the appropriate connection. For a function, the consumer will need to list it underneath the dataspace reference with the displayed syntax. Similar to other functionality, this level of abstraction keeps the consumer from tying their code to the implementation details of the producer store.","path":"End To End Examples/Integrate Mappings","code":"###Data\nData com::entity::EntityData\n{\n Relational\n #{\n Entity.LegalEntity:\n 'ENTITY_ID,name\\n'+\n 'abc,Entity1\\n'+\n 'def,Entity2\\n';\n }#\n}\n\n\n###Relational\nDatabase com::trade::TradeDatabase\n(\n Schema Trade\n (\n Table Trade\n (\n id VARCHAR(32) PRIMARY KEY,\n value INTEGER NOT NULL,\n ENTITY_ID_FK VARCHAR(32) NOT NULL\n )\n )\n)\n\nDatabase com::entity::EntityDatabase\n(\n Schema Entity\n (\n Table LegalEntity\n (\n ENTITY_ID VARCHAR(32) PRIMARY KEY,\n name VARCHAR(32) NOT NULL\n )\n\n View LegalEntity_View\n (\n ENTITY_ID: Entity.LegalEntity.ENTITY_ID PRIMARY KEY,\n name: Entity.LegalEntity.name PRIMARY KEY\n )\n )\n)\n\n\n###Service\nService com::trade::ServiceSimpleProject\n{\n pattern: '/trade/simpleJoinProjectService';\n owners:\n [\n 'user1',\n 'user2'\n ];\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |com::trade::Trade.all()->project(\n [\n x: com::trade::Trade[1]|$x.value,\n x: com::trade::Trade[1]|$x.client.name\n ],\n [\n 'Value',\n 'Client/Name'\n ]\n );\n mapping: com::trade::TradeWithLegalEntityMapping;\n runtime: com::trade::AlternativeTradeRuntime;\n }\n testSuites:\n [\n testSuite_1:\n {\n data:\n [\n connections:\n [\n com::trade::TradeConnection:\n Relational\n #{\n Trade.Trade:\n 'id,value,ENTITY_ID_FK\\n'+\n '1,100,abc\\n'+\n '2,200,def\\n';\n }#,\n com::trade::TradeConnection:\n DataspaceTestData\n #{\n com::entity::EntityDataSpace\n }#\n ]\n ]\n tests:\n [\n test_1:\n {\n serializationFormat: PURE_TDSOBJECT;\n asserts:\n [\n assertion_1:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '[ {\\n \"Value\" : 100,\\n \"Client/Name\" : \"Entity1\"\\n}, {\\n \"Value\" : 200,\\n \"Client/Name\" : \"Entity2\"\\n} ]';\n }#;\n }#\n ]\n }\n ]\n }\n ]\n}\n\n\n###DataSpace\nDataSpace com::entity::EntityDataSpace\n{\n executionContexts:\n [\n {\n name: 'default';\n mapping: com::entity::LegalEntityMapping;\n defaultRuntime: com::entity::EntityRuntime;\n testData:\n Reference\n #{\n com::entity::EntityData\n }#;\n }\n ];\n defaultExecutionContext: 'default';\n}\n\n\n###Pure\nClass com::entity::LegalEntity\n{\n entityId: String[1];\n name: String[1];\n}\n\nClass com::trade::Trade\n{\n id: String[1];\n value: Integer[1];\n}\n\nAssociation com::trade::Trade_LegalEntity\n{\n client: com::entity::LegalEntity[1];\n trades: com::trade::Trade[*];\n}\n\n\n###Mapping\nMapping com::entity::LegalEntityMapping\n(\n *com::entity::LegalEntity: Relational\n {\n ~primaryKey\n (\n [com::entity::EntityDatabase]Entity.LegalEntity_View.ENTITY_ID\n )\n ~mainTable [com::entity::EntityDatabase]Entity.LegalEntity_View\n entityId: [com::entity::EntityDatabase]Entity.LegalEntity_View.ENTITY_ID,\n name: [com::entity::EntityDatabase]Entity.LegalEntity_View.name\n }\n)\n\nMapping com::trade::TradeWithLegalEntityMapping\n(\n include dataspace com::entity::EntityDataSpace\n\n com::trade::Trade[trade]: Relational\n {\n ~primaryKey\n (\n [com::trade::TradeDatabase]Trade.Trade.id\n )\n ~mainTable [com::trade::TradeDatabase]Trade.Trade\n id: [com::trade::TradeDatabase]Trade.Trade.id,\n value: [com::trade::TradeDatabase]Trade.Trade.value,\n +entityIdFk: String[1]: [com::trade::TradeDatabase]Trade.Trade.ENTITY_ID_FK\n }\n\n com::trade::Trade_LegalEntity: XStore\n {\n client[trade, com_entity_LegalEntity]: $this.entityIdFk ==\n $that.entityId,\n trades[com_entity_LegalEntity, trade]: $this.entityId ==\n $that.entityIdFk\n }\n)\n\n\n###Connection\nRelationalDatabaseConnection com::entity::EntityConnection\n{\n store: com::entity::EntityDatabase;\n type: H2;\n specification: LocalH2\n {\n };\n auth: DefaultH2;\n}\n\nRelationalDatabaseConnection com::trade::TradeConnection\n{\n store: com::trade::TradeDatabase;\n type: H2;\n specification: LocalH2\n {\n };\n auth: DefaultH2;\n}\n\n\n###Runtime\nRuntime com::entity::EntityRuntime\n{\n mappings:\n [\n com::entity::LegalEntityMapping\n ];\n connectionStores:\n [\n com::entity::EntityConnection:\n [\n com::entity::EntityDatabase\n ]\n ];\n}\n\nRuntime com::trade::TradeRuntime\n{\n mappings:\n [\n com::trade::TradeWithLegalEntityMapping\n ];\n connectionStores:\n [\n com::trade::TradeConnection:\n [\n com::trade::TradeDatabase,\n com::entity::EntityDatabase\n ]\n ];\n}\n\nSingleConnectionRuntime com::trade::AlternativeTradeRuntime\n{\n mappings:\n [\n com::trade::TradeWithLegalEntityMapping\n ];\n connection: com::trade::TradeConnection;\n}\n"},{"title":"Avro Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Avro/Binding","code":""},{"title":"Avro Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Avro/Externalize","code":""},{"title":"Avro Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Avro/Internalize","code":""},{"title":"CSV Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Flat Data/CSV/Binding","code":""},{"title":"CSV Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Flat Data/CSV/Externalize","code":""},{"title":"CSV Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Flat Data/CSV/Internalize","code":""},{"title":"JSON Schema Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/JSONSchema/Binding","code":""},{"title":"JSON Schema Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/JSONSchema/Externalize","code":""},{"title":"JSON Schema Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/JSONSchema/Internalize","code":""},{"title":"Protobuf Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Protobuf/Binding","code":""},{"title":"Protobuf Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Protobuf/Externalize","code":""},{"title":"Protobuf Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Protobuf/Internalize","code":""},{"title":"XML Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XML/Binding","code":""},{"title":"XML Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XML/Externalize","code":""},{"title":"XML Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XML/Internalize","code":""},{"title":"XStore Avro Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XStore Avro/Binding","code":""},{"title":"XStore Avro Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XStore Avro/Externalize","code":""},{"title":"XStore Avro Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XStore Avro/Internalize","code":""},{"title":"Graph QL file generation","documentation":"TODO: Some dummy description","development":true,"path":"Generation/Generate files/GraphQL","code":""},{"title":"Jave file generation","documentation":"TODO: Some dummy description","development":true,"path":"Generation/Generate files/Java","code":""},{"title":"Python file generation","documentation":"TODO: Some dummy description","development":true,"path":"Generation/Generate files/Python","code":""},{"title":"Slang file generation","documentation":"TODO: Some dummy description","development":true,"path":"Generation/Generate files/Slang","code":""},{"title":"Big Query activator","documentation":"TODO: Some dummy description","development":true,"path":"Lambda/Activator - Big Query","code":""},{"title":"Hosted service activator","documentation":"TODO: Some dummy description","development":true,"path":"Lambda/Activator - Hosted service","code":""},{"title":"Activator - Service Jar","documentation":"Service execution Jar showcase.","path":"Lambda/Activator - Service Jar","code":"###Diagram\nDiagram diagram::all\n{\n classView 0dee659c-6d6d-41d0-a326-dd0e63250732\n {\n class: domain::Firm;\n position: (639.0,202.0);\n rectangle: (134.32373046875,58.0);\n }\n classView 860aafab-2ae2-4714-8f4e-7d8924c6cec8\n {\n class: domain::Person;\n position: (644.0,327.0);\n rectangle: (124.521484375,58.0);\n }\n propertyView\n {\n property: domain::Person.firm;\n source: 860aafab-2ae2-4714-8f4e-7d8924c6cec8;\n target: 0dee659c-6d6d-41d0-a326-dd0e63250732;\n points: [(706.2607421875,356.0),(706.161865234375,231.0)];\n }\n propertyView\n {\n property: domain::Firm.employees;\n source: 0dee659c-6d6d-41d0-a326-dd0e63250732;\n target: 860aafab-2ae2-4714-8f4e-7d8924c6cec8;\n points: [(706.161865234375,231.0),(706.2607421875,356.0)];\n }\n}\n\n\n###Relational\nDatabase database::h2\n(\n Table PERSON\n (\n ID INTEGER PRIMARY KEY,\n FIRMID INTEGER,\n FIRST_NAME VARCHAR(200),\n LAST_NAME VARCHAR(200)\n )\n Table FIRM\n (\n ID INTEGER PRIMARY KEY,\n LEGAL_NAME VARCHAR(200)\n )\n\n Join Firm_Person(PERSON.FIRMID = FIRM.ID)\n)\n\n\n###Pure\nClass domain::Person\n{\n firstName: String[1];\n lastName: String[1];\n}\n\nClass domain::S_Person\n{\n fullName: String[1];\n}\n\nClass domain::Firm\n{\n legalName: String[1];\n}\n\nClass domain::S_Firm\n{\n legalName: String[1];\n}\n\nAssociation domain::Firm_Person\n{\n firm: domain::Firm[1];\n employees: domain::Person[*];\n}\n\nAssociation domain::S_Firm_S_Person\n{\n firm: domain::S_Firm[1];\n employees: domain::S_Person[*];\n}\n\n\n###Mapping\nMapping mapping::m2m::Firm_Person\n(\n domain::Person: Pure\n {\n ~src domain::S_Person\n firstName: $src.fullName->substring(\n 0,\n $src.fullName->indexOf(' ')\n),\n lastName: $src.fullName->substring(\n $src.fullName->indexOf(' ') + 1,\n $src.fullName->length()\n)\n }\n domain::Firm: Pure\n {\n ~src domain::S_Firm\n legalName: $src.legalName,\n employees[domain_Person]: $src.employees\n }\n\n MappingTests\n [\n test_1\n (\n query: |domain::Firm.all()->graphFetch(\n #{\n domain::Firm{\n legalName,\n employees{\n firstName\n }\n }\n }#\n)->serialize(\n #{\n domain::Firm{\n legalName,\n employees{\n firstName\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '[{\"legalName\":\"ACME Corp.\",\"employees\":[{\"firstName\":\"Road\"},{\"firstName\":\"Wile\"}]},{\"legalName\":\"Monsters Inc.\",\"employees\":[{\"firstName\":\"Jake\"},{\"firstName\":\"Mike\"}]}]';\n )\n ]\n)\n\nMapping mapping::relational::Firm_Person\n(\n domain::Person: Relational\n {\n ~primaryKey\n (\n [database::h2]PERSON.ID\n )\n ~mainTable [database::h2]PERSON\n firstName: [database::h2]PERSON.FIRST_NAME,\n lastName: [database::h2]PERSON.LAST_NAME\n }\n domain::Firm: Relational\n {\n ~primaryKey\n (\n [database::h2]FIRM.ID\n )\n ~mainTable [database::h2]FIRM\n legalName: [database::h2]FIRM.LEGAL_NAME,\n employees[domain_Person]: [database::h2]@Firm_Person\n }\n\n MappingTests\n [\n test_1\n (\n query: |domain::Firm.all()->project(\n [\n x: domain::Firm[1]|$x.legalName,\n x: domain::Firm[1]|$x.employees.firstName,\n x: domain::Firm[1]|$x.employees.lastName\n ],\n [\n 'Legal Name',\n 'Employees/First Name',\n 'Employees/Last Name'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[\"ACME Corp.\",\"Road\",\"Runner\"]},{\"values\":[\"ACME Corp.\",\"Wile\",\"Coyote\"]},{\"values\":[\"Monsters Inc.\",\"Jake\",\"Sullivan\"]},{\"values\":[\"Monsters Inc.\",\"Mike\",\"Wazwoski\"]}]';\n )\n ]\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::h2\n{\n store: database::h2;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'drop table if exists FIRM',\n 'create table FIRM(ID INTEGER, LEGAL_NAME VARCHAR(200))',\n 'insert into FIRM(ID, LEGAL_NAME) values(100, \\'ACME Corp.\\')',\n 'insert into FIRM(ID, LEGAL_NAME) values(200, \\'Monsters Inc.\\')',\n 'drop table if exists PERSON;',\n 'create table PERSON(ID INTEGER, FIRMID INTEGER, FIRST_NAME VARCHAR(200), LAST_NAME VARCHAR(200))',\n 'insert into PERSON(ID, FIRMID, FIRST_NAME, LAST_NAME) values(1, 100, \\'Road\\', \\'Runner\\')',\n 'insert into PERSON(ID, FIRMID, FIRST_NAME, LAST_NAME) values(2, 100, \\'Wile\\', \\'Coyote\\')',\n 'insert into PERSON(ID, FIRMID, FIRST_NAME, LAST_NAME) values(3, 200, \\'Jake\\', \\'Sullivan\\')',\n 'insert into PERSON(ID, FIRMID, FIRST_NAME, LAST_NAME) values(4, 200, \\'Mike\\', \\'Wazwoski\\')'\n ];\n };\n auth: DefaultH2;\n}\n"},{"title":"Snowflake activator","documentation":"TODO: Some dummy description","development":true,"path":"Lambda/Activator - Snowflake","code":""},{"title":"Function Tests","description":"Simple Function with Tests","documentation":"The following showcase shows how to write tests for simple functions with and without parameters. Adding tests to your functions will help ensure your function behaves as expected as it is changed by other users.","path":"Lambda/Function Tests","code":"function model::Simple(): String[1]\n{\n 'Hello' + ' World!'\n}\n{\n testPass | Simple() => 'Hello World!';\n}\n\nfunction model::Hello(name: String[1]): String[1]\n{\n 'Hello World! My name is ' + $name + '.'\n}\n{\n testSuite_1\n (\n testPass | Hello('John') => 'Hello World! My name is John.';\n )\n}\n\nfunction model::SimpleReference(): String[1]\n{\n model::Simple()\n}\n{\n testPass | SimpleReference() => 'Hello World!';\n}\n"},{"title":"String function","description":"Showcases native string legend functions","documentation":"Showcases native string legend functions","path":"Lambda/Write Functions/String Functions","code":"function legend::string::test::testTrim(val: String[1]): String[1]\n{\n $val->trim()\n}\n{\n test1 | testTrim(' A Simple Text To Trim ') => 'A Simple Text To Trim';\n test2 | testTrim(' A Simple Text To Trim') => 'A Simple Text To Trim';\n}\n\nfunction legend::string::test::testToUpper(val: String[1]): String[1]\n{\n $val->toUpper()\n}\n{\n test1 | testToUpper('TesT') => 'TEST';\n test2 | testToUpper('TEST') => 'TEST';\n}\n\nfunction legend::string::test::testToLower(val: String[1]): String[1]\n{\n $val->toLower()\n}\n{\n test1 | testToLower('TesT') => 'test';\n test2 | testToLower('TEST') => 'test';\n}\n\nfunction legend::string::test::testParseInteger(val: String[1]): Integer[1]\n{\n $val->parseInteger()\n}\n{\n test1 | testParseInteger('17') => 17;\n test2 | testParseInteger('+00000017') => 17;\n test3 | testParseInteger('-17') => -17;\n test4 | testParseInteger('9999999999999992') => 9999999999999992;\n}\n\nfunction legend::string::test::testParseFloat(val: String[1]): Float[1]\n{\n $val->parseFloat()\n}\n{\n test1 | testParseFloat('3.14159') => 3.14159;\n test2 | testParseFloat('+0000003.1415900000') => 3.14159;\n test3 | testParseFloat('-0000003.1415900000') => -3.14159;\n test4 | testParseFloat('0.0') => 0.0;\n}\n"},{"title":"Build A Data model","documentation":"Learn how to build foundational data model elements: packages, classes, associations, profiles, functions, units/measures, data elements, diagrams, enumerations, constraints, derived properties, supertypes, tagged values, stereotypes...","development":true,"path":"Model/Build a data model","code":"###Diagram\nDiagram _02_advanced::FinalTradeAccountDiagram\n{\n classView 2607efb4-489b-451c-9fe0-3ee0f71191db\n {\n class: _01_basic::Trade;\n position: (1150.5257568359375,706.5);\n rectangle: (207.88623046875,184.0);\n }\n classView 3f9f55f3-0f34-4aa5-972b-6fb0d0839393\n {\n class: _01_basic::TradeEvent;\n position: (1528.4548415786112,750.0066923369803);\n rectangle: (146.54296875,72.0);\n }\n classView dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d\n {\n class: _01_basic::Account;\n position: (804.5257568359375,756.0);\n rectangle: (179.53759765625,72.0);\n }\n classView 742b39b1-983a-4913-bad9-a45654973427\n {\n class: _02_advanced::AccountWithConstraints;\n position: (789.9989051643056,921.25);\n rectangle: (206.46875,58.0);\n }\n classView 931cb999-5873-4fcd-8e9b-0ca4f1cf9a3f\n {\n class: _02_advanced::SynonymStereoTyped;\n position: (1170.9989051643056,579.625);\n rectangle: (180.54736328125,86.0);\n }\n classView dfcaa3ce-a0e4-47ca-8a08-937129ab8c5e\n {\n class: _02_advanced::ProductUpdated;\n position: (763.9989051643056,565.625);\n rectangle: (224.7783203125,114.0);\n }\n classView 1e46b918-d9c4-4212-90b3-0b51992421dc\n {\n class: _01_basic::Trader;\n position: (1536.7489051643056,594.1887199867499);\n rectangle: (117.796875,58.0);\n }\n propertyView\n {\n property: _01_basic::Account.trades;\n source: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(977.9580688476562,781.5),(1204.9580688476562,782.5)];\n }\n propertyView\n {\n property: _01_basic::Trade.account;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(1156.9580688476562,819.5),(957.9580688476562,819.5)];\n }\n propertyView\n {\n property: _01_basic::Trade.events;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n points: [(1340.9989051643056,779.6887199867499),(1544.9989051643056,779.6887199867499)];\n }\n propertyView\n {\n property: _01_basic::TradeEvent.trade;\n source: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(1533.9989051643056,813.6887199867499),(1320.9989051643056,813.6887199867499)];\n }\n propertyView\n {\n property: _02_advanced::ProductUpdated.synonyms;\n source: dfcaa3ce-a0e4-47ca-8a08-937129ab8c5e;\n target: 931cb999-5873-4fcd-8e9b-0ca4f1cf9a3f;\n points: [(876.3880653205556,622.625),(1261.2725868049306,622.625)];\n }\n propertyView\n {\n property: _02_advanced::SynonymStereoTyped.product;\n source: 931cb999-5873-4fcd-8e9b-0ca4f1cf9a3f;\n target: dfcaa3ce-a0e4-47ca-8a08-937129ab8c5e;\n points: [(1261.2725868049306,622.625),(876.3880653205556,622.625)];\n }\n generalizationView\n {\n source: 742b39b1-983a-4913-bad9-a45654973427;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(893.2332801643056,950.25),(894.2945556640625,792.0)];\n }\n}\n\nDiagram _01_basic::TradeAccountDiagram\n{\n classView 7bac7403-9f7b-44e3-8396-de6093534159\n {\n class: _01_basic::Product;\n position: (789.0,567.0);\n rectangle: (237.00830078125,114.0);\n }\n classView 1e46b918-d9c4-4212-90b3-0b51992421dc\n {\n class: _01_basic::Trader;\n position: (1528.7489051643056,576.1887199867499);\n rectangle: (117.796875,58.0);\n }\n classView 0dd5c051-e28d-413a-a94e-567128bcdbc9\n {\n class: _01_basic::Synonym;\n position: (1170.254150390625,579.5);\n rectangle: (180.54736328125,72.0);\n }\n classView 2607efb4-489b-451c-9fe0-3ee0f71191db\n {\n class: _01_basic::Trade;\n position: (1150.5257568359375,706.5);\n rectangle: (207.88623046875,184.0);\n }\n classView 3f9f55f3-0f34-4aa5-972b-6fb0d0839393\n {\n class: _01_basic::TradeEvent;\n position: (1528.4548415786112,750.0066923369803);\n rectangle: (146.54296875,72.0);\n }\n classView dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d\n {\n class: _01_basic::Account;\n position: (799.5257568359375,757.0);\n rectangle: (179.53759765625,72.0);\n }\n propertyView\n {\n property: _01_basic::Account.trades;\n source: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(972.9580688476562,782.5),(1204.9580688476562,782.5)];\n }\n propertyView\n {\n property: _01_basic::Trade.account;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(1156.9580688476562,819.5),(952.9580688476562,820.5)];\n }\n propertyView\n {\n property: _01_basic::Trade.events;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n points: [(1340.9989051643056,779.6887199867499),(1544.9989051643056,779.6887199867499)];\n }\n propertyView\n {\n property: _01_basic::TradeEvent.trade;\n source: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(1533.9989051643056,813.6887199867499),(1320.9989051643056,813.6887199867499)];\n }\n}\n\n\n###Text\nText _01_basic::README\n{\n type: markdown;\n content: '### Logical Modeling Showcase\\n\\nThis package contains showcase model to demonstrate logical modeling capabilities of Legend\\nIn this showcase, we will show the following:\\n1) How to create new Classes\\n2) How to define associations between related classes\\n3) How to define multiplicities for the fields in a Class\\n4) How to define enumerations\\n5) How to create a diagrams\\n6) How to create a doc like the one you are reading right now';\n}\n\nText _02_advanced::README\n{\n type: markdown;\n content: '###Advanced Modeling Concepts\\n\\nThis package builds upon the basic model developed in previous package and add more features to the model.\\nIn this showcase, we will show the following:\\n1. Class Inheritance\\n2. Derived Properties\\n3. Constraints\\n4. Stereotypes\\n5. Tags\\n\\n\\n';\n}\n\nText _03_modelToModelMapping::README\n{\n type: markdown;\n content: '###Model to Model Mapping\\n\\nThis package contains showcase models to demonstrate Model to model mapping which involves \\nthe transformation of data from source to the desired target model.\\nIn this showcase, we will cover the following:\\n1. Simple Model to model Mapping\\n2. Filtering within a mapping\\n3. Testing the m2m mapping \\n4. Union mappings';\n}\n\n\n###Pure\nEnum _01_basic::ProductSynonymType\n{\n CUSIP,\n ISIN,\n SEDOL\n}\n\nClass _01_basic::Product\n{\n name: String[1];\n classification: _01_basic::ProductClassification[0..1];\n cusip() {$this.synonyms->filter(\n s: _01_basic::Synonym[1]|$s.type ==\n _01_basic::ProductSynonymType.CUSIP\n)->toOne().name}: String[1];\n isin() {$this.synonyms->filter(\n s: _01_basic::Synonym[1]|$s.type ==\n _01_basic::ProductSynonymType.ISIN\n)->toOne().name}: String[1];\n sedol() {$this.synonyms->filter(\n s: _01_basic::Synonym[1]|$s.type ==\n _01_basic::ProductSynonymType.SEDOL\n)->toOne().name}: String[1];\n}\n\nClass _01_basic::TradeEvent\n{\n eventType: String[1];\n eventDate: StrictDate[1];\n initiator: _01_basic::Trader[0..1];\n trade: _01_basic::Trade[1];\n}\n\nClass _03_modelToModelMapping::S_Product\n{\n name: String[1];\n classification: _03_modelToModelMapping::S_ProductClassification[0..1];\n synonym: _03_modelToModelMapping::S_Synonym[*];\n}\n\nClass _01_basic::Trader\n{\n name: String[1];\n address: String[1];\n}\n\nClass _01_basic::Synonym\n{\n type: _01_basic::ProductSynonymType[1];\n name: String[1];\n}\n\nClass _01_basic::Trade\n{\n id: Integer[1];\n tradeDate: StrictDate[1];\n quantity: Float[1];\n settlementDateTime: DateTime[0..1];\n product: _01_basic::Product[0..1];\n account: _01_basic::Account[0..1];\n events: _01_basic::TradeEvent[*];\n productIdentifier() {if(\n $this.product->isNotEmpty(),\n |$this.product->toOne().name,\n |'Unknown'\n)}: String[1];\n eventsByDate(date: Date[1]) {$this.events->filter(\n e: _01_basic::TradeEvent[1]|$e.eventDate ==\n $date\n)}: _01_basic::TradeEvent[*];\n tradeDateEvent() {$this.eventsByDate($this.tradeDate->toOne())->toOne()}: _01_basic::TradeEvent[1];\n tradeDataEventType() {$this.tradeDateEvent.eventType}: String[1];\n initiator() {$this.tradeDateEvent.initiator}: _01_basic::Trader[0..1];\n latestEventDate() {$this.events->map(\n e: _01_basic::TradeEvent[1]|$e.eventDate\n)->sort()->reverse()->at(0)}: StrictDate[1];\n}\n\nClass _01_basic::Account\n{\n name: String[1];\n createDate: StrictDate[1];\n trades: _01_basic::Trade[*];\n closeDate: StrictDate[0..1];\n}\n\nClass <> _02_advanced::SynonymStereoTyped\n{\n type: _01_basic::ProductSynonymType[1];\n name: String[1];\n}\n\nClass _03_modelToModelMapping::S_Synonym\n{\n type: String[1];\n name: String[1];\n}\n\nClass {meta::pure::profiles::doc.doc = 'must pass date for isin/cusip/sedol now.'} _02_advanced::ProductUpdated\n{\n name: String[1];\n classification: _01_basic::ProductClassification[1];\n cusip(businessDate: StrictDate[1]) {$this.synonyms($businessDate)->filter(\n s: _02_advanced::SynonymStereoTyped[1]|$s.type ==\n _01_basic::ProductSynonymType.CUSIP\n)->toOne().name}: String[1];\n isin(businessDate: StrictDate[1]) {$this.synonyms($businessDate)->filter(\n s: _02_advanced::SynonymStereoTyped[1]|$s.type ==\n _01_basic::ProductSynonymType.ISIN\n)->toOne().name}: String[1];\n sedol(businessDate: StrictDate[1]) {$this.synonyms($businessDate)->filter(\n s: _02_advanced::SynonymStereoTyped[1]|$s.type ==\n _01_basic::ProductSynonymType.SEDOL\n)->toOne().name}: String[1];\n}\n\nClass {meta::pure::profiles::doc.doc = 'use tags to add metadata.'} _02_advanced::AccountWithConstraints extends _01_basic::Account\n[\n tradesNotDoubleBooked: $this->project(\n [\n a: _02_advanced::AccountWithConstraints[1]|$a.trades.id\n ],\n ['tradeId']\n)->groupBy(\n 'tradeId',\n 'count'->agg(\n x: meta::pure::tds::TDSRow[1]|$x,\n y: meta::pure::tds::TDSRow[*]|$y->count()\n )\n)->filter(\n t: meta::pure::tds::TDSRow[1]|$t.getInteger('count') > 1\n)->tdsRows()->isEmpty(),\n noTradesAfterCloseDate: true\n]\n{\n isOpen() {$this.closeDate->isEmpty()}: Boolean[1];\n}\n\nClass _03_modelToModelMapping::S_ProductClassification\n{\n type: String[1];\n description: String[1];\n}\n\nClass _01_basic::ProductClassification\n{\n type: String[1];\n description: String[1];\n}\n\nAssociation _02_advanced::ProdSynonymMilestoned\n{\n product: _02_advanced::ProductUpdated[1];\n synonyms: _02_advanced::SynonymStereoTyped[*];\n}\n\nAssociation _01_basic::ProdSynonym\n{\n product: _01_basic::Product[1];\n synonyms: _01_basic::Synonym[*];\n}\n\n\n###Mapping\nMapping _03_modelToModelMapping::simpleModelToModelMapping\n(\n *_01_basic::Product: Pure\n {\n ~src _03_modelToModelMapping::S_Product\n ~filter !($src.classification.type == 'type2')\n name: $src.name,\n synonyms[_01_basic_Synonym]: $src.synonym,\n classification[_01_basic_ProductClassification]: $src.classification\n }\n *_01_basic::ProductClassification: Pure\n {\n ~src _03_modelToModelMapping::S_ProductClassification\n type: $src.type,\n description: $src.description\n }\n *_01_basic::Synonym: Pure\n {\n ~src _03_modelToModelMapping::S_Synonym\n name: $src.name,\n type: EnumerationMapping _01_basic_ProductSynonymType: $src.type\n }\n\n _01_basic::ProductSynonymType: EnumerationMapping\n {\n CUSIP: ['C'],\n ISIN: ['I'],\n SEDOL: ['S']\n }\n\n MappingTests\n [\n test_1\n (\n query: |_01_basic::Product.all()->graphFetchChecked(\n #{\n _01_basic::Product{\n name,\n classification{\n description,\n type\n },\n synonyms{\n type,\n name\n }\n }\n }#\n)->serialize(\n #{\n _01_basic::Product{\n name,\n classification{\n description,\n type\n },\n synonyms{\n type,\n name\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '{\"defects\":[],\"source\":{\"defects\":[],\"source\":{\"number\":1,\"record\":\"{\\\"name\\\":\\\"Product1\\\",\\\"classification\\\":{\\\"type\\\":\\\"type1\\\",\\\"description\\\":\\\"Product classification of type 1\\\"},\\\"synonym\\\":[{\\\"type\\\":\\\"C\\\",\\\"name\\\":\\\"C1\\\"}]}\"},\"value\":{\"classification\":{\"description\":\"Product classification of type 1\",\"type\":\"type1\"},\"name\":\"Product1\",\"synonym\":[{\"name\":\"C1\",\"type\":\"C\"}]}},\"value\":{\"name\":\"Product1\",\"classification\":{\"description\":\"Product classification of type 1\",\"type\":\"type1\"},\"synonyms\":[{\"type\":\"CUSIP\",\"name\":\"C1\"}]}}';\n ),\n test_2\n (\n query: |_01_basic::Product.all()->graphFetchChecked(\n #{\n _01_basic::Product{\n name,\n classification{\n type,\n description\n },\n synonyms{\n name,\n type\n }\n }\n }#\n)->serialize(\n #{\n _01_basic::Product{\n name,\n classification{\n type,\n description\n },\n synonyms{\n name,\n type\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '[]';\n )\n ]\n)\n\nMapping _03_modelToModelMapping::unionMapping\n(\n _01_basic::Product[p1]: Pure\n {\n ~src _03_modelToModelMapping::S_Product\n ~filter !($src.classification.type == 'type2')\n name: $src.name,\n classification[_01_basic_ProductClassification]: $src.classification,\n synonyms[_01_basic_Synonym]: $src.synonym\n }\n _01_basic::Product[p2]: Pure\n {\n ~src _03_modelToModelMapping::S_Product\n ~filter $src.classification.type == 'type2'\n name: $src.name,\n classification[_01_basic_ProductClassification]: $src.classification,\n synonyms[_01_basic_Synonym]: $src.synonym\n }\n *_01_basic::ProductClassification: Pure\n {\n ~src _03_modelToModelMapping::S_ProductClassification\n type: $src.type,\n description: $src.description\n }\n *_01_basic::Synonym: Pure\n {\n ~src _03_modelToModelMapping::S_Synonym\n type: EnumerationMapping _01_basic_ProductSynonymType: $src.type,\n name: $src.name\n }\n *_01_basic::Product[union]: Operation\n {\n meta::pure::router::operations::union_OperationSetImplementation_1__SetImplementation_MANY_(p1,p2)\n }\n\n _01_basic::ProductSynonymType: EnumerationMapping\n {\n CUSIP: ['C'],\n ISIN: ['I'],\n SEDOL: ['S']\n }\n\n MappingTests\n [\n test_1\n (\n query: |_01_basic::Product.all()->graphFetchChecked(\n #{\n _01_basic::Product{\n name,\n synonyms{\n name,\n type\n },\n classification{\n type,\n description\n }\n }\n }#\n)->serialize(\n #{\n _01_basic::Product{\n name,\n synonyms{\n name,\n type\n },\n classification{\n type,\n description\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '{\"defects\":[],\"source\":{\"defects\":[],\"source\":{\"number\":1,\"record\":\"{\\\"name\\\":\\\"Product1\\\",\\\"classification\\\":{\\\"type\\\":\\\"type1\\\",\\\"description\\\":\\\"Product of type1\\\"},\\\"synonym\\\":[{\\\"type\\\":\\\"C\\\",\\\"name\\\":\\\"C1\\\"},{\\\"type\\\":\\\"I\\\",\\\"name\\\":\\\"I1\\\"}]}\"},\"value\":{\"classification\":{\"description\":\"Product of type1\",\"type\":\"type1\"},\"name\":\"Product1\",\"synonym\":[{\"name\":\"C1\",\"type\":\"C\"},{\"name\":\"I1\",\"type\":\"I\"}]}},\"value\":{\"name\":\"Product1\",\"synonyms\":[{\"name\":\"C1\",\"type\":\"CUSIP\"},{\"name\":\"I1\",\"type\":\"ISIN\"}],\"classification\":{\"type\":\"type1\",\"description\":\"Product of type1\"}}}';\n ),\n test_2\n (\n query: |_01_basic::Product.all()->graphFetchChecked(\n #{\n _01_basic::Product{\n name,\n classification{\n type,\n description\n },\n synonyms{\n name,\n type\n }\n }\n }#\n)->serialize(\n #{\n _01_basic::Product{\n name,\n classification{\n type,\n description\n },\n synonyms{\n name,\n type\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '{\"defects\":[],\"source\":{\"defects\":[],\"source\":{\"number\":1,\"record\":\"{\\\"name\\\":\\\"Product2\\\",\\\"classification\\\":{\\\"type\\\":\\\"type2\\\",\\\"description\\\":\\\"Product of classification type2\\\"},\\\"synonym\\\":[{\\\"type\\\":\\\"S\\\",\\\"name\\\":\\\"S1\\\"}]}\"},\"value\":{\"classification\":{\"description\":\"Product of classification type2\",\"type\":\"type2\"},\"name\":\"Product2\",\"synonym\":[{\"name\":\"S1\",\"type\":\"S\"}]}},\"value\":{\"name\":\"Product2\",\"classification\":{\"type\":\"type2\",\"description\":\"Product of classification type2\"},\"synonyms\":[{\"name\":\"S1\",\"type\":\"SEDOL\"}]}}';\n )\n ]\n)\n"},{"title":"Data Space Basic Specification","documentation":"DataSpace Basic Specification","path":"Model/Document and share your model/Data Space","code":"###Diagram\nDiagram showcase::northwind::model::NorthwindModelDiagram\n{\n classView 8947a897-a67d-4064-8770-8a440e1220ce\n {\n class: showcase::northwind::model::crm::Employee;\n position: (401.1871744777152,580.7157363134539);\n rectangle: (211.03332710266113,212.0);\n }\n classView d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2\n {\n class: showcase::northwind::model::geography::Address;\n position: (428.11321850038996,365.8790985977993);\n rectangle: (145.85000038146973,114.0);\n }\n classView fd4a376f-11c2-4f8b-9e76-19079a06cc0b\n {\n class: showcase::northwind::model::Order;\n position: (89.66931137749526,364.84316585774513);\n rectangle: (174.01666831970215,114.0);\n }\n classView 51d867fc-1dce-4979-9120-d10a551e23a7\n {\n class: showcase::northwind::model::crm::ShippingCompany;\n position: (-240.98019847552794,379.4990577970102);\n rectangle: (179.4666690826416,86.0);\n }\n classView 4251c20c-4779-4c21-9b9c-900caf75fcc6\n {\n class: showcase::northwind::model::inventory::Product;\n position: (421.60610674363886,-69.9030438054377);\n rectangle: (167.85000038146973,128.0);\n }\n classView 2a461b5d-77dd-43e1-a33f-0759d84b8667\n {\n class: showcase::northwind::model::OrderLineItem;\n position: (92.87799226709058,-43.093765410358316);\n rectangle: (169.10000133514404,86.0);\n }\n classView 8217f514-1928-48bc-b8de-386ca506c1f9\n {\n class: showcase::northwind::model::geography::SalesTerritory;\n position: (806.4847354152803,653.513841427653);\n rectangle: (141.58333110809326,72.0);\n }\n classView 37cda7f9-22dc-4e75-ad3a-a5599d88772a\n {\n class: showcase::northwind::model::inventory::ProductCategory;\n position: (786.770946360032,-49.13039766561275);\n rectangle: (175.1082781744508,86.0);\n }\n classView 09710ba2-c255-4222-a85d-50520d5eae95\n {\n class: showcase::northwind::model::inventory::Supplier;\n position: (768.5537612977755,206.91393580644078);\n rectangle: (179.4666690826416,142.0);\n }\n classView df47922a-2b8a-4b12-b835-d7c75a694670\n {\n class: showcase::northwind::model::crm::Customer;\n position: (382.36050099956327,131.63043674809185);\n rectangle: (236.94999885559082,128.0);\n }\n classView 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1\n {\n class: showcase::northwind::model::geography::SalesRegion;\n position: (806.4847354152804,492.60599452399185);\n rectangle: (133.0166654586792,58.0);\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Customer.address;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(500.8355004273587,195.63043674809185),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.shipper;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 51d867fc-1dce-4979-9120-d10a551e23a7;\n points: [(176.67764553734634,421.84316585774513),(-151.24686393420714,422.4990577970102)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.orders;\n source: 51d867fc-1dce-4979-9120-d10a551e23a7;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(-151.24686393420714,422.4990577970102),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.lineItems;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(176.67764553734634,421.84316585774513),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.order;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(177.4279929346626,-0.09376541035831565),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::Order.shipToAddress;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(176.67764553734634,421.84316585774513),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.customer;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: df47922a-2b8a-4b12-b835-d7c75a694670;\n points: [(176.67764553734634,421.84316585774513),(500.8355004273587,195.63043674809185)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.orders;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(500.8355004273587,195.63043674809185),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::inventory::Supplier.address;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(858.2870958390963,277.9139358064408),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.orders;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(506.70383802904576,686.7157363134539),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.employee;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(176.67764553734634,421.84316585774513),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Employee.address;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(506.70383802904576,686.7157363134539),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.category;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n points: [(505.5311069343737,-5.903043805437704),(874.3250854472574,-6.1303976656127475)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.products;\n source: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(874.3250854472574,-6.1303976656127475),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.orderLineItems;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(505.5311069343737,-5.903043805437704),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.product;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(177.4279929346626,-0.09376541035831565),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.supplier;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 09710ba2-c255-4222-a85d-50520d5eae95;\n points: [(505.5311069343737,-5.903043805437704),(858.2870958390963,277.9139358064408)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.products;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(858.2870958390963,277.9139358064408),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.employees;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(877.2764009693269,689.513841427653),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.territories;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(506.70383802904576,686.7157363134539),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.territories;\n source: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(872.99306814462,521.6059945239919),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.region;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n points: [(877.2764009693269,689.513841427653),(872.99306814462,521.6059945239919)];\n }\n}\n\n\n###DataSpace\nDataSpace showcase::northwind::dataspace::NorthwindDataSpace\n{\n executionContexts:\n [\n {\n name: 'externally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'externally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n }\n ];\n defaultExecutionContext: 'externally-public-PROD';\n}\n\n\n###Service\nService showcase::northwind::services::graph::OrderDetailsByIdGraphFetch\n{\n pattern: '/orderDetailsByIdGraphFetch/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: id: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $id\n )->graphFetch(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::graph::ShipperValidationDefects\n{\n pattern: '/shipperValidationDefects';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::ShippingCompany.all()->graphFetchChecked(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::OrderDetailsByIdTDS\n{\n pattern: '/orderDetailsByIdTDS/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: orderId: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $orderId\n )->project(\n [\n x: showcase::northwind::model::Order[1]|$x.id,\n x: showcase::northwind::model::Order[1]|$x.customer.companyName,\n x: showcase::northwind::model::Order[1]|$x.employee.firstName,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.quantity,\n x: showcase::northwind::model::Order[1]|$x.shipper.name\n ],\n [\n 'Order Id',\n 'Customer/Company Name',\n 'Employee/First Name',\n 'Order Line Items/Product/Product Name',\n 'Order Line Items/Product/Category/Category Name',\n 'Order Line Items/Quantity',\n 'Shipper/Company Name'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'a simple passing validation with static parameter';\n params:[\n |10248\n ];\n assertions:[\n rowCountGreaterThan10: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Employee/First Name')->startsWith('T')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected no Employee/First Name to begin with the letter T')\n ];\n }\n ]\n}\n\nService showcase::northwind::services::tds::TopCategories\n{\n pattern: '/topCategories';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::ProductRankingWithinCategory\n{\n pattern: '/productRankingWithinCategory';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::inventory::ProductCategory.all()->groupBy(\n [\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.name,\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.name\n ],\n [\n agg(\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.orderLineItems.order.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Name',\n 'Products/Product Name',\n 'OrderCount'\n ]\n )->olapGroupBy(\n ['Category Name'],\n desc('OrderCount'),\n x: meta::pure::tds::TDSRow[*]|$x->rank(),\n 'Rank Within Category'\n )->sort(\n [\n asc('Category Name'),\n asc('Rank Within Category')\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::Customers\n{\n pattern: '/customers';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n [\n x: showcase::northwind::model::crm::Customer[1]|$x.id,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyName,\n x: showcase::northwind::model::crm::Customer[1]|$x.contactName,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyTitle,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.country,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.address,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.city,\n x: showcase::northwind::model::crm::Customer[1]|$x.telephoneNumber\n ],\n [\n 'Customer Id',\n 'Company Name',\n 'Contact Name',\n 'Company Title',\n 'Country',\n 'Address',\n 'City',\n 'Phone'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'A simple passing validation';\n params:[\n\n ];\n assertions:[\n noCompanyNamedAroundtheHorn: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Company Name')->contains('Around the Hornsss')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected there is no company named Around the Hornsss')\n ];\n }\n ]\n}\n\n\n###Relational\nDatabase showcase::northwind::store::NorthwindDatabase\n(\n Schema NORTHWIND\n (\n Table CATEGORIES\n (\n CATEGORY_ID SMALLINT PRIMARY KEY,\n CATEGORY_NAME VARCHAR(15) NOT NULL,\n DESCRIPTION VARCHAR(256),\n PICTURE OTHER\n )\n Table CUSTOMERS\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24)\n )\n Table CUSTOMER_CUSTOMER_DEMO\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY\n )\n Table CUSTOMER_DEMOGRAPHICS\n (\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_DESC VARCHAR(256)\n )\n Table EMPLOYEES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n LAST_NAME VARCHAR(20) NOT NULL,\n FIRST_NAME VARCHAR(10) NOT NULL,\n TITLE VARCHAR(30),\n TITLE_OF_COURTESY VARCHAR(25),\n BIRTH_DATE DATE,\n HIRE_DATE DATE,\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n HOME_PHONE VARCHAR(24),\n EXTENSION VARCHAR(4),\n PHOTO OTHER,\n NOTES OTHER,\n REPORTS_TO SMALLINT,\n PHOTO_PATH VARCHAR(255)\n )\n Table EMPLOYEE_TERRITORIES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n TERRITORY_ID VARCHAR(20) PRIMARY KEY\n )\n Table ORDERS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n CUSTOMER_ID VARCHAR(5),\n EMPLOYEE_ID SMALLINT,\n ORDER_DATE DATE,\n REQUIRED_DATE DATE,\n SHIPPED_DATE DATE,\n SHIP_VIA SMALLINT,\n FREIGHT OTHER,\n SHIP_NAME VARCHAR(40),\n SHIP_ADDRESS VARCHAR(60),\n SHIP_CITY VARCHAR(15),\n SHIP_REGION VARCHAR(15),\n SHIP_POSTAL_CODE VARCHAR(10),\n SHIP_COUNTRY VARCHAR(15)\n )\n Table ORDER_DETAILS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n PRODUCT_ID SMALLINT PRIMARY KEY,\n UNIT_PRICE OTHER NOT NULL,\n QUANTITY SMALLINT NOT NULL,\n DISCOUNT OTHER NOT NULL\n )\n Table PRODUCTS\n (\n PRODUCT_ID SMALLINT PRIMARY KEY,\n PRODUCT_NAME VARCHAR(40) NOT NULL,\n SUPPLIER_ID SMALLINT,\n CATEGORY_ID SMALLINT,\n QUANTITY_PER_UNIT VARCHAR(20),\n UNIT_PRICE OTHER,\n UNITS_IN_STOCK SMALLINT,\n UNITS_ON_ORDER SMALLINT,\n REORDER_LEVEL SMALLINT,\n DISCONTINUED INTEGER NOT NULL\n )\n Table REGION\n (\n REGION_ID SMALLINT PRIMARY KEY,\n REGION_DESCRIPTION VARCHAR(60) NOT NULL\n )\n Table SHIPPERS\n (\n SHIPPER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n PHONE VARCHAR(24) NOT NULL\n )\n Table SUPPLIERS\n (\n SUPPLIER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24),\n HOMEPAGE VARCHAR(256)\n )\n Table TERRITORIES\n (\n TERRITORY_ID VARCHAR(20) PRIMARY KEY,\n TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,\n REGION_ID SMALLINT NOT NULL\n )\n Table US_STATES\n (\n STATE_ID SMALLINT PRIMARY KEY,\n STATE_NAME VARCHAR(100),\n STATE_ABBR VARCHAR(2),\n STATE_REGION VARCHAR(50)\n )\n )\n\n Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)\n Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)\n Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)\n Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)\n Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)\n Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)\n Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)\n Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)\n Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)\n Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)\n Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)\n Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)\n Join SUPPLIERS_REGION(NORTHWIND.SUPPLIERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join ORDERS_REGION(NORTHWIND.ORDERS.SHIP_REGION = NORTHWIND.REGION.REGION_ID)\n Join CUSTOMERS_REGION(NORTHWIND.CUSTOMERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_REGION(NORTHWIND.EMPLOYEES.REGION = NORTHWIND.REGION.REGION_ID)\n)\n\n\n###Pure\nEnum showcase::northwind::model::crm::Title\n{\n Mr,\n Mrs,\n Miss,\n Ms,\n Dr,\n Sir,\n Professor,\n Duchess,\n Duke\n}\n\nClass showcase::northwind::model::crm::Employee\n[\n dateOfBirthNotInTheFuture: $this.dateOfBirth <\n now(),\n dateOfBirthValid: $this.dateOfBirth > %1900-01-01,\n employeeIsOverEighteen: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) >= 18,\n employeeIsUnderEighty: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) < 80,\n notDateOfHireNotBeforeDateOfBirth: $this.dateOfHire >\n $this.dateOfBirth\n]\n{\n id: Integer[1];\n lastName: String[1];\n firstName: String[1];\n title: String[0..1];\n preferredTitle: showcase::northwind::model::crm::Title[0..1];\n dateOfBirth: StrictDate[0..1];\n dateOfHire: StrictDate[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n homeTelephoneNumber: String[0..1];\n extension: String[0..1];\n fullName() {if(\n $this.preferredTitle->isNotEmpty(),\n |$this.preferredTitle->toOne()->toString() + ' ',\n |if(\n $this.title->isNotEmpty(),\n |$this.title->toOne() + ' ',\n |''\n )\n) + $this.firstName + ' ' + $this.lastName}: String[1];\n}\n\nClass showcase::northwind::model::Order\n{\n id: Integer[1];\n createdDate: StrictDate[0..1];\n requiredDate: StrictDate[0..1];\n shippedDate: StrictDate[0..1];\n shipToName: String[0..1];\n shipToAddress: showcase::northwind::model::geography::Address[0..1];\n itemCount() {$this.lineItems->count()}: Integer[1];\n}\n\nClass showcase::northwind::model::geography::Address\n{\n address: String[0..1];\n city: String[0..1];\n postalCode: String[0..1];\n region: String[0..1];\n country: String[0..1];\n}\n\nClass showcase::northwind::model::inventory::Product\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n quantityPerUnit: String[0..1];\n unitsInStock: Integer[0..1];\n unitsOnOrder: Integer[0..1];\n reorderLevel: Integer[0..1];\n discontinued: Integer[1];\n}\n\nClass showcase::northwind::model::inventory::Supplier\n{\n id: Integer[1];\n companyName: String[1];\n contactName: String[0..1];\n contactTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n homepageUrl: String[0..1];\n}\n\nClass showcase::northwind::model::crm::Customer\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n companyName: String[1];\n contactName: String[0..1];\n companyTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n}\n\nClass showcase::northwind::model::crm::CustomerDemographic\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::crm::ShippingCompany\n[\n idNotNegative: $this.id >= 0,\n telephoneNumberFormatValid: $this.telephoneNumber->isEmpty() ||\n $this.telephoneNumber->toOne()->matches('(1-)?\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d')\n]\n{\n id: Integer[1];\n name: String[1];\n telephoneNumber: String[1];\n}\n\nClass showcase::northwind::model::geography::USState\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->isEmpty() ||\n ($this.name->toOne()->length() > 0)\n]\n{\n id: Integer[1];\n name: String[0..1];\n code: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesRegion\n[\n idNotNegative: $this.id >= 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: Integer[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::inventory::ProductCategory\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::OrderLineItem\n{\n quantity: Integer[1];\n unitPrice: Float[1];\n unitPriceCurrency: String[1];\n}\n\nClass showcase::northwind::model::geography::SalesTerritory\n[\n idNotBlank: $this.id->length() > 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: String[1];\n description: String[1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Employee\n{\n orders: showcase::northwind::model::Order[*];\n employee: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Category\n{\n category: showcase::northwind::model::inventory::ProductCategory[0..1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Product_Suppliers\n{\n supplier: showcase::northwind::model::inventory::Supplier[1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::OrderLineItem_Product\n{\n orderLineItems: showcase::northwind::model::OrderLineItem[*];\n product: showcase::northwind::model::inventory::Product[1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Customer\n{\n orders: showcase::northwind::model::Order[*];\n customer: showcase::northwind::model::crm::Customer[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_OrderLineItem\n{\n order: showcase::northwind::model::Order[1];\n lineItems: showcase::northwind::model::OrderLineItem[*];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Employees\n{\n employees: showcase::northwind::model::crm::Employee[*];\n territories: showcase::northwind::model::geography::SalesTerritory[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Shipper\n{\n orders: showcase::northwind::model::Order[*];\n shipper: showcase::northwind::model::crm::ShippingCompany[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Region\n{\n region: showcase::northwind::model::geography::SalesRegion[1];\n territories: showcase::northwind::model::geography::SalesTerritory[1..*];\n}\n\nAssociation showcase::northwind::model::associations::Customer_CustomerDemographics\n{\n customers: showcase::northwind::model::crm::Customer[*];\n demographics: showcase::northwind::model::crm::CustomerDemographic[*];\n}\n\nAssociation showcase::northwind::model::associations::Employee_Manager\n{\n reports: showcase::northwind::model::crm::Employee[*];\n manager: showcase::northwind::model::crm::Employee[0..1];\n}\n\n\n###Mapping\nMapping showcase::northwind::mapping::NorthwindMapping\n(\n showcase::northwind::model::inventory::ProductCategory[Category]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_NAME,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.DESCRIPTION\n }\n showcase::northwind::model::crm::Customer[Customer]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_NAME,\n companyTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.FAX\n }\n showcase::northwind::model::crm::Employee[Employee]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID,\n lastName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.LAST_NAME,\n firstName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.FIRST_NAME,\n title: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE,\n preferredTitle: EnumerationMapping TitleMapping: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE_OF_COURTESY,\n dateOfBirth: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.BIRTH_DATE,\n dateOfHire: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HIRE_DATE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.COUNTRY\n ),\n homeTelephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HOME_PHONE,\n extension: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EXTENSION\n }\n showcase::northwind::model::Order[Order]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID,\n createdDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_DATE,\n requiredDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.REQUIRED_DATE,\n shippedDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIPPED_DATE,\n shipToName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_NAME,\n shipToAddress\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_COUNTRY\n )\n }\n showcase::northwind::model::OrderLineItem[OrderLineItem]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.ORDER_ID,\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS\n quantity: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.QUANTITY,\n unitPrice: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.UNIT_PRICE,\n unitPriceCurrency: 'USD'\n }\n showcase::northwind::model::inventory::Product[Product]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_NAME,\n quantityPerUnit: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.QUANTITY_PER_UNIT,\n unitsInStock: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_IN_STOCK,\n unitsOnOrder: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_ON_ORDER,\n reorderLevel: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.REORDER_LEVEL,\n discontinued: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.DISCONTINUED\n }\n showcase::northwind::model::geography::SalesRegion[Region]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_DESCRIPTION\n }\n showcase::northwind::model::crm::ShippingCompany[Shipper]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.COMPANY_NAME,\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.PHONE\n }\n showcase::northwind::model::inventory::Supplier[Supplier]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_NAME,\n contactTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.FAX,\n homepageUrl: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.HOMEPAGE\n }\n showcase::northwind::model::geography::SalesTerritory[Territory]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_DESCRIPTION\n }\n showcase::northwind::model::geography::USState[USState]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_NAME,\n code: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ABBR\n }\n\n showcase::northwind::model::associations::Order_Customer: Relational\n {\n AssociationMapping\n (\n orders[Customer,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS,\n customer[Order,Customer]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS\n )\n }\n showcase::northwind::model::associations::Order_Employee: Relational\n {\n AssociationMapping\n (\n orders[Employee,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES,\n employee[Order,Employee]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES\n )\n }\n showcase::northwind::model::associations::Order_Shipper: Relational\n {\n AssociationMapping\n (\n orders[Shipper,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS,\n shipper[Order,Shipper]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS\n )\n }\n showcase::northwind::model::associations::Order_OrderLineItem: Relational\n {\n AssociationMapping\n (\n order[OrderLineItem,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS,\n lineItems[Order,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS\n )\n }\n showcase::northwind::model::associations::OrderLineItem_Product: Relational\n {\n AssociationMapping\n (\n orderLineItems[Product,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS,\n product[OrderLineItem,Product]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS\n )\n }\n showcase::northwind::model::associations::Product_Category: Relational\n {\n AssociationMapping\n (\n category[Product,Category]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES,\n products[Category,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES\n )\n }\n showcase::northwind::model::associations::Product_Suppliers: Relational\n {\n AssociationMapping\n (\n supplier[Product,Supplier]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS,\n products[Supplier,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS\n )\n }\n showcase::northwind::model::associations::Terriroties_Region: Relational\n {\n AssociationMapping\n (\n region[Territory,Region]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION,\n territories[Region,Territory]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION\n )\n }\n showcase::northwind::model::associations::Terriroties_Employees: Relational\n {\n AssociationMapping\n (\n employees[Territory,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES,\n territories[Employee,Territory]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES\n )\n }\n showcase::northwind::model::associations::Employee_Manager: Relational\n {\n AssociationMapping\n (\n reports[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS,\n manager[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS\n )\n }\n\n showcase::northwind::model::crm::Title: EnumerationMapping TitleMapping\n {\n Mr: ['Mr.'],\n Mrs: ['Mrs.'],\n Miss: ['Miss.'],\n Ms: ['Ms.'],\n Dr: ['Dr.'],\n Sir: ['Sir.'],\n Professor: ['Prof.'],\n Duchess: ['Duchess.'],\n Duke: ['Duke.']\n }\n)\n\n\n###Runtime\nRuntime showcase::northwind::runtime::NorthwindRuntime\n{\n mappings:\n [\n showcase::northwind::mapping::NorthwindMapping\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1:\n #{\n RelationalDatabaseConnection\n {\n store: showcase::northwind::store::NorthwindDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'call loadNorthwindData()'\n ];\n };\n auth: DefaultH2;\n }\n }#\n ]\n ];\n}\n"},{"title":"Data Space With Executables Defined","documentation":"","path":"Model/Document and share your model/Data Space With Exectuables","code":"###Diagram\nDiagram showcase::northwind::model::NorthwindModelDiagram\n{\n classView 8947a897-a67d-4064-8770-8a440e1220ce\n {\n class: showcase::northwind::model::crm::Employee;\n position: (401.1871744777152,580.7157363134539);\n rectangle: (211.03332710266113,212.0);\n }\n classView d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2\n {\n class: showcase::northwind::model::geography::Address;\n position: (428.11321850038996,365.8790985977993);\n rectangle: (145.85000038146973,114.0);\n }\n classView fd4a376f-11c2-4f8b-9e76-19079a06cc0b\n {\n class: showcase::northwind::model::Order;\n position: (89.66931137749526,364.84316585774513);\n rectangle: (174.01666831970215,114.0);\n }\n classView 51d867fc-1dce-4979-9120-d10a551e23a7\n {\n class: showcase::northwind::model::crm::ShippingCompany;\n position: (-240.98019847552794,379.4990577970102);\n rectangle: (179.4666690826416,86.0);\n }\n classView 4251c20c-4779-4c21-9b9c-900caf75fcc6\n {\n class: showcase::northwind::model::inventory::Product;\n position: (421.60610674363886,-69.9030438054377);\n rectangle: (167.85000038146973,128.0);\n }\n classView 2a461b5d-77dd-43e1-a33f-0759d84b8667\n {\n class: showcase::northwind::model::OrderLineItem;\n position: (92.87799226709058,-43.093765410358316);\n rectangle: (169.10000133514404,86.0);\n }\n classView 8217f514-1928-48bc-b8de-386ca506c1f9\n {\n class: showcase::northwind::model::geography::SalesTerritory;\n position: (806.4847354152803,653.513841427653);\n rectangle: (141.58333110809326,72.0);\n }\n classView 37cda7f9-22dc-4e75-ad3a-a5599d88772a\n {\n class: showcase::northwind::model::inventory::ProductCategory;\n position: (786.770946360032,-49.13039766561275);\n rectangle: (175.1082781744508,86.0);\n }\n classView 09710ba2-c255-4222-a85d-50520d5eae95\n {\n class: showcase::northwind::model::inventory::Supplier;\n position: (768.5537612977755,206.91393580644078);\n rectangle: (179.4666690826416,142.0);\n }\n classView df47922a-2b8a-4b12-b835-d7c75a694670\n {\n class: showcase::northwind::model::crm::Customer;\n position: (382.36050099956327,131.63043674809185);\n rectangle: (236.94999885559082,128.0);\n }\n classView 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1\n {\n class: showcase::northwind::model::geography::SalesRegion;\n position: (806.4847354152804,492.60599452399185);\n rectangle: (133.0166654586792,58.0);\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Customer.address;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(500.8355004273587,195.63043674809185),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.shipper;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 51d867fc-1dce-4979-9120-d10a551e23a7;\n points: [(176.67764553734634,421.84316585774513),(-151.24686393420714,422.4990577970102)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.orders;\n source: 51d867fc-1dce-4979-9120-d10a551e23a7;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(-151.24686393420714,422.4990577970102),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.lineItems;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(176.67764553734634,421.84316585774513),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.order;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(177.4279929346626,-0.09376541035831565),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::Order.shipToAddress;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(176.67764553734634,421.84316585774513),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.customer;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: df47922a-2b8a-4b12-b835-d7c75a694670;\n points: [(176.67764553734634,421.84316585774513),(500.8355004273587,195.63043674809185)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.orders;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(500.8355004273587,195.63043674809185),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::inventory::Supplier.address;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(858.2870958390963,277.9139358064408),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.orders;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(506.70383802904576,686.7157363134539),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.employee;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(176.67764553734634,421.84316585774513),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Employee.address;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(506.70383802904576,686.7157363134539),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.category;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n points: [(505.5311069343737,-5.903043805437704),(874.3250854472574,-6.1303976656127475)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.products;\n source: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(874.3250854472574,-6.1303976656127475),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.orderLineItems;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(505.5311069343737,-5.903043805437704),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.product;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(177.4279929346626,-0.09376541035831565),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.supplier;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 09710ba2-c255-4222-a85d-50520d5eae95;\n points: [(505.5311069343737,-5.903043805437704),(858.2870958390963,277.9139358064408)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.products;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(858.2870958390963,277.9139358064408),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.employees;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(877.2764009693269,689.513841427653),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.territories;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(506.70383802904576,686.7157363134539),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.territories;\n source: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(872.99306814462,521.6059945239919),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.region;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n points: [(877.2764009693269,689.513841427653),(872.99306814462,521.6059945239919)];\n }\n}\n\n\n###DataSpace\nDataSpace showcase::northwind::dataspace::NorthwindDataSpaceWithExecutables\n{\n executionContexts:\n [\n {\n name: 'externally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'externally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n }\n ];\n defaultExecutionContext: 'externally-public-PROD';\n executables:\n [\n {\n title: 'Northwind Data Space -Shipper Validation Defects';\n description: 'Shipper Validation Defects';\n executable: showcase::northwind::services::graph::ShipperValidationDefects;\n },\n {\n id: my_id;\n title: 'this is title - Top Categories';\n description: 'this is description - TopCategories';\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n executionContextKey: 'externally-public-PROD';\n }\n ];\n}\n\n\n###Service\nService showcase::northwind::services::graph::OrderDetailsByIdGraphFetch\n{\n pattern: '/orderDetailsByIdGraphFetch/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: id: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $id\n )->graphFetch(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::graph::ShipperValidationDefects\n{\n pattern: '/shipperValidationDefects';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::ShippingCompany.all()->graphFetchChecked(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::OrderDetailsByIdTDS\n{\n pattern: '/orderDetailsByIdTDS/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: orderId: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $orderId\n )->project(\n [\n x: showcase::northwind::model::Order[1]|$x.id,\n x: showcase::northwind::model::Order[1]|$x.customer.companyName,\n x: showcase::northwind::model::Order[1]|$x.employee.firstName,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.quantity,\n x: showcase::northwind::model::Order[1]|$x.shipper.name\n ],\n [\n 'Order Id',\n 'Customer/Company Name',\n 'Employee/First Name',\n 'Order Line Items/Product/Product Name',\n 'Order Line Items/Product/Category/Category Name',\n 'Order Line Items/Quantity',\n 'Shipper/Company Name'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'a simple passing validation with static parameter';\n params:[\n |10248\n ];\n assertions:[\n rowCountGreaterThan10: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Employee/First Name')->startsWith('T')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected no Employee/First Name to begin with the letter T')\n ];\n }\n ]\n}\n\nService showcase::northwind::services::tds::TopCategories\n{\n pattern: '/topCategories';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::ProductRankingWithinCategory\n{\n pattern: '/productRankingWithinCategory';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::inventory::ProductCategory.all()->groupBy(\n [\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.name,\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.name\n ],\n [\n agg(\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.orderLineItems.order.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Name',\n 'Products/Product Name',\n 'OrderCount'\n ]\n )->olapGroupBy(\n ['Category Name'],\n desc('OrderCount'),\n x: meta::pure::tds::TDSRow[*]|$x->rank(),\n 'Rank Within Category'\n )->sort(\n [\n asc('Category Name'),\n asc('Rank Within Category')\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::Customers\n{\n pattern: '/customers';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n [\n x: showcase::northwind::model::crm::Customer[1]|$x.id,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyName,\n x: showcase::northwind::model::crm::Customer[1]|$x.contactName,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyTitle,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.country,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.address,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.city,\n x: showcase::northwind::model::crm::Customer[1]|$x.telephoneNumber\n ],\n [\n 'Customer Id',\n 'Company Name',\n 'Contact Name',\n 'Company Title',\n 'Country',\n 'Address',\n 'City',\n 'Phone'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'A simple passing validation';\n params:[\n\n ];\n assertions:[\n noCompanyNamedAroundtheHorn: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Company Name')->contains('Around the Hornsss')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected there is no company named Around the Hornsss')\n ];\n }\n ]\n}\n\n\n###Relational\nDatabase showcase::northwind::store::NorthwindDatabase\n(\n Schema NORTHWIND\n (\n Table CATEGORIES\n (\n CATEGORY_ID SMALLINT PRIMARY KEY,\n CATEGORY_NAME VARCHAR(15) NOT NULL,\n DESCRIPTION VARCHAR(256),\n PICTURE OTHER\n )\n Table CUSTOMERS\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24)\n )\n Table CUSTOMER_CUSTOMER_DEMO\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY\n )\n Table CUSTOMER_DEMOGRAPHICS\n (\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_DESC VARCHAR(256)\n )\n Table EMPLOYEES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n LAST_NAME VARCHAR(20) NOT NULL,\n FIRST_NAME VARCHAR(10) NOT NULL,\n TITLE VARCHAR(30),\n TITLE_OF_COURTESY VARCHAR(25),\n BIRTH_DATE DATE,\n HIRE_DATE DATE,\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n HOME_PHONE VARCHAR(24),\n EXTENSION VARCHAR(4),\n PHOTO OTHER,\n NOTES OTHER,\n REPORTS_TO SMALLINT,\n PHOTO_PATH VARCHAR(255)\n )\n Table EMPLOYEE_TERRITORIES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n TERRITORY_ID VARCHAR(20) PRIMARY KEY\n )\n Table ORDERS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n CUSTOMER_ID VARCHAR(5),\n EMPLOYEE_ID SMALLINT,\n ORDER_DATE DATE,\n REQUIRED_DATE DATE,\n SHIPPED_DATE DATE,\n SHIP_VIA SMALLINT,\n FREIGHT OTHER,\n SHIP_NAME VARCHAR(40),\n SHIP_ADDRESS VARCHAR(60),\n SHIP_CITY VARCHAR(15),\n SHIP_REGION VARCHAR(15),\n SHIP_POSTAL_CODE VARCHAR(10),\n SHIP_COUNTRY VARCHAR(15)\n )\n Table ORDER_DETAILS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n PRODUCT_ID SMALLINT PRIMARY KEY,\n UNIT_PRICE OTHER NOT NULL,\n QUANTITY SMALLINT NOT NULL,\n DISCOUNT OTHER NOT NULL\n )\n Table PRODUCTS\n (\n PRODUCT_ID SMALLINT PRIMARY KEY,\n PRODUCT_NAME VARCHAR(40) NOT NULL,\n SUPPLIER_ID SMALLINT,\n CATEGORY_ID SMALLINT,\n QUANTITY_PER_UNIT VARCHAR(20),\n UNIT_PRICE OTHER,\n UNITS_IN_STOCK SMALLINT,\n UNITS_ON_ORDER SMALLINT,\n REORDER_LEVEL SMALLINT,\n DISCONTINUED INTEGER NOT NULL\n )\n Table REGION\n (\n REGION_ID SMALLINT PRIMARY KEY,\n REGION_DESCRIPTION VARCHAR(60) NOT NULL\n )\n Table SHIPPERS\n (\n SHIPPER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n PHONE VARCHAR(24) NOT NULL\n )\n Table SUPPLIERS\n (\n SUPPLIER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24),\n HOMEPAGE VARCHAR(256)\n )\n Table TERRITORIES\n (\n TERRITORY_ID VARCHAR(20) PRIMARY KEY,\n TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,\n REGION_ID SMALLINT NOT NULL\n )\n Table US_STATES\n (\n STATE_ID SMALLINT PRIMARY KEY,\n STATE_NAME VARCHAR(100),\n STATE_ABBR VARCHAR(2),\n STATE_REGION VARCHAR(50)\n )\n )\n\n Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)\n Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)\n Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)\n Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)\n Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)\n Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)\n Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)\n Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)\n Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)\n Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)\n Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)\n Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)\n Join SUPPLIERS_REGION(NORTHWIND.SUPPLIERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join ORDERS_REGION(NORTHWIND.ORDERS.SHIP_REGION = NORTHWIND.REGION.REGION_ID)\n Join CUSTOMERS_REGION(NORTHWIND.CUSTOMERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_REGION(NORTHWIND.EMPLOYEES.REGION = NORTHWIND.REGION.REGION_ID)\n)\n\n\n###Pure\nEnum showcase::northwind::model::crm::Title\n{\n Mr,\n Mrs,\n Miss,\n Ms,\n Dr,\n Sir,\n Professor,\n Duchess,\n Duke\n}\n\nClass showcase::northwind::model::crm::Employee\n[\n dateOfBirthNotInTheFuture: $this.dateOfBirth <\n now(),\n dateOfBirthValid: $this.dateOfBirth > %1900-01-01,\n employeeIsOverEighteen: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) >= 18,\n employeeIsUnderEighty: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) < 80,\n notDateOfHireNotBeforeDateOfBirth: $this.dateOfHire >\n $this.dateOfBirth\n]\n{\n id: Integer[1];\n lastName: String[1];\n firstName: String[1];\n title: String[0..1];\n preferredTitle: showcase::northwind::model::crm::Title[0..1];\n dateOfBirth: StrictDate[0..1];\n dateOfHire: StrictDate[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n homeTelephoneNumber: String[0..1];\n extension: String[0..1];\n fullName() {if(\n $this.preferredTitle->isNotEmpty(),\n |$this.preferredTitle->toOne()->toString() + ' ',\n |if(\n $this.title->isNotEmpty(),\n |$this.title->toOne() + ' ',\n |''\n )\n) + $this.firstName + ' ' + $this.lastName}: String[1];\n}\n\nClass showcase::northwind::model::Order\n{\n id: Integer[1];\n createdDate: StrictDate[0..1];\n requiredDate: StrictDate[0..1];\n shippedDate: StrictDate[0..1];\n shipToName: String[0..1];\n shipToAddress: showcase::northwind::model::geography::Address[0..1];\n itemCount() {$this.lineItems->count()}: Integer[1];\n}\n\nClass showcase::northwind::model::geography::Address\n{\n address: String[0..1];\n city: String[0..1];\n postalCode: String[0..1];\n region: String[0..1];\n country: String[0..1];\n}\n\nClass showcase::northwind::model::inventory::Product\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n quantityPerUnit: String[0..1];\n unitsInStock: Integer[0..1];\n unitsOnOrder: Integer[0..1];\n reorderLevel: Integer[0..1];\n discontinued: Integer[1];\n}\n\nClass showcase::northwind::model::inventory::Supplier\n{\n id: Integer[1];\n companyName: String[1];\n contactName: String[0..1];\n contactTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n homepageUrl: String[0..1];\n}\n\nClass showcase::northwind::model::crm::Customer\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n companyName: String[1];\n contactName: String[0..1];\n companyTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n}\n\nClass showcase::northwind::model::crm::CustomerDemographic\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::crm::ShippingCompany\n[\n idNotNegative: $this.id >= 0,\n telephoneNumberFormatValid: $this.telephoneNumber->isEmpty() ||\n $this.telephoneNumber->toOne()->matches('(1-)?\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d')\n]\n{\n id: Integer[1];\n name: String[1];\n telephoneNumber: String[1];\n}\n\nClass showcase::northwind::model::geography::USState\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->isEmpty() ||\n ($this.name->toOne()->length() > 0)\n]\n{\n id: Integer[1];\n name: String[0..1];\n code: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesRegion\n[\n idNotNegative: $this.id >= 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: Integer[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::inventory::ProductCategory\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::OrderLineItem\n{\n quantity: Integer[1];\n unitPrice: Float[1];\n unitPriceCurrency: String[1];\n}\n\nClass showcase::northwind::model::geography::SalesTerritory\n[\n idNotBlank: $this.id->length() > 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: String[1];\n description: String[1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Employee\n{\n orders: showcase::northwind::model::Order[*];\n employee: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Category\n{\n category: showcase::northwind::model::inventory::ProductCategory[0..1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Product_Suppliers\n{\n supplier: showcase::northwind::model::inventory::Supplier[1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::OrderLineItem_Product\n{\n orderLineItems: showcase::northwind::model::OrderLineItem[*];\n product: showcase::northwind::model::inventory::Product[1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Customer\n{\n orders: showcase::northwind::model::Order[*];\n customer: showcase::northwind::model::crm::Customer[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_OrderLineItem\n{\n order: showcase::northwind::model::Order[1];\n lineItems: showcase::northwind::model::OrderLineItem[*];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Employees\n{\n employees: showcase::northwind::model::crm::Employee[*];\n territories: showcase::northwind::model::geography::SalesTerritory[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Shipper\n{\n orders: showcase::northwind::model::Order[*];\n shipper: showcase::northwind::model::crm::ShippingCompany[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Region\n{\n region: showcase::northwind::model::geography::SalesRegion[1];\n territories: showcase::northwind::model::geography::SalesTerritory[1..*];\n}\n\nAssociation showcase::northwind::model::associations::Customer_CustomerDemographics\n{\n customers: showcase::northwind::model::crm::Customer[*];\n demographics: showcase::northwind::model::crm::CustomerDemographic[*];\n}\n\nAssociation showcase::northwind::model::associations::Employee_Manager\n{\n reports: showcase::northwind::model::crm::Employee[*];\n manager: showcase::northwind::model::crm::Employee[0..1];\n}\n\n\n###Mapping\nMapping showcase::northwind::mapping::NorthwindMapping\n(\n showcase::northwind::model::inventory::ProductCategory[Category]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_NAME,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.DESCRIPTION\n }\n showcase::northwind::model::crm::Customer[Customer]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_NAME,\n companyTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.FAX\n }\n showcase::northwind::model::crm::Employee[Employee]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID,\n lastName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.LAST_NAME,\n firstName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.FIRST_NAME,\n title: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE,\n preferredTitle: EnumerationMapping TitleMapping: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE_OF_COURTESY,\n dateOfBirth: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.BIRTH_DATE,\n dateOfHire: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HIRE_DATE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.COUNTRY\n ),\n homeTelephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HOME_PHONE,\n extension: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EXTENSION\n }\n showcase::northwind::model::Order[Order]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID,\n createdDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_DATE,\n requiredDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.REQUIRED_DATE,\n shippedDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIPPED_DATE,\n shipToName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_NAME,\n shipToAddress\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_COUNTRY\n )\n }\n showcase::northwind::model::OrderLineItem[OrderLineItem]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.ORDER_ID,\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS\n quantity: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.QUANTITY,\n unitPrice: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.UNIT_PRICE,\n unitPriceCurrency: 'USD'\n }\n showcase::northwind::model::inventory::Product[Product]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_NAME,\n quantityPerUnit: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.QUANTITY_PER_UNIT,\n unitsInStock: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_IN_STOCK,\n unitsOnOrder: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_ON_ORDER,\n reorderLevel: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.REORDER_LEVEL,\n discontinued: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.DISCONTINUED\n }\n showcase::northwind::model::geography::SalesRegion[Region]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_DESCRIPTION\n }\n showcase::northwind::model::crm::ShippingCompany[Shipper]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.COMPANY_NAME,\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.PHONE\n }\n showcase::northwind::model::inventory::Supplier[Supplier]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_NAME,\n contactTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.FAX,\n homepageUrl: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.HOMEPAGE\n }\n showcase::northwind::model::geography::SalesTerritory[Territory]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_DESCRIPTION\n }\n showcase::northwind::model::geography::USState[USState]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_NAME,\n code: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ABBR\n }\n\n showcase::northwind::model::associations::Order_Customer: Relational\n {\n AssociationMapping\n (\n orders[Customer,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS,\n customer[Order,Customer]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS\n )\n }\n showcase::northwind::model::associations::Order_Employee: Relational\n {\n AssociationMapping\n (\n orders[Employee,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES,\n employee[Order,Employee]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES\n )\n }\n showcase::northwind::model::associations::Order_Shipper: Relational\n {\n AssociationMapping\n (\n orders[Shipper,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS,\n shipper[Order,Shipper]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS\n )\n }\n showcase::northwind::model::associations::Order_OrderLineItem: Relational\n {\n AssociationMapping\n (\n order[OrderLineItem,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS,\n lineItems[Order,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS\n )\n }\n showcase::northwind::model::associations::OrderLineItem_Product: Relational\n {\n AssociationMapping\n (\n orderLineItems[Product,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS,\n product[OrderLineItem,Product]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS\n )\n }\n showcase::northwind::model::associations::Product_Category: Relational\n {\n AssociationMapping\n (\n category[Product,Category]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES,\n products[Category,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES\n )\n }\n showcase::northwind::model::associations::Product_Suppliers: Relational\n {\n AssociationMapping\n (\n supplier[Product,Supplier]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS,\n products[Supplier,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS\n )\n }\n showcase::northwind::model::associations::Terriroties_Region: Relational\n {\n AssociationMapping\n (\n region[Territory,Region]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION,\n territories[Region,Territory]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION\n )\n }\n showcase::northwind::model::associations::Terriroties_Employees: Relational\n {\n AssociationMapping\n (\n employees[Territory,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES,\n territories[Employee,Territory]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES\n )\n }\n showcase::northwind::model::associations::Employee_Manager: Relational\n {\n AssociationMapping\n (\n reports[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS,\n manager[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS\n )\n }\n\n showcase::northwind::model::crm::Title: EnumerationMapping TitleMapping\n {\n Mr: ['Mr.'],\n Mrs: ['Mrs.'],\n Miss: ['Miss.'],\n Ms: ['Ms.'],\n Dr: ['Dr.'],\n Sir: ['Sir.'],\n Professor: ['Prof.'],\n Duchess: ['Duchess.'],\n Duke: ['Duke.']\n }\n)\n\n\n###Runtime\nRuntime showcase::northwind::runtime::NorthwindRuntime\n{\n mappings:\n [\n showcase::northwind::mapping::NorthwindMapping\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1:\n #{\n RelationalDatabaseConnection\n {\n store: showcase::northwind::store::NorthwindDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'call loadNorthwindData()'\n ];\n };\n auth: DefaultH2;\n }\n }#\n ]\n ];\n}\n"},{"title":"Stereotypes","documentation":"TODO: Some dummy description","development":true,"path":"Model/Leverage profiles in your model/Stereotypes","code":""},{"title":"Super types","documentation":"TODO: Some dummy description","development":true,"path":"Model/Leverage profiles in your model/Super types","code":""},{"title":"Tagged values","documentation":"TODO: Some dummy description","development":true,"path":"Model/Leverage profiles in your model/Tagged values","code":""},{"title":"Markdown","documentation":"TODO: Some dummy description","development":true,"path":"Model/Use text elements/Text/Markdown","code":"\r\n"},{"title":"Mermaid","documentation":"TODO: Some dummy description","development":true,"path":"Model/Use text elements/Text/Mermaid","code":"\r\n"},{"title":"Service Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Elastic Store/Connection","code":""},{"title":"Elastic Store Mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Elastic Store/Mapping","code":""},{"title":"Elastic Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Elastic Store/Store","code":""},{"title":"Model Store Connection","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Connection","code":""},{"title":"Association - Inheritance","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/association/inheritance","code":""},{"title":"Association - ClassMappingByClass","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/classMappingByClass","code":""},{"title":"Association - ClassMappingFilterWithInnerJoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/classMappingFilterWithInnerJoin","code":""},{"title":"DataType","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/dataType","code":""},{"title":"Dates - datetime","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/dates/datetime","code":""},{"title":"Dates - strictdate","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/dates/strictdate","code":""},{"title":"Distinct","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/distinct","code":""},{"title":"Dynajoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/dynajoin","code":""},{"title":"Enumeration","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/enumeration","code":""},{"title":"Extend - all","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/all","code":""},{"title":"Extend - distinct","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/distinct","code":""},{"title":"Extend - embeddedPropertyMapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/embeddedPropertyMapping","code":""},{"title":"Extend - filter","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/filter","code":""},{"title":"Extend - groupBy","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/groupBy","code":""},{"title":"Extent - inlineEmbeddedPropertyMapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/inlineEmbeddedPropertyMapping","code":""},{"title":"Extend - mainTable","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/mainTable","code":""},{"title":"Extend - model","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/model","code":""},{"title":"Extend - primaryKey","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/primaryKey","code":""},{"title":"Extend - propertyMapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/propertyMapping","code":""},{"title":"Extend - store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/store","code":""},{"title":"Extend - storeSubstitution","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/storeSubstitution","code":""},{"title":"Extend - Union","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/union","code":""},{"title":"Extend - Filter","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/filter","code":""},{"title":"GroupBy","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/groupBy","code":""},{"title":"In","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/in","code":""},{"title":"Include","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/include","code":""},{"title":"Inheritance - Cross","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/inheritance/cross","code":""},{"title":"Inheritance - Relational - multiJoins","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/inheritance/relational/multiJoins","code":""},{"title":"Inheritance - Relational - selfJoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/inheritance/relational/selfJoin","code":""},{"title":"Inheritance - Relational - union","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/inheritance/relational/union","code":""},{"title":"Innerjoin - Isolation","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/innerJoin/isolation","code":""},{"title":"Join","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/join","code":""},{"title":"Merge","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/merge","code":""},{"title":"Multigrain","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/multigrain","code":""},{"title":"Propertyfunc - simple","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/propertyfunc/simple","code":""},{"title":"Propertyfunc - withjoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/propertyfunc/withjoin","code":""},{"title":"SelfJoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/selfJoin","code":""},{"title":"Model To Model Service - Querying _Firm using json input","description":"Mapping of Firm to _Firm with tests and a service fetching _Firm output","documentation":"This project showcases a model to model mapping from `Firm` to `_Firm` outlining a mapping test and a service test for model to model.","path":"Store/Model Store/Mapping/service/basic","code":"###Data\nData data::IBMFirmData\n{\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\": [\\n {\\n \"firstName\": \"John\",\\n \"lastName\": \"Smith\"\\n }\\n ],\\n \"legalName\": \"IBM\",\\n \"type\": \"llc\"\\n}';\n }#\n}\n\n\n###Service\nService mapping::FirmService\n{\n pattern: '/83a0d72d-e69d-453e-8f23-8059767aeab7';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |model::target::_Firm.all()->graphFetch(\n #{\n model::target::_Firm{\n myLegalName,\n name,\n employees{\n fullName\n }\n }\n }#\n )->serialize(\n #{\n model::target::_Firm{\n myLegalName,\n name,\n employees{\n fullName\n }\n }\n }#\n );\n mapping: mapping::ModelToModelMapping;\n runtime: mapping::FirmRuntime;\n }\n testSuites:\n [\n testSuite_1:\n {\n data:\n [\n connections:\n [\n connection_1:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\": [\\n {\\n \"firstName\": \"John\",\\n \"lastName\": \"Smith\"\\n }\\n ],\\n \"legalName\": \"IBM\",\\n \"type\": \"llc\"\\n}';\n }#\n ]\n ]\n tests:\n [\n test_1:\n {\n serializationFormat: PURE;\n asserts:\n [\n assertion_1:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"myLegalName()\": \"my name is: IBM\",\\n \"name\": \"IBM\",\\n \"employees\": [\\n {\\n \"fullName\": \"John Smith\"\\n }\\n ]\\n}';\n }#;\n }#\n ]\n }\n ]\n }\n ]\n}\n\n\n###Pure\nEnum model::target::IncType\n{\n LLC,\n CORP\n}\n\nClass model::Person\n{\n firstName: String[1];\n lastName: String[1];\n}\n\nClass model::Firm\n{\n employees: model::Person[1..*];\n legalName: String[1];\n}\n\nClass model::target::_Firm\n{\n employees: model::target::_Person[1..*];\n name: String[1];\n myLegalName() {'my name is: ' + $this.name}: String[1];\n}\n\nClass model::target::_Person\n{\n fullName: String[1];\n}\n\n\n###Mapping\nMapping mapping::ModelToModelMapping\n(\n *model::target::_Person: Pure\n {\n ~src model::Person\n fullName: $src.firstName + ' ' + $src.lastName\n }\n *model::target::_Firm: Pure\n {\n ~src model::Firm\n employees[model_target__Person]: $src.employees,\n name: $src.legalName\n }\n\n model::target::IncType: EnumerationMapping\n {\n LLC: ['llc'],\n CORP: ['corp']\n }\n\n testSuites:\n [\n FirmSuite:\n {\n function: |model::target::_Firm.all()->graphFetch(\n #{\n model::target::_Firm{\n employees{\n fullName\n },\n name,\n myLegalName\n }\n }#\n)->serialize(\n #{\n model::target::_Firm{\n employees{\n fullName\n },\n name,\n myLegalName\n }\n }#\n);\n tests:\n [\n AppleData:\n {\n doc: 'This test will use Apple Data and assert the transformation.';\n data:\n [\n ModelStore:\n ModelStore\n #{\n model::Firm:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\": [\\n {\\n \"firstName\": \"firstEmployeeName\",\\n \"lastName\": \"secondEmployeeName\"\\n }\\n ],\\n \"legalName\": \"Apple Inc\"\\n}';\n }#\n }#\n ];\n asserts:\n [\n expectedAssertion:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\" : [ {\\n \"fullName\" : \"firstEmployeeName secondEmployeeName\"\\n } ],\\n \"name\" : \"Apple Inc\",\\n \"myLegalName()\" : \"my name is: Apple Inc\"\\n}';\n }#;\n }#\n ];\n },\n GoogleData:\n {\n data:\n [\n ModelStore:\n ModelStore\n #{\n model::Firm:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\": [\\n {\\n \"firstName\": \"firstEmployeeName\",\\n \"lastName\": \"secondEmployeeName\"\\n }\\n ],\\n \"legalName\": \"Google\"\\n}';\n }#\n }#\n ];\n asserts:\n [\n expectedAssertion:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\r\\n \"employees\" : [ {\\r\\n \"fullName\" : \"firstEmployeeName secondEmployeeName\"\\r\\n } ],\\r\\n \"name\" : \"Google\",\\r\\n \"myLegalName()\" : \"my name is: Google\"\\r\\n}';\n }#;\n }#\n ];\n },\n IBMData:\n {\n doc: '';\n data:\n [\n ModelStore:\n ModelStore\n #{\n model::Firm:\n Reference\n #{\n data::IBMFirmData\n }#\n }#\n ];\n asserts:\n [\n expectedAssertion:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\r\\n \"employees\" : [ {\\r\\n \"fullName\" : \"John Smith\"\\r\\n } ],\\r\\n \"name\" : \"IBM\",\\r\\n \"myLegalName()\" : \"my name is: IBM\"\\r\\n}';\n }#;\n }#\n ];\n },\n IBMData2:\n {\n doc: '';\n data:\n [\n ModelStore:\n ModelStore\n #{\n model::Firm:\n Reference\n #{\n data::IBMFirmData\n }#\n }#\n ];\n asserts:\n [\n expectedAssertion:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\" : [ {\\n \"fullName\" : \"John Smith\"\\n } ],\\n \"name\" : \"IBM\",\\n \"myLegalName()\" : \"my name is: IBM\"\\n}';\n }#;\n }#\n ];\n }\n ];\n }\n ]\n)\n\n\n###Connection\nJsonModelConnection mapping::FirmConnection\n{\n class: model::Firm;\n url: 'data:application/json,%7B%7D';\n}\n\n\n###Runtime\nRuntime mapping::FirmRuntime\n{\n mappings:\n [\n mapping::ModelToModelMapping\n ];\n connections:\n [\n ModelStore:\n [\n connection_1: mapping::FirmConnection\n ]\n ];\n}\n"},{"title":"Subtype","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/subtype","code":""},{"title":"Tree","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/tree","code":""},{"title":"Union - Extend","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/extend","code":""},{"title":"Union - MultipleChainedJoins","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/multipleChainedJoins","code":""},{"title":"Union - Optimized","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/optimized","code":""},{"title":"Union - Partial","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/partial","code":""},{"title":"Union - PartialForeignKeyUsage","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/partialForeignKeyUsage","code":""},{"title":"Union - SqlQueryMerging","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/sqlQueryMerging","code":""},{"title":"Model Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Store","code":""},{"title":"Mongo Store Connection","documentation":"TODO: Some dummy description","development":true,"path":"Store/Mongo Store/Connection","code":""},{"title":"Mongo Store Mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Mongo Store/Mapping","code":""},{"title":"Mongo Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Mongo Store/Store","code":""},{"title":"Service Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Mongo Store","code":""},{"title":"Relational Database Connection BigQuery with Default Credentials","description":"BigQuery connection using only default credentials. Does not include proxy.","documentation":"","path":"Store/Relational Store/Connection/BigQuery/DefaultCredentials","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: BigQuery;\n specification: BigQuery\n {\n projectId: 'proj1';\n defaultDataset: 'dataset1';\n };\n auth: GCPApplicationDefaultCredentials;\n}\n"},{"title":"Relational Database Connection BigQuery with Default Credentials and Proxy","description":"BigQuery connection using only default credentials. Does include proxy.","documentation":"","path":"Store/Relational Store/Connection/BigQuery/DefaultCredentialsWithProxy","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: BigQuery;\n specification: BigQuery\n {\n projectId: 'proj1';\n defaultDataset: 'dataset1';\n proxyHost: 'proxyHost1';\n proxyPort: 'proxyPort1';\n };\n auth: GCPApplicationDefaultCredentials;\n}\n"},{"title":"Relational Database Connection BigQuery with Identity Federation","description":"BigQuery connection using Identity Federation.","documentation":"","path":"Store/Relational Store/Connection/BigQuery/IdentityFederation","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: BigQuery;\n specification: BigQuery\n {\n projectId: 'proj1';\n defaultDataset: 'dataset1';\n };\n auth: GCPWorkloadIdentityFederation\n {\n serviceAccountEmail: 'name';\n };\n}\n"},{"title":"Relational Database Connection BigQuery with Identity Federation additional scopes","description":"BigQuery connection using Identity Federation including additional scopes.","documentation":"","path":"Store/Relational Store/Connection/BigQuery/IdentityFederationWithScopes","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: BigQuery;\n specification: BigQuery\n {\n projectId: 'proj1';\n defaultDataset: 'dataset1';\n };\n auth: GCPWorkloadIdentityFederation\n {\n serviceAccountEmail: 'name';\n additionalGcpScopes: [\n 'gcpScope',\n 'anotherGcpScope'\n ];\n };\n}\n"},{"title":"Relational Database Connection Databricks","description":"Examples of all valid Databricks connection specs","documentation":"","path":"Store/Relational Store/Connection/Databricks","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: Databricks;\n specification: Databricks\n {\n hostname: 'databricks.com';\n port: '443';\n protocol: 'https';\n httpPath: 'databricks/api/path';\n };\n auth: ApiToken\n {\n apiToken: 'databricks.api.token';\n };\n}"},{"title":"Relational Database Connection MemSQL","description":"Examples of all valid MemSQL connection specs","documentation":"","development":true,"path":"Store/Relational Store/Connection/MemSQL","code":""},{"title":"Relational Database Connection Postgres","description":"Examples of all valid Postgres connection specs","documentation":"","development":true,"path":"Store/Relational Store/Connection/Postgres","code":""},{"title":"Relational Database Connection SQL Server","description":"Examples of all valid SQL Server connection specs","documentation":"","development":true,"path":"Store/Relational Store/Connection/SQL Server","code":""},{"title":"Relational Database Connection Spanner","description":"Examples of all valid Spanner connection specs","documentation":"","path":"Store/Relational Store/Connection/Spanner","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection1\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n proxyHost: 'localhost';\n proxyPort: 9010;\n };\n auth: GCPApplicationDefaultCredentials;\n}\n\nRelationalDatabaseConnection connection::mySimpleConnection2\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n };\n auth: GCPApplicationDefaultCredentials;\n}\n\nRelationalDatabaseConnection connection::mySimpleConnection3\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n };\n auth: DelegatedKerberos;\n}\n\nRelationalDatabaseConnection connection::mySimpleConnection4\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n proxyHost: 'localhost';\n proxyPort: 9010;\n };\n auth: GCPWorkloadIdentityFederation\n {\n serviceAccountEmail: 'name';\n };\n}\n\nRelationalDatabaseConnection connection::mySimpleConnection5\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n proxyHost: 'localhost';\n proxyPort: 9010;\n };\n auth: GCPWorkloadIdentityFederation\n {\n serviceAccountEmail: 'name';\n additionalGcpScopes: [\n 'gcpScope',\n 'anotherGcpScope'\n ];\n };\n}"},{"title":"Relational Database Connection Trino","description":"Examples of all valid Trino connection specs","documentation":"","path":"Store/Relational Store/Connection/Trino","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::TrinoConnection\n{\n store: store::Store;\n type: Trino;\n specification: Trino\n {\n host: 'host';\n port: 1234;\n catalog: 'tpch';\n schema: 'tiny';\n clientTags: 'cg::vega';\n sslSpecification:\n {\n ssl: false;\n trustStorePathVaultReference: 'abc12cde';\n trustStorePasswordVaultReference: 'abc12cde';\n };\n };\n auth: TrinoDelegatedKerberos\n {\n kerberosUseCanonicalHostname: false;\n kerberosRemoteServiceName: 'HTTP';\n };\n}"},{"title":"Basic Relational Database Specification","description":"Example of database specification with no explicit schema or joins","documentation":"","path":"Store/Relational Store/Database Specification/Basic","code":"###Relational\nDatabase store::SimpleDB\n(\n // There is an implicit 'default' schema \n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n)\n"},{"title":"Relational Database Specification with Filter","description":"Example of database specification with Filter","documentation":"","path":"Store/Relational Store/Database Specification/Filter","code":"###Relational\nDatabase store::SimpleDB\n(\n // There is an implicit 'default' schema \n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n\n // Filters at the database level can be shared with several mappings\n Filter largePersonIds(People.id > 100)\n)\n"},{"title":"Basic Relational Database Specification with Includes","description":"Example of database specification with other Database definitions included","documentation":"","path":"Store/Relational Store/Database Specification/Include","code":"###Relational\nDatabase store::SimpleDB\n(\n include store::IncludedDB\n\n // Definitions in included DB are available here\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n)\n\nDatabase store::IncludedDB\n(\n Table PeoplePart2\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n)"},{"title":"Relational Database Specification with Milestoning","description":"Example of database specification with Milestoning","documentation":"","path":"Store/Relational Store/Database Specification/Join/Basic","code":"###Relational\nDatabase store::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n\n Join PersonCompany(People.firm_id = Firms.id)\n // Joins can also be defined across schemas\n)\n"},{"title":"Relational Database Specification with Join placeholder","description":"Example of database specification with join placeholder.","documentation":"TODO: explain what this feature is useful for.","path":"Store/Relational Store/Database Specification/Join/Self Join","code":"###Relational\nDatabase store::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n\n Join PersonCompany(People.id = {target}.firm_id)\n)\n"},{"title":"Relational Database Specification with Bitemporal Milestoning","description":"Example of database specification with Bitemporal Milestoning.","documentation":"","path":"Store/Relational Store/Database Specification/Milestoning/Bitemporal","code":"###Relational\nDatabase store::MilestonedDB\n(\n Table BiTemporalProductTable\n (\n milestoning\n (\n processing(PROCESSING_IN = in_z, PROCESSING_OUT = out_z, INFINITY_DATE = %9999-12-31T00:00:00.0000),\n business(BUS_FROM = from_z, BUS_THRU = thru_z, INFINITY_DATE = %9999-12-31T00:00:00.0000)\n )\n\n id INTEGER PRIMARY KEY,\n type VARCHAR(200),\n in_z DATE,\n out_z DATE,\n from_z DATE,\n thru_z DATE\n )\n)"},{"title":"Relational Database Specification with Business Milestoning","description":"Example of database specification with Business Milestoning.","documentation":"","path":"Store/Relational Store/Database Specification/Milestoning/Business","code":"###Relational\nDatabase store::MilestonedDB\n(\n Table ProductTable\n (\n milestoning\n (\n // A subset of the following options can be used with the minimal being BUS_FROM and BUS_THRU\n business(BUS_FROM = from_z, BUS_THRU = thru_z, THRU_IS_INCLUSIVE = true, INFINITY_DATE = %9999-12-31T00:00:00.0000)\n )\n\n id INTEGER PRIMARY KEY,\n name VARCHAR(200) PRIMARY KEY,\n type VARCHAR(200),\n exchange VARCHAR(200),\n classificationSystemId INTEGER,\n referenceSystemName VARCHAR(200),\n externalReferenceSystemName VARCHAR(200),\n from_z DATE,\n thru_z DATE\n )\n Table ProductTableWithBusinessSnapshotMilestoning\n (\n milestoning\n (\n business(BUS_SNAPSHOT_DATE = snapshotDate)\n )\n\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n type VARCHAR(200),\n snapshotDate DATE\n )\n)\n"},{"title":"Relational Database Specification with Processing Milestoning","description":"Example of database specification with Temporal Milestoning.","documentation":"","path":"Store/Relational Store/Database Specification/Milestoning/Processing","code":"###Relational\nDatabase store::MilestonedDB\n(\n Table BiTemporalProductTableWithProcessingMilestoning\n (\n milestoning\n (\n // The minimal set of options is PROCESSING_IN and PROCESSING_OUT\n processing(PROCESSING_IN = in_z, PROCESSING_OUT = out_z, OUT_IS_INCLUSIVE = true, INFINITY_DATE = %9999-12-31T00:00:00.0000)\n )\n\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n type VARCHAR(200),\n in_z DATE,\n out_z DATE\n )\n)\n"},{"title":"Relational Database Specification with explicit Schema","description":"Example of database specification with explicit schema","documentation":"","path":"Store/Relational Store/Database Specification/Schema","code":"###Relational\nDatabase store::SimpleDB\n(\n Schema SimpleSchema\n (\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n )\n // Joins go outside the schema\n)\n"},{"title":"Relational Database Specification with Views","description":"Example of database specification with Views.","documentation":"Views are effectively transformations at the database level. They have the same syntax as Mappings but have a few different features.\nTODO: include a description on why views are required.","path":"Store/Relational Store/Database Specification/View","code":"###Relational\nDatabase store::SimpleDB\n(\n Schema SimpleSchema\n (\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n\n View ImportantPeople\n (\n id: SimpleSchema.People.id PRIMARY KEY,\n name: SimpleSchema.People.name\n )\n )\n)\n"},{"title":"Relational Querying Using Functions","description":"Example of Relational Function","documentation":"","path":"Store/Relational Store/Function","code":"###Data\nData data::RelationalData\n{\n Relational\n #{\n default.PersonTable:\n 'id,firm_id,firstName,lastName,employeeType\\n'+\n '1,1,John,Doe,FTO\\n'+\n '2,1,Nicole,Smith,FTC\\n'+\n '3,2,Time,Smith,FTE\\n';\n\n default.FirmTable:\n 'id,legal_name\\n'+\n '1,Finos\\n'+\n '2,Apple\\n';\n }#\n}\n\n\n###Relational\nDatabase store::TestDB\n(\n Table FirmTable\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n Table PersonTable\n (\n id INTEGER PRIMARY KEY,\n firm_id INTEGER,\n firstName VARCHAR(200),\n lastName VARCHAR(200),\n employeeType VARCHAR(200)\n )\n\n Join FirmPerson(PersonTable.firm_id = FirmTable.id)\n)\n\n\n###Pure\nClass model::Person\n{\n firstName: String[1];\n lastName: String[1];\n employeeType: model::EmployeeType[1];\n}\n\nEnum model::EmployeeType\n{\n CONTRACT,\n FULL_TIME\n}\n\nClass model::Firm\n{\n legalName: String[1];\n employees: model::Person[*];\n}\n\n\n###Mapping\nMapping execution::RelationalMapping\n(\n *model::Person: Relational\n {\n ~primaryKey\n (\n [store::TestDB]PersonTable.id\n )\n ~mainTable [store::TestDB]PersonTable\n firstName: [store::TestDB]PersonTable.firstName,\n lastName: [store::TestDB]PersonTable.lastName,\n employeeType: EnumerationMapping EmployeeTypeMapping: [store::TestDB]PersonTable.employeeType\n }\n *model::Firm: Relational\n {\n ~primaryKey\n (\n [store::TestDB]FirmTable.id\n )\n ~mainTable [store::TestDB]FirmTable\n legalName: [store::TestDB]FirmTable.legal_name,\n employees[model_Person]: [store::TestDB]@FirmPerson\n }\n\n model::EmployeeType: EnumerationMapping EmployeeTypeMapping\n {\n CONTRACT: ['FTC', 'FTO'],\n FULL_TIME: ['FTE']\n }\n)\n\n\n###Connection\nRelationalDatabaseConnection model::MyConnection\n{\n store: store::TestDB;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'Drop table if exists FirmTable;\\nDrop table if exists PersonTable;\\nCreate Table FirmTable(id INT, Legal_Name VARCHAR(200));\\nCreate Table PersonTable(id INT, firm_id INT, lastName VARCHAR(200), firstName VARCHAR(200), employeeType VARCHAR(200));\\nInsert into FirmTable (id, Legal_Name) values (1, \\'FirmA\\');\\nInsert into FirmTable (id, Legal_Name) values (2, \\'Apple\\');\\nInsert into PersonTable (id, firm_id, lastName, firstName, employeeType) values (1, 1, \\'John\\', \\'Doe\\', \\'FTC\\');\\nInsert into PersonTable (id, firm_id, lastName, firstName, employeeType) values (2, 2, \\'Tim\\', \\'Smith\\', \\'FTE\\');\\nInsert into PersonTable (id, firm_id, lastName, firstName, employeeType) values (3, 3, \\'Nicole\\', \\'Doe\\', \\'FTO\\');\\n\\n'\n ];\n };\n auth: DefaultH2;\n}\n\n\n###Runtime\nRuntime execution::Runtime\n{\n mappings:\n [\n execution::RelationalMapping\n ];\n connections:\n [\n store::TestDB:\n [\n connection_1: model::MyConnection\n ]\n ];\n}\n\n\n###Runtime\nRuntime execution::RuntimeWithStoreConnections\n{\n mappings:\n [\n execution::RelationalMapping\n ];\n connectionStores:\n [\n model::MyConnection:\n [\n store::TestDB\n ]\n ];\n}\n\n\n###Pure\nfunction model::PersonQuery(): meta::pure::tds::TabularDataSet[1]\n{\n model::Person.all()->project(\n [\n x: model::Person[1]|$x.firstName,\n x: model::Person[1]|$x.lastName\n ],\n [\n 'First Name',\n 'Last Name'\n ]\n )->from(\n execution::RelationalMapping,\n execution::Runtime\n )\n}\n\nfunction model::PersonWithParams(firstName: String[1]): meta::pure::tds::TabularDataSet[1]\n{\n model::Person.all()->filter(\n x: model::Person[1]|$x.firstName ==\n $firstName\n )->project(\n [\n x: model::Person[1]|$x.firstName,\n x: model::Person[1]|$x.lastName\n ],\n [\n 'First Name',\n 'Last Name'\n ]\n )->from(\n execution::RelationalMapping,\n execution::Runtime\n )\n}\n{\n testSuite_1\n (\n store::TestDB:\n Relational\n #{\n default.PersonTable:\n 'id,firm_id,firstName,lastName,employeeType\\n'+\n '1,1,I\\'m John,\"Doe, Jr\",FTO\\n'+\n '2,1,Nicole,Smith,FTC\\n'+\n '3,2,Time,Smith,FTE\\n';\n }#;\n testPass | PersonWithParams('Nicole') => (JSON) '[{\\n \"First Name\" : \"Nicole\",\"Last Name\" : \"Smith\"} ]';\n )\n}\n\nfunction model::PersonQuerySharedData(): meta::pure::tds::TabularDataSet[1]\n{\n model::Person.all()->project(\n [\n x: model::Person[1]|$x.firstName,\n x: model::Person[1]|$x.lastName\n ],\n [\n 'First Name',\n 'Last Name'\n ]\n )->from(\n execution::RelationalMapping,\n execution::Runtime\n )\n}\n\nfunction model::PersonWithConnectionStores(): meta::pure::tds::TabularDataSet[1]\n{\n model::Person.all()->project(\n [\n x: model::Person[1]|$x.firstName,\n x: model::Person[1]|$x.lastName\n ],\n [\n 'First Name',\n 'Last Name'\n ]\n )->from(\n execution::RelationalMapping,\n execution::RuntimeWithStoreConnections\n )\n}\n"},{"title":"SqlFunction","documentation":"TODO: Some dummy description","development":true,"path":"Store/Relational Store/Function/sqlFunction","code":""},{"title":"Relational Database Distinct Mapping","description":"A simple example of a mapping containing a distinct operator.","documentation":"","path":"Store/Relational Store/Mapping/Distinct","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleDistinctMapping\n(\n Person: Relational\n {\n ~distinct\n name: [SimpleDB]People.name\n }\n)\n\n\n###Pure\nClass models::Person\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(100)\n )\n)\n"},{"title":"Relational Database Embedded Inline Mapping","description":"An example of an inline mapping.","documentation":"","path":"Store/Relational Store/Mapping/Embedded/Inline","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleInlineMapping\n(\n Person[normalPerson]: Relational\n {\n name: [SimpleDB]People.name,\n address() Inline[USAddress],\n hobby\n (\n name: [SimpleDB]People.hobby_name\n )\n }\n Address[USAddress]: Relational\n {\n ~mainTable [SimpleDB]Addresses\n street_address: [SimpleDB]Addresses.street_address,\n zip: [SimpleDB]US_Zips.zip_code\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n address: Address[1];\n hobby: Hobby[1];\n}\n\nClass models::Hobby\n{\n name: String[1];\n}\n\nClass models::Address\n{\n street_address: String[1];\n zip: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n hobby_name VARCHAR(100)\n )\n Table Addresses\n (\n street_address VARCHAR(200)\n )\n Table US_Zips\n (\n zip_code CHAR(5)\n )\n)\n"},{"title":"Relational database inline nested mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Relational Store/Mapping/Embedded/Inline/nested","code":""},{"title":"Relational database inline targetid mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Relational Store/Mapping/Embedded/Inline/targetId","code":""},{"title":"Relational Database Otherwise Mapping","description":"A simple example of a mapping containing the otherwise operator.","documentation":"","path":"Store/Relational Store/Mapping/Embedded/Otherwise","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleOtherwiseMapping\n(\n Person: Relational\n {\n name: [SimpleDB]People.name,\n pet\n (\n name: [SimpleDB]People.pet_name\n ) Otherwise ([backupPetMapping]: [SimpleDB]@PetOwner)\n }\n Pet[backupPetMapping]: Relational\n {\n name: [SimpleDB]Pets.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n pet: Pet[1];\n}\n\nClass models::Pet\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n pet_id INTEGER,\n pet_name VARCHAR(50)\n )\n Table Pets\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(50)\n )\n\n Join PetOwner(People.pet_id = Pets.id)\n)\n"},{"title":"Relational Database Mapping with Inheritance","description":"A simple example of a mapping that demonstrates inheritance through the extends keyword.","documentation":"","path":"Store/Relational Store/Mapping/Extends","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleInheritanceMapping\n(\n Person[basePerson]: Relational\n {\n name: [SimpleDB]People.name\n }\n PromotableWorker[promotableWorker] extends [basePerson]: Relational\n {\n available_promotion_titles: [SimpleDB]Promotions.title\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\nClass models::PromotableWorker\n{\n available_promotion_titles: String[1..*];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n Table Promotions\n (\n title VARCHAR(50)\n )\n)\n"},{"title":"Relational Database Filter Mapping","description":"A simple example of a mapping that uses a filter.","documentation":"","path":"Store/Relational Store/Mapping/Filter","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleFilterMapping\n(\n Person: Relational\n {\n ~filter [SimpleDB]longNameFilter\n name: [SimpleDB]People.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n\n Filter longNameFilter(length(People.name) >= 100)\n)\n"},{"title":"Relational Database GroupBy Mapping","description":"A simple example of a mapping using the groupBy operator.","documentation":"","path":"Store/Relational Store/Mapping/GroupBy","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleGroupByMapping\n(\n Person: Relational\n {\n ~groupBy\n (\n [SimpleDB]People.firm_id\n )\n name: [SimpleDB]People.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n)\n"},{"title":"Relational Database Mapping with Includes","description":"An example of a Mapping with include statements.","documentation":"","path":"Store/Relational Store/Mapping/Include/Basic","code":"###Mapping\nimport models::*;\nimport stores::*;\nimport mappings::*;\nMapping mappings::IncludeMapping\n(\n include mapping BaseMapping\n\n Person: Relational\n {\n name: [SimpleDB]People.name\n }\n)\n\nMapping mappings::BaseMapping\n(\n Firm: Relational\n {\n name: [SimpleDB]Firms.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n\n Join FirmPerson(People.firm_id = Firms.id)\n)\n"},{"title":"Relational Database Mapping with Store Substitution","description":"An example of a Mapping using store substitution across mappings.","documentation":"Store substitution changes the store used in the included mapping.","path":"Store/Relational Store/Mapping/Include/Store Substitution","code":"###Mapping\nimport models::*;\nimport stores::*;\nimport mappings::*;\nMapping mappings::IncludeSubstitutionMapping\n(\n include mapping BaseMapping[SimpleDB->ComplexDB]\n\n Person: Relational\n {\n name: [ComplexDB]People.name\n }\n)\n\nMapping mappings::BaseMapping\n(\n Firm: Relational\n {\n name: [SimpleDB]Firms.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n)\n\nDatabase stores::ComplexDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_sector VARCHAR(50)\n )\n)"},{"title":"Relational Database Mapping with Joins","description":"A simple example of a mapping with a join.","documentation":"","path":"Store/Relational Store/Mapping/Joins/Basic","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleJoinMapping\n(\n Person: Relational\n {\n name: [SimpleDB]People.name,\n firm: [SimpleDB]@FirmPerson,\n pet_name: [SimpleDB]@PersonPet | [SimpleDB]Pets.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n firm: Firm[1];\n pet_name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\nClass models::Pet\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER,\n pet_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n Table Pets\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(50)\n )\n\n Join FirmPerson(People.firm_id = Firms.id)\n Join PersonPet(People.pet_id = Pets.id)\n)\n"},{"title":"Relational Database Mapping with Chained Joins","description":"An example of a Mapping with Chained joins including setting join type.","documentation":"","path":"Store/Relational Store/Mapping/Joins/Chained","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mappings::ChainedJoinMapping\n(\n Person: Relational\n {\n name: [SimpleDB]People.name,\n firm: [SimpleDB]@FirmPerson,\n good_pet_name: [SimpleDB]@PersonPet > (INNER) [SimpleDB]@GoodPets | [SimpleDB]Pets.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n firm: Firm[1];\n good_pet_name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\nClass models::Pet\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER,\n pet_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n Table Pets\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(50)\n )\n Table GoodPets\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(50)\n )\n\n Join FirmPerson(People.firm_id = Firms.id)\n Join PersonPet(People.pet_id = Pets.id)\n Join GoodPets(Pets.id = GoodPets.id)\n)\n"},{"title":"Relational Mapping with tests","documentation":"This package contains showcase model to demonstrate relational mapping capabilities of Legend\nIn this showcase, we will show the following:\n1) Relational store specifications (schema, tables, column data types, quoting, join, self-join, filter)\n2) Relational mappings with tests\n3) Relational functions – dyna functions\n4) PURE function support","path":"Store/Relational Store/Mapping/Mapping Test","code":"###Diagram\nDiagram relationalMapping::TradeAccountDiagram\n{\n classView 2607efb4-489b-451c-9fe0-3ee0f71191db\n {\n class: relationalMapping::Trade;\n position: (1150.5257568359375,706.5);\n rectangle: (207.88623046875,184.0);\n }\n classView 3f9f55f3-0f34-4aa5-972b-6fb0d0839393\n {\n class: relationalMapping::TradeEvent;\n position: (1528.4548415786112,750.0066923369803);\n rectangle: (146.54296875,72.0);\n }\n classView dfcaa3ce-a0e4-47ca-8a08-937129ab8c5e\n {\n class: relationalMapping::Product;\n position: (763.9989051643056,565.625);\n rectangle: (247.4994525821528,150.3125);\n }\n classView 1e46b918-d9c4-4212-90b3-0b51992421dc\n {\n class: relationalMapping::Trader;\n position: (1536.7489051643056,594.1887199867499);\n rectangle: (117.796875,58.0);\n }\n classView 931cb999-5873-4fcd-8e9b-0ca4f1cf9a3f\n {\n class: relationalMapping::Synonym;\n position: (1170.9989051643056,579.625);\n rectangle: (180.54736328125,100.0);\n }\n classView 742b39b1-983a-4913-bad9-a45654973427\n {\n class: relationalMapping::AccountWithConstraints;\n position: (789.9989051643056,922.25);\n rectangle: (206.46875,58.0);\n }\n classView dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d\n {\n class: relationalMapping::Account;\n position: (804.5257568359375,756.0);\n rectangle: (179.53759765625,72.0);\n }\n propertyView\n {\n property: relationalMapping::Account.trades;\n source: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(977.9580688476562,781.5),(1204.9580688476562,782.5)];\n }\n propertyView\n {\n property: relationalMapping::Trade.account;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(1156.9580688476562,819.5),(957.9580688476562,819.5)];\n }\n propertyView\n {\n property: relationalMapping::Trade.events;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n points: [(1340.9989051643056,779.6887199867499),(1544.9989051643056,779.6887199867499)];\n }\n propertyView\n {\n property: relationalMapping::TradeEvent.trade;\n source: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(1533.9989051643056,813.6887199867499),(1320.9989051643056,813.6887199867499)];\n }\n generalizationView\n {\n source: 742b39b1-983a-4913-bad9-a45654973427;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(893.2332801643056,951.25),(894.2945556640625,792.0)];\n }\n}\n\n\n###Text\nText relationalMapping::README\n{\n type: markdown;\n content: '### Relational Mapping Showcase\\n\\nThis package contains showcase model to demonstrate relational mapping capabilities of Legend\\nIn this showcase, we will show the following:\\n1) Relational store specifications (schema, tables, column data types, quoting, join, self-join, filter)\\n2) Relational mappings with tests\\n3) Relational functions \\u2013 dyna functions\\n4) PURE function support\\n';\n}\n\n\n###Relational\nDatabase relationalMapping::TradeAccountDb\n(\n Schema productSchema\n (\n Table synonymTable\n (\n ID INTEGER PRIMARY KEY,\n PROD_ID INTEGER,\n TYPE VARCHAR(200),\n NAME VARCHAR(200)\n )\n Table productTable\n (\n ID INTEGER PRIMARY KEY,\n PROD_CLASSIFICATION_ID INTEGER,\n NAME VARCHAR(200)\n )\n Table productClassificationTable\n (\n ID INTEGER PRIMARY KEY,\n TYPE VARCHAR(200),\n DESCRIPTION VARCHAR(200)\n )\n )\n\n Table tradeTable\n (\n ID INTEGER PRIMARY KEY,\n PROD_ID INTEGER,\n ACCOUNT_ID INTEGER,\n QUANTITY FLOAT,\n TRADE_DATE DATE,\n SETTLEMENT_DATETIME TIMESTAMP\n )\n Table accountTable\n (\n ID INTEGER PRIMARY KEY,\n NAME VARCHAR(200),\n \"CREATE DATE\" DATE,\n \"CLOSE DATE\" DATE\n )\n Table tradeEventTable\n (\n ID INTEGER PRIMARY KEY,\n TRADE_ID INTEGER,\n EVENT_TYPE VARCHAR(10),\n EVENT_DATE DATE,\n TRADER_ID INTEGER\n )\n Table traderTable\n (\n ID INTEGER PRIMARY KEY,\n NAME VARCHAR(200),\n ADDRESS VARCHAR(200)\n )\n\n Join Product_Synonym(productSchema.synonymTable.PROD_ID = productSchema.productTable.ID)\n Join Product_Classification(productSchema.productTable.PROD_CLASSIFICATION_ID = productSchema.productClassificationTable.ID)\n Join TradeEvent_Trader(tradeEventTable.TRADER_ID = traderTable.ID)\n Join TradeEvent_Trade(tradeEventTable.TRADE_ID = tradeTable.ID)\n Join Trade_Account(tradeTable.ACCOUNT_ID = accountTable.ID)\n Join Trade_Product(tradeTable.PROD_ID = productSchema.productTable.ID)\n\n Filter AccountActiveFilter(accountTable.\"CLOSE DATE\" > now())\n Filter TradeEventSettledFilter(tradeEventTable.EVENT_TYPE = 'Settle')\n)\n\n\n###Pure\nEnum relationalMapping::ProductSynonymType\n{\n CUSIP,\n ISIN,\n SEDOL\n}\n\nClass relationalMapping::Trader\n{\n name: String[1];\n address: String[1];\n}\n\nClass relationalMapping::Synonym\n{\n type: relationalMapping::ProductSynonymType[1];\n name: String[1];\n}\n\nClass {meta::pure::profiles::doc.doc = 'use tags to add metadata.'} relationalMapping::AccountWithConstraints extends relationalMapping::Account\n[\n tradesNotDoubleBooked: $this->project(\n [\n a: relationalMapping::AccountWithConstraints[1]|$a.trades.id\n ],\n ['tradeId']\n)->groupBy(\n 'tradeId',\n 'count'->agg(\n x: meta::pure::tds::TDSRow[1]|$x,\n y: meta::pure::tds::TDSRow[*]|$y->count()\n )\n)->filter(\n t: meta::pure::tds::TDSRow[1]|$t.getInteger('count') > 1\n)->tdsRows()->isEmpty(),\n noTradesAfterCloseDate: true\n]\n{\n isOpen() {$this.closeDate->isEmpty()}: Boolean[1];\n}\n\nClass relationalMapping::TradeEvent\n{\n eventType: String[1];\n eventDate: StrictDate[1];\n initiator: relationalMapping::Trader[0..1];\n trade: relationalMapping::Trade[1];\n}\n\nClass relationalMapping::Account\n{\n name: String[1];\n createDate: StrictDate[1];\n trades: relationalMapping::Trade[*];\n closeDate: StrictDate[0..1];\n}\n\nClass relationalMapping::ProductClassification\n{\n type: String[1];\n description: String[1];\n}\n\nClass relationalMapping::Trade\n{\n id: Integer[1];\n tradeDate: StrictDate[1];\n quantity: Float[1];\n settlementDateTime: DateTime[0..1];\n product: relationalMapping::Product[0..1];\n account: relationalMapping::Account[0..1];\n events: relationalMapping::TradeEvent[*];\n productIdentifier() {if(\n $this.product->isNotEmpty(),\n |$this.product->toOne().name,\n |'Unknown'\n)}: String[1];\n eventsByDate(date: Date[1]) {$this.events->filter(\n e: relationalMapping::TradeEvent[1]|$e.eventDate ==\n $date\n)}: relationalMapping::TradeEvent[*];\n tradeDateEvent() {$this.eventsByDate($this.tradeDate->toOne())->toOne()}: relationalMapping::TradeEvent[1];\n tradeDateEventType() {$this.tradeDateEvent.eventType}: String[1];\n initiator() {$this.tradeDateEvent.initiator}: relationalMapping::Trader[0..1];\n}\n\nClass {meta::pure::profiles::doc.doc = 'must pass date for isin/cusip/sedol now.'} relationalMapping::Product\n{\n name: String[1];\n classification: relationalMapping::ProductClassification[1];\n cusip() {$this.synonyms->filter(\n s: relationalMapping::Synonym[1]|$s.type ==\n relationalMapping::ProductSynonymType.CUSIP\n)->toOne().name}: String[1];\n isin() {$this.synonyms->filter(\n s: relationalMapping::Synonym[1]|$s.type ==\n relationalMapping::ProductSynonymType.ISIN\n)->toOne().name}: String[1];\n sedol() {$this.synonyms->filter(\n s: relationalMapping::Synonym[1]|$s.type ==\n relationalMapping::ProductSynonymType.SEDOL\n)->toOne().name}: String[1];\n}\n\nAssociation relationalMapping::ProdSynonym\n{\n product: relationalMapping::Product[1];\n synonyms: relationalMapping::Synonym[*];\n}\n\n\n###Mapping\nMapping relationalMapping::RelationalMappingWithFilters\n(\n relationalMapping::Account: Relational\n {\n ~filter [relationalMapping::TradeAccountDb]AccountActiveFilter\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]accountTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]accountTable\n name: [relationalMapping::TradeAccountDb]accountTable.NAME,\n createDate: [relationalMapping::TradeAccountDb]accountTable.\"CREATE DATE\",\n closeDate: [relationalMapping::TradeAccountDb]accountTable.\"CLOSE DATE\"\n }\n relationalMapping::TradeEvent: Relational\n {\n ~filter [relationalMapping::TradeAccountDb]TradeEventSettledFilter\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]tradeEventTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]tradeEventTable\n eventType: [relationalMapping::TradeAccountDb]tradeEventTable.EVENT_TYPE,\n eventDate: [relationalMapping::TradeAccountDb]tradeEventTable.EVENT_DATE\n }\n\n MappingTests\n [\n test_1\n (\n query: |relationalMapping::Account.all()->graphFetch(\n #{\n relationalMapping::Account{\n name,\n createDate,\n closeDate\n }\n }#\n)->serialize(\n #{\n relationalMapping::Account{\n name,\n createDate,\n closeDate\n }\n }#\n);\n data:\n [\n \n ];\n assert: '[{\"name\":\"Acct 2\",\"createDate\":\"2020-01-01\",\"closeDate\":\"2025-01-01\"},{\"name\":\"Acct 2\",\"createDate\":\"2020-01-01\",\"closeDate\":\"2029-01-01\"}]';\n ),\n test_2\n (\n query: |relationalMapping::TradeEvent.all()->graphFetch(\n #{\n relationalMapping::TradeEvent{\n eventDate,\n eventType\n }\n }#\n)->serialize(\n #{\n relationalMapping::TradeEvent{\n eventDate,\n eventType\n }\n }#\n);\n data:\n [\n \n ];\n assert: '{\"eventDate\":\"2021-01-03\",\"eventType\":\"Settle\"}';\n )\n ]\n)\n\nMapping relationalMapping::TradeAccountRelationalMapping\n(\n *relationalMapping::ProductClassification: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]productSchema.productClassificationTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]productSchema.productClassificationTable\n type: [relationalMapping::TradeAccountDb]productSchema.productClassificationTable.TYPE,\n description: toUpper([relationalMapping::TradeAccountDb]productSchema.productClassificationTable.DESCRIPTION)\n }\n *relationalMapping::Synonym: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]productSchema.synonymTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]productSchema.synonymTable\n name: [relationalMapping::TradeAccountDb]productSchema.synonymTable.NAME,\n type: EnumerationMapping relationalMapping_ProductSynonymType: [relationalMapping::TradeAccountDb]productSchema.synonymTable.TYPE,\n product[relationalMapping_Product]: [relationalMapping::TradeAccountDb]@Product_Synonym\n }\n *relationalMapping::Product: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]productSchema.productTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]productSchema.productTable\n synonyms[relationalMapping_Synonym]: [relationalMapping::TradeAccountDb]@Product_Synonym,\n name: [relationalMapping::TradeAccountDb]productSchema.productTable.NAME,\n classification[relationalMapping_ProductClassification]: [relationalMapping::TradeAccountDb]@Product_Classification\n }\n *relationalMapping::Account: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]accountTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]accountTable\n name: [relationalMapping::TradeAccountDb]accountTable.NAME,\n createDate: [relationalMapping::TradeAccountDb]accountTable.\"CREATE DATE\",\n closeDate: [relationalMapping::TradeAccountDb]accountTable.\"CLOSE DATE\"\n }\n *relationalMapping::Trader: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]traderTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]traderTable\n name: [relationalMapping::TradeAccountDb]traderTable.NAME,\n address: [relationalMapping::TradeAccountDb]traderTable.ADDRESS\n }\n *relationalMapping::TradeEvent: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]tradeEventTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]tradeEventTable\n eventType: [relationalMapping::TradeAccountDb]tradeEventTable.EVENT_TYPE,\n eventDate: [relationalMapping::TradeAccountDb]tradeEventTable.EVENT_DATE,\n initiator[relationalMapping_Trader]: [relationalMapping::TradeAccountDb]@TradeEvent_Trader\n }\n *relationalMapping::Trade: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]tradeTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]tradeTable\n id: [relationalMapping::TradeAccountDb]tradeTable.ID,\n tradeDate: [relationalMapping::TradeAccountDb]tradeTable.TRADE_DATE,\n quantity: [relationalMapping::TradeAccountDb]tradeTable.QUANTITY,\n settlementDateTime: [relationalMapping::TradeAccountDb]tradeTable.SETTLEMENT_DATETIME,\n product[relationalMapping_Product]: [relationalMapping::TradeAccountDb]@Trade_Product,\n account[relationalMapping_Account]: [relationalMapping::TradeAccountDb]@Trade_Account,\n events[relationalMapping_TradeEvent]: [relationalMapping::TradeAccountDb]@TradeEvent_Trade\n }\n\n relationalMapping::ProductSynonymType: EnumerationMapping\n {\n CUSIP: ['CUSIP'],\n ISIN: ['ISIN'],\n SEDOL: ['SEDOL']\n }\n\n MappingTests\n [\n test_1\n (\n query: |relationalMapping::ProductClassification.all()->project(\n [\n x: relationalMapping::ProductClassification[1]|$x.description,\n x: relationalMapping::ProductClassification[1]|$x.type->contains('Type A'),\n x: relationalMapping::ProductClassification[1]|$x.type\n ],\n [\n 'Description',\n 'Is Type A',\n 'Type'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[\"TYPE A PRODUCT\",true,\"Type A\"]},{\"values\":[\"TYPE B PRODUCT\",false,\"Type B\"]},{\"values\":[\"TYPE C PRODUCT\",false,\"Type C\"]}]';\n ),\n test_2\n (\n query: |relationalMapping::Product.all()->filter(\n x: relationalMapping::Product[1]|$x.classification.type == 'Type A'\n)->project(\n [\n x: relationalMapping::Product[1]|$x.name,\n x: relationalMapping::Product[1]|$x.classification.type,\n x: relationalMapping::Product[1]|$x.classification.description,\n x: relationalMapping::Product[1]|$x.synonyms.type,\n x: relationalMapping::Product[1]|$x.synonyms.name\n ],\n [\n 'Name',\n 'Classification/Type',\n 'Classification/Description',\n 'Synonyms/Type',\n 'Synonyms/Name'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[\"Product1\",\"Type A\",\"TYPE A PRODUCT\",\"CUSIP\",\"CUSIP1\"]},{\"values\":[\"Product1\",\"Type A\",\"TYPE A PRODUCT\",\"ISIN\",\"ISIN1\"]}]';\n ),\n test_3\n (\n query: |relationalMapping::Account.all()->project(\n [\n x: relationalMapping::Account[1]|$x.name,\n x: relationalMapping::Account[1]|$x.closeDate,\n x: relationalMapping::Account[1]|$x.createDate,\n x: relationalMapping::Account[1]|$x.createDate->monthNumber(),\n x: relationalMapping::Account[1]|$x.createDate->dayOfMonth()\n ],\n [\n 'Name',\n 'Close Date',\n 'Create Date',\n 'Create Month Number',\n 'Create dayOfMonth'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[\"Acct 1\",\"2021-01-01\",\"2020-01-01\",1,1]}]';\n ),\n test_4\n (\n query: |relationalMapping::Trade.all()->project(\n [\n x: relationalMapping::Trade[1]|$x.id,\n x: relationalMapping::Trade[1]|$x.quantity,\n x: relationalMapping::Trade[1]|$x.settlementDateTime,\n x: relationalMapping::Trade[1]|$x.tradeDate,\n x: relationalMapping::Trade[1]|$x.account.name,\n x: relationalMapping::Trade[1]|$x.product.name,\n x: relationalMapping::Trade[1]|$x.tradeDateEvent.eventDate,\n x: relationalMapping::Trade[1]|$x.tradeDateEventType,\n x: relationalMapping::Trade[1]|$x.initiator.name\n ],\n [\n 'Id',\n 'Quantity',\n 'Settlement Date Time',\n 'Trade Date',\n 'Account_Name',\n 'Product_Name',\n 'Trade Event Date',\n 'Trade Date Event Type',\n 'Initiator'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[1,100.0,\"2021-01-01T12:00:00.000000000+0000\",\"2021-01-01\",\"Acct 1\",\"Product1\",\"2021-01-01\",\"New\",\"Jack\"]}]';\n )\n ]\n)\n"},{"title":"Relational Database Mapping with Scoped Block","description":"An example of a Mapping using a scoped block for readability.","documentation":"","path":"Store/Relational Store/Mapping/Scope","code":"###Mapping\nimport stores::*;\nimport models::*;\nMapping mappings::SimpleScopedMapping\n(\n Person: Relational\n {\n // scope([SimpleDB]SimpleSchema.People) can be used to extract the prefix\n // it is just syntactic sugar and will be string replaced.\n name: [SimpleDB]SimpleSchema.People.name\n }\n)\n\n\n###Pure\nClass models::Person\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Schema SimpleSchema\n (\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n )\n)"},{"title":"Basic Querying Semi Structure Data","documentation":"Basic Querying Semi Structure Data with mapping and functions defined.","path":"Store/Relational Store/Mapping/Semi Structure/Basic","code":"###Pure\nClass simple::model::Firm\n{\n ID: Integer[1];\n legalName: String[1];\n employeeCount: Integer[1];\n mnc: Boolean[1];\n estDate: StrictDate[1];\n lastUpdate: DateTime[1];\n entityType: simple::model::EntityType[1];\n secondLineOfAddress: String[0..1];\n}\n\nEnum simple::model::EntityType\n{\n Organization,\n Company\n}\n\n\n###Relational\nDatabase simple::store::H2DB\n(\n Schema FIRM_SCHEMA\n (\n Table FIRM_TABLE\n (\n ID INTEGER PRIMARY KEY,\n FIRM_DETAILS VARCHAR(1000)\n )\n )\n)\n\nDatabase simple::store::SnowflakeDB\n(\n Schema FIRM_SCHEMA\n (\n Table FIRM_TABLE\n (\n ID INTEGER PRIMARY KEY,\n FIRM_DETAILS SEMISTRUCTURED\n )\n )\n)\n\nDatabase simple::store::MemSQLDB\n(\n Schema FIRM_SCHEMA\n (\n Table FIRM_TABLE\n (\n ID INTEGER PRIMARY KEY,\n FIRM_DETAILS JSON\n )\n )\n)\n\n\n###Mapping\nMapping simple::mapping::SnowflakeMapping\n(\n *simple::model::Firm: Relational\n {\n ~primaryKey\n (\n [simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.ID\n )\n ~mainTable [simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE\n ID: [simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.ID,\n legalName: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'legalName', 'VARCHAR'),\n employeeCount: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'employeeCount', 'INTEGER'),\n mnc: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'mnc', 'BOOLEAN'),\n estDate: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'dates.estDate', 'DATE'),\n lastUpdate: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, '[\"dates\"][\"last Update\"]', 'TIMESTAMP'),\n entityType: EnumerationMapping simple_model_EntityType: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'entity.entityType', 'VARCHAR'),\n secondLineOfAddress: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'address.lines[1][\"details\"]', 'VARCHAR')\n }\n\n simple::model::EntityType: EnumerationMapping\n {\n Organization: ['O'],\n Company: ['P']\n }\n)\n\nMapping simple::mapping::MemSQLMapping\n(\n *simple::model::Firm: Relational\n {\n ~primaryKey\n (\n [simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.ID\n )\n ~mainTable [simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE\n ID: [simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.ID,\n legalName: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'legalName', 'VARCHAR'),\n employeeCount: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'employeeCount', 'INTEGER'),\n mnc: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'mnc', 'BOOLEAN'),\n estDate: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'dates.estDate', 'DATE'),\n lastUpdate: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, '[\"dates\"][\"last Update\"]', 'TIMESTAMP'),\n entityType: EnumerationMapping simple_model_EntityType: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'entity.entityType', 'VARCHAR'),\n secondLineOfAddress: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'address.lines[1][\"details\"]', 'VARCHAR')\n }\n\n simple::model::EntityType: EnumerationMapping\n {\n Organization: ['O'],\n Company: ['P']\n }\n)\n\nMapping simple::mapping::H2Mapping\n(\n *simple::model::Firm: Relational\n {\n ~primaryKey\n (\n [simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.ID\n )\n ~mainTable [simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE\n ID: [simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.ID,\n legalName: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'legalName', 'VARCHAR'),\n employeeCount: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'employeeCount', 'INTEGER'),\n mnc: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'mnc', 'BOOLEAN'),\n estDate: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'dates.estDate', 'DATE'),\n lastUpdate: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, '[\"dates\"][\"last Update\"]', 'TIMESTAMP'),\n entityType: EnumerationMapping simple_model_EntityType: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'entity.entityType', 'VARCHAR'),\n secondLineOfAddress: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'address.lines[1][\"details\"]', 'VARCHAR')\n }\n\n simple::model::EntityType: EnumerationMapping\n {\n Organization: ['O'],\n Company: ['C']\n }\n)\n\n\n###Runtime\nRuntime simple::runtime::SnowflakeRuntime\n{\n mappings:\n [\n simple::mapping::SnowflakeMapping\n ];\n connections:\n [\n simple::store::SnowflakeDB:\n [\n connection_1:\n #{\n RelationalDatabaseConnection\n {\n store: simple::store::SnowflakeDB;\n type: Snowflake;\n specification: Snowflake\n {\n name: 'dbName';\n account: 'account';\n warehouse: 'warehouse';\n region: 'region';\n };\n auth: DefaultH2;\n }\n }#\n ]\n ];\n}\n\n\n###Pure\nfunction simple::dotAndBracketNotationAccess(): TabularDataSet[1]\n{\n simple::model::Firm.all()->project(\n [\n x: simple::model::Firm[1]|$x.ID,\n x: simple::model::Firm[1]|$x.estDate,\n x: simple::model::Firm[1]|$x.lastUpdate,\n x: simple::model::Firm[1]|$x.secondLineOfAddress\n ],\n [\n 'Id',\n 'Dot Only',\n 'Bracket Only',\n 'Dot & Bracket'\n ]\n )\n}\n\nfunction simple::arrayElementNoFlattenAccess(): TabularDataSet[1]\n{\n simple::model::Firm.all()->project(\n [\n x: simple::model::Firm[1]|$x.ID,\n x: simple::model::Firm[1]|$x.secondLineOfAddress\n ],\n [\n 'Id',\n 'Second Line of Address'\n ]\n )\n}\n\nfunction simple::extractEnumProperty(): TabularDataSet[1]\n{\n simple::model::Firm.all()->project(\n [\n x: simple::model::Firm[1]|$x.ID,\n x: simple::model::Firm[1]|$x.entityType\n ],\n [\n 'Id',\n 'Entity Type'\n ]\n )\n}\n\nfunction simple::allDataTypesAccess(): TabularDataSet[1]\n{\n simple::model::Firm.all()->project(\n [\n x: simple::model::Firm[1]|$x.ID,\n x: simple::model::Firm[1]|$x.legalName,\n x: simple::model::Firm[1]|$x.estDate,\n x: simple::model::Firm[1]|$x.mnc,\n x: simple::model::Firm[1]|$x.employeeCount,\n x: simple::model::Firm[1]|$x.lastUpdate\n ],\n [\n 'Id',\n 'Legal Name',\n 'Est Date',\n 'Mnc',\n 'Employee Count',\n 'Last Update'\n ]\n )\n}\n"},{"title":"Association - Embedded","documentation":"TODO: Some dummy description","development":true,"path":"Store/Relational Store/Mapping/association/embedded","code":""},{"title":"Querying Relational Store using Relation Functions","description":"Showcases Querying Relational Store using Typed Relation Functions both on a Modeled Store and directly on the Relational Store","documentation":"","path":"Store/Relational Store/Query","code":"###Service\nService showcase::northwind::service::model::GetCustomer\n{\n pattern: '/bed74c09-bef9-45dc-b7aa-95a9408d6c87';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle,\n contactName: x|$x.contactName,\n faxNumber: x|$x.faxNumber,\n id: x|$x.id,\n telephoneNumber: x|$x.telephoneNumber\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService {doc.doc = 'was trying to do -> distinct(~[companyTile]) but does not work'} showcase::northwind::service::model::GetCustomerDistinctTitle\n{\n pattern: '/bed74c09-bef9-45dc-b7aa-95a9408d6c87';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyTitle: x|$x.companyTitle\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService showcase::northwind::service::model::GetCustomerWithDrop\n{\n pattern: '/bed74c09-bef9-45dc-b7aa-95a9408d6c87';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle,\n contactName: x|$x.contactName,\n faxNumber: x|$x.faxNumber,\n id: x|$x.id,\n telephoneNumber: x|$x.telephoneNumber\n ]\n )->drop(1);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService showcase::northwind::service::model::GetCustomerWithLimit\n{\n pattern: '/bed74c09-bef9-45dc-b7aa-95a9408d6c87';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle,\n contactName: x|$x.contactName,\n faxNumber: x|$x.faxNumber,\n id: x|$x.id,\n telephoneNumber: x|$x.telephoneNumber\n ]\n )->limit(1);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService {doc.doc = 'Does not work -> route function'} showcase::northwind::service::model::ProductService\n{\n pattern: '/67591400-468d-4bb5-b875-f1fe2699d143';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::inventory::Product.all()->project(\n ~[\n quantityPerUnit: x|$x.quantityPerUnit,\n discontinued: x|$x.discontinued,\n id: x|$x.id,\n name: x|$x.name,\n reorderLevel: x|$x.reorderLevel,\n unitsInStock: x|$x.unitsInStock,\n unitsOnOrder: x|$x.unitsOnOrder\n ]\n )->filter(\n x|$x.unitsInStock > 1\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService showcase::northwind::service::model::CustomerExtend\n{\n pattern: '/fde94d89-b181-4fbe-b615-fc450772438f';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle\n ]\n )->extend(\n ~name: c|$c.companyName->toOne() + ' , title: ' + $c.companyTitle->toOne()->toString()\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService showcase::northwind::service::model::CustomerSelect\n{\n pattern: '/fde94d89-b181-4fbe-b615-fc450772438f';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle\n ]\n )->select(\n ~[\n companyName\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\n\n###Relational\nDatabase showcase::northwind::store::NorthwindDatabase\n(\n Schema NORTHWIND\n (\n Table CATEGORIES\n (\n CATEGORY_ID SMALLINT PRIMARY KEY,\n CATEGORY_NAME VARCHAR(15) NOT NULL,\n DESCRIPTION VARCHAR(256),\n PICTURE OTHER\n )\n Table CUSTOMERS\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24)\n )\n Table CUSTOMER_CUSTOMER_DEMO\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY\n )\n Table CUSTOMER_DEMOGRAPHICS\n (\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_DESC VARCHAR(256)\n )\n Table EMPLOYEES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n LAST_NAME VARCHAR(20) NOT NULL,\n FIRST_NAME VARCHAR(10) NOT NULL,\n TITLE VARCHAR(30),\n TITLE_OF_COURTESY VARCHAR(25),\n BIRTH_DATE DATE,\n HIRE_DATE DATE,\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n HOME_PHONE VARCHAR(24),\n EXTENSION VARCHAR(4),\n PHOTO OTHER,\n NOTES OTHER,\n REPORTS_TO SMALLINT,\n PHOTO_PATH VARCHAR(255)\n )\n Table EMPLOYEE_TERRITORIES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n TERRITORY_ID VARCHAR(20) PRIMARY KEY\n )\n Table ORDERS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n CUSTOMER_ID VARCHAR(5),\n EMPLOYEE_ID SMALLINT,\n ORDER_DATE DATE,\n REQUIRED_DATE DATE,\n SHIPPED_DATE DATE,\n SHIP_VIA SMALLINT,\n FREIGHT OTHER,\n SHIP_NAME VARCHAR(40),\n SHIP_ADDRESS VARCHAR(60),\n SHIP_CITY VARCHAR(15),\n SHIP_REGION VARCHAR(15),\n SHIP_POSTAL_CODE VARCHAR(10),\n SHIP_COUNTRY VARCHAR(15)\n )\n Table ORDER_DETAILS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n PRODUCT_ID SMALLINT PRIMARY KEY,\n UNIT_PRICE OTHER NOT NULL,\n QUANTITY SMALLINT NOT NULL,\n DISCOUNT OTHER NOT NULL\n )\n Table PRODUCTS\n (\n PRODUCT_ID SMALLINT PRIMARY KEY,\n PRODUCT_NAME VARCHAR(40) NOT NULL,\n SUPPLIER_ID SMALLINT,\n CATEGORY_ID SMALLINT,\n QUANTITY_PER_UNIT VARCHAR(20),\n UNIT_PRICE OTHER,\n UNITS_IN_STOCK SMALLINT,\n UNITS_ON_ORDER SMALLINT,\n REORDER_LEVEL SMALLINT,\n DISCONTINUED INTEGER NOT NULL\n )\n Table REGION\n (\n REGION_ID SMALLINT PRIMARY KEY,\n REGION_DESCRIPTION VARCHAR(60) NOT NULL\n )\n Table SHIPPERS\n (\n SHIPPER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n PHONE VARCHAR(24) NOT NULL\n )\n Table SUPPLIERS\n (\n SUPPLIER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24),\n HOMEPAGE VARCHAR(256)\n )\n Table TERRITORIES\n (\n TERRITORY_ID VARCHAR(20) PRIMARY KEY,\n TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,\n REGION_ID SMALLINT NOT NULL\n )\n Table US_STATES\n (\n STATE_ID SMALLINT PRIMARY KEY,\n STATE_NAME VARCHAR(100),\n STATE_ABBR VARCHAR(2),\n STATE_REGION VARCHAR(50)\n )\n )\n\n Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)\n Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)\n Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)\n Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)\n Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)\n Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)\n Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)\n Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)\n Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)\n Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)\n Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)\n Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)\n Join SUPPLIERS_REGION(NORTHWIND.SUPPLIERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join ORDERS_REGION(NORTHWIND.ORDERS.SHIP_REGION = NORTHWIND.REGION.REGION_ID)\n Join CUSTOMERS_REGION(NORTHWIND.CUSTOMERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_REGION(NORTHWIND.EMPLOYEES.REGION = NORTHWIND.REGION.REGION_ID)\n)\n\nDatabase showcase::simple::store::TestDatabase\n(\n Table TEST0\n (\n FIRSTNAME VARCHAR(200),\n LASTNAME VARCHAR(200)\n )\n)\n\n\n###Pure\nEnum showcase::northwind::model::crm::Title\n{\n Mr,\n Mrs,\n Miss,\n Ms,\n Dr,\n Sir,\n Professor,\n Duchess,\n Duke\n}\n\nClass showcase::northwind::model::inventory::Product\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n quantityPerUnit: String[0..1];\n unitsInStock: Integer[0..1];\n unitsOnOrder: Integer[0..1];\n reorderLevel: Integer[0..1];\n discontinued: Integer[1];\n}\n\nClass showcase::northwind::model::OrderLineItem\n{\n quantity: Integer[1];\n unitPrice: Float[1];\n unitPriceCurrency: String[1];\n}\n\nClass showcase::northwind::model::geography::Address\n{\n address: String[0..1];\n city: String[0..1];\n postalCode: String[0..1];\n region: String[0..1];\n country: String[0..1];\n}\n\nClass showcase::northwind::model::crm::Employee\n[\n dateOfBirthNotInTheFuture: $this.dateOfBirth <\n now(),\n dateOfBirthValid: $this.dateOfBirth > %1900-01-01,\n employeeIsOverEighteen: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) >= 18,\n employeeIsUnderEighty: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) < 80,\n notDateOfHireNotBeforeDateOfBirth: $this.dateOfHire >\n $this.dateOfBirth\n]\n{\n id: Integer[1];\n lastName: String[1];\n firstName: String[1];\n title: String[0..1];\n preferredTitle: showcase::northwind::model::crm::Title[0..1];\n dateOfBirth: StrictDate[0..1];\n dateOfHire: StrictDate[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n homeTelephoneNumber: String[0..1];\n extension: String[0..1];\n fullName() {if(\n $this.preferredTitle->isNotEmpty(),\n |$this.preferredTitle->toOne()->toString() + ' ',\n |if(\n $this.title->isNotEmpty(),\n |$this.title->toOne() + ' ',\n |''\n )\n) + $this.firstName + ' ' + $this.lastName}: String[1];\n}\n\nClass showcase::northwind::model::crm::CustomerDemographic\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesRegion\n[\n idNotNegative: $this.id >= 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: Integer[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::crm::Customer\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n companyName: String[1];\n contactName: String[0..1];\n companyTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n}\n\nClass showcase::northwind::model::Order\n{\n id: Integer[1];\n createdDate: StrictDate[0..1];\n requiredDate: StrictDate[0..1];\n shippedDate: StrictDate[0..1];\n shipToName: String[0..1];\n shipToAddress: showcase::northwind::model::geography::Address[0..1];\n itemCount() {$this.lineItems->count()}: Integer[1];\n}\n\nClass showcase::northwind::model::inventory::ProductCategory\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::inventory::Supplier\n{\n id: Integer[1];\n companyName: String[1];\n contactName: String[0..1];\n contactTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n homepageUrl: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesTerritory\n[\n idNotBlank: $this.id->length() > 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: String[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::geography::USState\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->isEmpty() ||\n ($this.name->toOne()->length() > 0)\n]\n{\n id: Integer[1];\n name: String[0..1];\n code: String[0..1];\n}\n\nClass showcase::northwind::model::crm::ShippingCompany\n[\n idNotNegative: $this.id >= 0,\n telephoneNumberFormatValid: $this.telephoneNumber->isEmpty() ||\n $this.telephoneNumber->toOne()->matches('(1-)?\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d')\n]\n{\n id: Integer[1];\n name: String[1];\n telephoneNumber: String[1];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Employees\n{\n employees: showcase::northwind::model::crm::Employee[*];\n territories: showcase::northwind::model::geography::SalesTerritory[*];\n}\n\nAssociation showcase::northwind::model::associations::Product_Suppliers\n{\n supplier: showcase::northwind::model::inventory::Supplier[1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Employee\n{\n orders: showcase::northwind::model::Order[*];\n employee: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Category\n{\n category: showcase::northwind::model::inventory::ProductCategory[0..1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Customer_CustomerDemographics\n{\n customers: showcase::northwind::model::crm::Customer[*];\n demographics: showcase::northwind::model::crm::CustomerDemographic[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Customer\n{\n orders: showcase::northwind::model::Order[*];\n customer: showcase::northwind::model::crm::Customer[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Shipper\n{\n orders: showcase::northwind::model::Order[*];\n shipper: showcase::northwind::model::crm::ShippingCompany[0..1];\n}\n\nAssociation showcase::northwind::model::associations::OrderLineItem_Product\n{\n orderLineItems: showcase::northwind::model::OrderLineItem[*];\n product: showcase::northwind::model::inventory::Product[1];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Region\n{\n region: showcase::northwind::model::geography::SalesRegion[1];\n territories: showcase::northwind::model::geography::SalesTerritory[1..*];\n}\n\nAssociation showcase::northwind::model::associations::Employee_Manager\n{\n reports: showcase::northwind::model::crm::Employee[*];\n manager: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_OrderLineItem\n{\n order: showcase::northwind::model::Order[1];\n lineItems: showcase::northwind::model::OrderLineItem[*];\n}\n\nfunction showcase::northwind::store::functions::SelectOnNorthWindCustomer(): Any[*]\n{\n #>{showcase::northwind::store::NorthwindDatabase.NORTHWIND.CUSTOMERS}#->select(\n ~[\n COMPANY_NAME\n ]\n )->from(\n showcase::northwind::store::NorthwindRuntime\n )\n}\n\nfunction showcase::northwind::store::functions::NorthwindDrop(): Any[*]\n{\n #>{showcase::northwind::store::NorthwindDatabase.NORTHWIND.CUSTOMERS}#->drop(10)->from(\n showcase::northwind::store::NorthwindRuntime\n )\n}\n\nfunction showcase::northwind::store::functions::NorthwindExtendd(): Any[*]\n{\n #>{showcase::northwind::store::NorthwindDatabase.NORTHWIND.CUSTOMERS}#->extend(\n ~newCol: x|$x.CONTACT_NAME->toOne() + ' |' + $x.CONTACT_TITLE->toOne()\n )->from(\n showcase::northwind::store::NorthwindRuntime\n )\n}\n\nfunction showcase::simple::functions::simpleFunctionSort(): Any[*]\n{\n #>{showcase::simple::store::TestDatabase.TEST0}#->filter(\n c|!($c.FIRSTNAME == 'Doe')\n )->from(\n showcase::simple::connection::TestRuntime\n )->sort(\n [\n ~FIRSTNAME->ascending()\n ]\n )\n}\n\nfunction showcase::simple::functions::simpleTableFunctionFilter(): Any[*]\n{\n #>{showcase::simple::store::TestDatabase.TEST0}#->filter(\n c|!($c.FIRSTNAME == 'Doe') &&\n !($c.LASTNAME == 'Doe')\n )->from(\n showcase::simple::connection::TestRuntime\n )->sort(\n [\n ~FIRSTNAME->ascending()\n ]\n )\n}\n\nfunction showcase::simple::functions::simpleTableFunctionGroup(): Any[*]\n{\n #>{showcase::simple::store::TestDatabase.TEST0}#->filter(\n c|!($c.FIRSTNAME == 'Doe')\n )->from(\n showcase::simple::connection::TestRuntime\n )->groupBy(\n ~[\n FIRSTNAME\n ],\n ~[\n count: x|$x.FIRSTNAME:y|$y->count()\n ]\n )\n}\n\nfunction showcase::simple::functions::simpleTableFunctionSlice(): Any[*]\n{\n #>{showcase::simple::store::TestDatabase.TEST0}#->filter(\n c|!($c.FIRSTNAME == 'Doe') &&\n !($c.LASTNAME == 'Doe')\n )->from(\n showcase::simple::connection::TestRuntime\n )\n}\n\n\n###Mapping\nMapping showcase::northwind::mapping::NorthwindMapping\n(\n showcase::northwind::model::inventory::ProductCategory[Category]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_NAME,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.DESCRIPTION\n }\n showcase::northwind::model::crm::Customer[Customer]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_NAME,\n companyTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.FAX\n }\n showcase::northwind::model::crm::Employee[Employee]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID,\n lastName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.LAST_NAME,\n firstName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.FIRST_NAME,\n title: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE,\n preferredTitle: EnumerationMapping TitleMapping: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE_OF_COURTESY,\n dateOfBirth: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.BIRTH_DATE,\n dateOfHire: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HIRE_DATE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.COUNTRY\n ),\n homeTelephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HOME_PHONE,\n extension: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EXTENSION\n }\n showcase::northwind::model::Order[Order]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID,\n createdDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_DATE,\n requiredDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.REQUIRED_DATE,\n shippedDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIPPED_DATE,\n shipToName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_NAME,\n shipToAddress\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_COUNTRY\n )\n }\n showcase::northwind::model::OrderLineItem[OrderLineItem]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.ORDER_ID,\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS\n quantity: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.QUANTITY,\n unitPrice: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.UNIT_PRICE,\n unitPriceCurrency: 'USD'\n }\n showcase::northwind::model::inventory::Product[Product]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_NAME,\n quantityPerUnit: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.QUANTITY_PER_UNIT,\n unitsInStock: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_IN_STOCK,\n unitsOnOrder: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_ON_ORDER,\n reorderLevel: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.REORDER_LEVEL,\n discontinued: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.DISCONTINUED\n }\n showcase::northwind::model::geography::SalesRegion[Region]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_DESCRIPTION\n }\n showcase::northwind::model::crm::ShippingCompany[Shipper]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.COMPANY_NAME,\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.PHONE\n }\n showcase::northwind::model::inventory::Supplier[Supplier]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_NAME,\n contactTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.FAX,\n homepageUrl: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.HOMEPAGE\n }\n showcase::northwind::model::geography::SalesTerritory[Territory]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_DESCRIPTION\n }\n showcase::northwind::model::geography::USState[USState]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_NAME,\n code: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ABBR\n }\n\n showcase::northwind::model::associations::Order_Customer: Relational\n {\n AssociationMapping\n (\n orders[Customer,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS,\n customer[Order,Customer]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS\n )\n }\n showcase::northwind::model::associations::Order_Employee: Relational\n {\n AssociationMapping\n (\n orders[Employee,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES,\n employee[Order,Employee]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES\n )\n }\n showcase::northwind::model::associations::Order_Shipper: Relational\n {\n AssociationMapping\n (\n orders[Shipper,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS,\n shipper[Order,Shipper]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS\n )\n }\n showcase::northwind::model::associations::Order_OrderLineItem: Relational\n {\n AssociationMapping\n (\n order[OrderLineItem,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS,\n lineItems[Order,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS\n )\n }\n showcase::northwind::model::associations::OrderLineItem_Product: Relational\n {\n AssociationMapping\n (\n orderLineItems[Product,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS,\n product[OrderLineItem,Product]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS\n )\n }\n showcase::northwind::model::associations::Product_Category: Relational\n {\n AssociationMapping\n (\n category[Product,Category]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES,\n products[Category,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES\n )\n }\n showcase::northwind::model::associations::Product_Suppliers: Relational\n {\n AssociationMapping\n (\n supplier[Product,Supplier]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS,\n products[Supplier,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS\n )\n }\n showcase::northwind::model::associations::Terriroties_Region: Relational\n {\n AssociationMapping\n (\n region[Territory,Region]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION,\n territories[Region,Territory]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION\n )\n }\n showcase::northwind::model::associations::Terriroties_Employees: Relational\n {\n AssociationMapping\n (\n employees[Territory,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES,\n territories[Employee,Territory]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES\n )\n }\n showcase::northwind::model::associations::Employee_Manager: Relational\n {\n AssociationMapping\n (\n reports[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS,\n manager[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS\n )\n }\n\n showcase::northwind::model::crm::Title: EnumerationMapping TitleMapping\n {\n Mr: ['Mr.'],\n Mrs: ['Mrs.'],\n Miss: ['Miss.'],\n Ms: ['Ms.'],\n Dr: ['Dr.'],\n Sir: ['Sir.'],\n Professor: ['Prof.'],\n Duchess: ['Duchess.'],\n Duke: ['Duke.']\n }\n)\n\n\n###Connection\nRelationalDatabaseConnection showcase::simple::connection::TestConnection\n{\n store: showcase::simple::store::TestDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n '\\nDrop table if exists TEST0;\\nCreate Table TEST0(FIRSTNAME VARCHAR(200), LASTNAME VARCHAR(200));\\nInsert into TEST0 (FIRSTNAME, LASTNAME) values (\\'John\\', \\'Doe\\');\\nInsert into TEST0 (FIRSTNAME, LASTNAME) values (\\'Tim\\', \\'Smith\\');\\nInsert into TEST0 (FIRSTNAME, LASTNAME) values (\\'Nicole\\', \\'Doe\\');\\n\\n'\n ];\n };\n auth: DefaultH2;\n}\n\nRelationalDatabaseConnection showcase::northwind::connection::NorthwindConnection\n{\n store: showcase::northwind::store::NorthwindDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'call loadNorthwindData()'\n ];\n };\n auth: DefaultH2;\n}\n\n\n###Runtime\nRuntime showcase::northwind::mapping::ModelNorthWindRuntime\n{\n mappings:\n [\n showcase::northwind::mapping::NorthwindMapping\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1: showcase::northwind::connection::NorthwindConnection\n ]\n ];\n}\n\nRuntime showcase::northwind::store::NorthwindRuntime\n{\n mappings:\n [\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1: showcase::northwind::connection::NorthwindConnection\n ]\n ];\n}\n\nRuntime showcase::simple::connection::TestRuntime\n{\n mappings:\n [\n ];\n connections:\n [\n showcase::simple::store::TestDatabase:\n [\n connection: showcase::simple::connection::TestConnection\n ]\n ];\n}\n"},{"title":"Relational Service - Querying Product Northwind Data","description":"Example of Relational Service querying northwind test data with Mapping and Service Tests","documentation":"The connection used here loads sample data from [northwind](https://github.com/pthom/northwind_psql). It includes a sample service querying products. Additionally it includes services and mapping tests. Some of the services include [post validations](https://github.com/finos/legend-engine/blob/master/docs/data-quality/service-post-validations.md) for better data quality.","path":"Store/Relational Store/Service/Basic","code":"###Diagram\nDiagram showcase::northwind::model::NorthwindModelDiagram\n{\n classView 8947a897-a67d-4064-8770-8a440e1220ce\n {\n class: showcase::northwind::model::crm::Employee;\n position: (401.1871744777152,580.7157363134539);\n rectangle: (211.03332710266113,212.0);\n }\n classView d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2\n {\n class: showcase::northwind::model::geography::Address;\n position: (428.11321850038996,365.8790985977993);\n rectangle: (145.85000038146973,114.0);\n }\n classView fd4a376f-11c2-4f8b-9e76-19079a06cc0b\n {\n class: showcase::northwind::model::Order;\n position: (89.66931137749526,364.84316585774513);\n rectangle: (174.01666831970215,114.0);\n }\n classView 51d867fc-1dce-4979-9120-d10a551e23a7\n {\n class: showcase::northwind::model::crm::ShippingCompany;\n position: (-240.98019847552794,379.4990577970102);\n rectangle: (179.4666690826416,86.0);\n }\n classView 4251c20c-4779-4c21-9b9c-900caf75fcc6\n {\n class: showcase::northwind::model::inventory::Product;\n position: (421.60610674363886,-69.9030438054377);\n rectangle: (167.85000038146973,128.0);\n }\n classView 2a461b5d-77dd-43e1-a33f-0759d84b8667\n {\n class: showcase::northwind::model::OrderLineItem;\n position: (92.87799226709058,-43.093765410358316);\n rectangle: (169.10000133514404,86.0);\n }\n classView 8217f514-1928-48bc-b8de-386ca506c1f9\n {\n class: showcase::northwind::model::geography::SalesTerritory;\n position: (806.4847354152803,653.513841427653);\n rectangle: (141.58333110809326,72.0);\n }\n classView 37cda7f9-22dc-4e75-ad3a-a5599d88772a\n {\n class: showcase::northwind::model::inventory::ProductCategory;\n position: (786.770946360032,-49.13039766561275);\n rectangle: (175.1082781744508,86.0);\n }\n classView 09710ba2-c255-4222-a85d-50520d5eae95\n {\n class: showcase::northwind::model::inventory::Supplier;\n position: (768.5537612977755,206.91393580644078);\n rectangle: (179.4666690826416,142.0);\n }\n classView df47922a-2b8a-4b12-b835-d7c75a694670\n {\n class: showcase::northwind::model::crm::Customer;\n position: (382.36050099956327,131.63043674809185);\n rectangle: (236.94999885559082,128.0);\n }\n classView 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1\n {\n class: showcase::northwind::model::geography::SalesRegion;\n position: (806.4847354152804,492.60599452399185);\n rectangle: (133.0166654586792,58.0);\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Customer.address;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(500.8355004273587,195.63043674809185),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.shipper;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 51d867fc-1dce-4979-9120-d10a551e23a7;\n points: [(176.67764553734634,421.84316585774513),(-151.24686393420714,422.4990577970102)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.orders;\n source: 51d867fc-1dce-4979-9120-d10a551e23a7;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(-151.24686393420714,422.4990577970102),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.lineItems;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(176.67764553734634,421.84316585774513),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.order;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(177.4279929346626,-0.09376541035831565),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::Order.shipToAddress;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(176.67764553734634,421.84316585774513),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.customer;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: df47922a-2b8a-4b12-b835-d7c75a694670;\n points: [(176.67764553734634,421.84316585774513),(500.8355004273587,195.63043674809185)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.orders;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(500.8355004273587,195.63043674809185),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::inventory::Supplier.address;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(858.2870958390963,277.9139358064408),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.orders;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(506.70383802904576,686.7157363134539),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.employee;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(176.67764553734634,421.84316585774513),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Employee.address;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(506.70383802904576,686.7157363134539),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.category;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n points: [(505.5311069343737,-5.903043805437704),(874.3250854472574,-6.1303976656127475)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.products;\n source: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(874.3250854472574,-6.1303976656127475),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.orderLineItems;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(505.5311069343737,-5.903043805437704),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.product;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(177.4279929346626,-0.09376541035831565),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.supplier;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 09710ba2-c255-4222-a85d-50520d5eae95;\n points: [(505.5311069343737,-5.903043805437704),(858.2870958390963,277.9139358064408)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.products;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(858.2870958390963,277.9139358064408),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.employees;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(877.2764009693269,689.513841427653),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.territories;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(506.70383802904576,686.7157363134539),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.territories;\n source: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(872.99306814462,521.6059945239919),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.region;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n points: [(877.2764009693269,689.513841427653),(872.99306814462,521.6059945239919)];\n }\n}\n\n\n###DataSpace\nDataSpace showcase::northwind::dataspace::NorthwindDataSpace\n{\n executionContexts:\n [\n {\n name: 'externally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'externally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n }\n ];\n defaultExecutionContext: 'externally-public-PROD';\n}\n\nDataSpace showcase::northwind::dataspace::NorthwindDataSpaceWithTemplateQuery\n{\n executionContexts:\n [\n {\n name: 'externally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'externally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n }\n ];\n defaultExecutionContext: 'externally-public-PROD';\n executables:\n [\n {\n id: my_id;\n title: 'this is title - Top Categories';\n description: 'this is description - TopCategories';\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n executionContextKey: 'externally-public-PROD';\n }\n ];\n}\n\n\n###Service\nService showcase::northwind::services::graph::OrderDetailsByIdGraphFetch\n{\n pattern: '/orderDetailsByIdGraphFetch/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: id: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $id\n )->graphFetch(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::TopCategories\n{\n pattern: '/topCategories';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::OrderDetailsByIdTDS\n{\n pattern: '/orderDetailsByIdTDS/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: orderId: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $orderId\n )->project(\n [\n x: showcase::northwind::model::Order[1]|$x.id,\n x: showcase::northwind::model::Order[1]|$x.customer.companyName,\n x: showcase::northwind::model::Order[1]|$x.employee.firstName,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.quantity,\n x: showcase::northwind::model::Order[1]|$x.shipper.name\n ],\n [\n 'Order Id',\n 'Customer/Company Name',\n 'Employee/First Name',\n 'Order Line Items/Product/Product Name',\n 'Order Line Items/Product/Category/Category Name',\n 'Order Line Items/Quantity',\n 'Shipper/Company Name'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'a simple passing validation with static parameter';\n params:[\n |10248\n ];\n assertions:[\n rowCountGreaterThan10: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Employee/First Name')->startsWith('T')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected no Employee/First Name to begin with the letter T')\n ];\n }\n ]\n}\n\nService showcase::northwind::services::tds::ProductRankingWithinCategory\n{\n pattern: '/productRankingWithinCategory';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::inventory::ProductCategory.all()->groupBy(\n [\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.name,\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.name\n ],\n [\n agg(\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.orderLineItems.order.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Name',\n 'Products/Product Name',\n 'OrderCount'\n ]\n )->olapGroupBy(\n ['Category Name'],\n desc('OrderCount'),\n x: meta::pure::tds::TDSRow[*]|$x->rank(),\n 'Rank Within Category'\n )->sort(\n [\n asc('Category Name'),\n asc('Rank Within Category')\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::Customers\n{\n pattern: '/customers';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n [\n x: showcase::northwind::model::crm::Customer[1]|$x.id,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyName,\n x: showcase::northwind::model::crm::Customer[1]|$x.contactName,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyTitle,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.country,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.address,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.city,\n x: showcase::northwind::model::crm::Customer[1]|$x.telephoneNumber\n ],\n [\n 'Customer Id',\n 'Company Name',\n 'Contact Name',\n 'Company Title',\n 'Country',\n 'Address',\n 'City',\n 'Phone'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'A simple passing validation';\n params:[\n\n ];\n assertions:[\n noCompanyNamedAroundtheHorn: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Company Name')->contains('Around the Hornsss')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected there is no company named Around the Hornsss')\n ];\n }\n ]\n}\n\nService showcase::northwind::services::graph::ShipperValidationDefects\n{\n pattern: '/shipperValidationDefects';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::ShippingCompany.all()->graphFetchChecked(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\n\n###Relational\nDatabase showcase::northwind::store::NorthwindDatabase\n(\n Schema NORTHWIND\n (\n Table CATEGORIES\n (\n CATEGORY_ID SMALLINT PRIMARY KEY,\n CATEGORY_NAME VARCHAR(15) NOT NULL,\n DESCRIPTION VARCHAR(256),\n PICTURE OTHER\n )\n Table CUSTOMERS\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24)\n )\n Table CUSTOMER_CUSTOMER_DEMO\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY\n )\n Table CUSTOMER_DEMOGRAPHICS\n (\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_DESC VARCHAR(256)\n )\n Table EMPLOYEES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n LAST_NAME VARCHAR(20) NOT NULL,\n FIRST_NAME VARCHAR(10) NOT NULL,\n TITLE VARCHAR(30),\n TITLE_OF_COURTESY VARCHAR(25),\n BIRTH_DATE DATE,\n HIRE_DATE DATE,\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n HOME_PHONE VARCHAR(24),\n EXTENSION VARCHAR(4),\n PHOTO OTHER,\n NOTES OTHER,\n REPORTS_TO SMALLINT,\n PHOTO_PATH VARCHAR(255)\n )\n Table EMPLOYEE_TERRITORIES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n TERRITORY_ID VARCHAR(20) PRIMARY KEY\n )\n Table ORDERS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n CUSTOMER_ID VARCHAR(5),\n EMPLOYEE_ID SMALLINT,\n ORDER_DATE DATE,\n REQUIRED_DATE DATE,\n SHIPPED_DATE DATE,\n SHIP_VIA SMALLINT,\n FREIGHT OTHER,\n SHIP_NAME VARCHAR(40),\n SHIP_ADDRESS VARCHAR(60),\n SHIP_CITY VARCHAR(15),\n SHIP_REGION VARCHAR(15),\n SHIP_POSTAL_CODE VARCHAR(10),\n SHIP_COUNTRY VARCHAR(15)\n )\n Table ORDER_DETAILS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n PRODUCT_ID SMALLINT PRIMARY KEY,\n UNIT_PRICE OTHER NOT NULL,\n QUANTITY SMALLINT NOT NULL,\n DISCOUNT OTHER NOT NULL\n )\n Table PRODUCTS\n (\n PRODUCT_ID SMALLINT PRIMARY KEY,\n PRODUCT_NAME VARCHAR(40) NOT NULL,\n SUPPLIER_ID SMALLINT,\n CATEGORY_ID SMALLINT,\n QUANTITY_PER_UNIT VARCHAR(20),\n UNIT_PRICE OTHER,\n UNITS_IN_STOCK SMALLINT,\n UNITS_ON_ORDER SMALLINT,\n REORDER_LEVEL SMALLINT,\n DISCONTINUED INTEGER NOT NULL\n )\n Table REGION\n (\n REGION_ID SMALLINT PRIMARY KEY,\n REGION_DESCRIPTION VARCHAR(60) NOT NULL\n )\n Table SHIPPERS\n (\n SHIPPER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n PHONE VARCHAR(24) NOT NULL\n )\n Table SUPPLIERS\n (\n SUPPLIER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24),\n HOMEPAGE VARCHAR(256)\n )\n Table TERRITORIES\n (\n TERRITORY_ID VARCHAR(20) PRIMARY KEY,\n TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,\n REGION_ID SMALLINT NOT NULL\n )\n Table US_STATES\n (\n STATE_ID SMALLINT PRIMARY KEY,\n STATE_NAME VARCHAR(100),\n STATE_ABBR VARCHAR(2),\n STATE_REGION VARCHAR(50)\n )\n )\n\n Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)\n Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)\n Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)\n Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)\n Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)\n Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)\n Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)\n Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)\n Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)\n Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)\n Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)\n Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)\n Join SUPPLIERS_REGION(NORTHWIND.SUPPLIERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join ORDERS_REGION(NORTHWIND.ORDERS.SHIP_REGION = NORTHWIND.REGION.REGION_ID)\n Join CUSTOMERS_REGION(NORTHWIND.CUSTOMERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_REGION(NORTHWIND.EMPLOYEES.REGION = NORTHWIND.REGION.REGION_ID)\n)\n\n\n###Pure\nEnum showcase::northwind::model::crm::Title\n{\n Mr,\n Mrs,\n Miss,\n Ms,\n Dr,\n Sir,\n Professor,\n Duchess,\n Duke\n}\n\nClass showcase::northwind::model::geography::Address\n{\n address: String[0..1];\n city: String[0..1];\n postalCode: String[0..1];\n region: String[0..1];\n country: String[0..1];\n}\n\nClass showcase::northwind::model::crm::Employee\n[\n dateOfBirthNotInTheFuture: $this.dateOfBirth <\n now(),\n dateOfBirthValid: $this.dateOfBirth > %1900-01-01,\n employeeIsOverEighteen: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) >= 18,\n employeeIsUnderEighty: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) < 80,\n notDateOfHireNotBeforeDateOfBirth: $this.dateOfHire >\n $this.dateOfBirth\n]\n{\n id: Integer[1];\n lastName: String[1];\n firstName: String[1];\n title: String[0..1];\n preferredTitle: showcase::northwind::model::crm::Title[0..1];\n dateOfBirth: StrictDate[0..1];\n dateOfHire: StrictDate[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n homeTelephoneNumber: String[0..1];\n extension: String[0..1];\n fullName() {if(\n $this.preferredTitle->isNotEmpty(),\n |$this.preferredTitle->toOne()->toString() + ' ',\n |if(\n $this.title->isNotEmpty(),\n |$this.title->toOne() + ' ',\n |''\n )\n) + $this.firstName + ' ' + $this.lastName}: String[1];\n}\n\nClass showcase::northwind::model::geography::USState\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->isEmpty() ||\n ($this.name->toOne()->length() > 0)\n]\n{\n id: Integer[1];\n name: String[0..1];\n code: String[0..1];\n}\n\nClass showcase::northwind::model::OrderLineItem\n{\n quantity: Integer[1];\n unitPrice: Float[1];\n unitPriceCurrency: String[1];\n}\n\nClass showcase::northwind::model::inventory::ProductCategory\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::Order\n{\n id: Integer[1];\n createdDate: StrictDate[0..1];\n requiredDate: StrictDate[0..1];\n shippedDate: StrictDate[0..1];\n shipToName: String[0..1];\n shipToAddress: showcase::northwind::model::geography::Address[0..1];\n itemCount() {$this.lineItems->count()}: Integer[1];\n}\n\nClass showcase::northwind::model::geography::SalesRegion\n[\n idNotNegative: $this.id >= 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: Integer[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::crm::Customer\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n companyName: String[1];\n contactName: String[0..1];\n companyTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n}\n\nClass showcase::northwind::model::crm::CustomerDemographic\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesTerritory\n[\n idNotBlank: $this.id->length() > 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: String[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::crm::ShippingCompany\n[\n idNotNegative: $this.id >= 0,\n telephoneNumberFormatValid: $this.telephoneNumber->isEmpty() ||\n $this.telephoneNumber->toOne()->matches('(1-)?\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d')\n]\n{\n id: Integer[1];\n name: String[1];\n telephoneNumber: String[1];\n}\n\nClass showcase::northwind::model::inventory::Product\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n quantityPerUnit: String[0..1];\n unitsInStock: Integer[0..1];\n unitsOnOrder: Integer[0..1];\n reorderLevel: Integer[0..1];\n discontinued: Integer[1];\n}\n\nClass showcase::northwind::model::inventory::Supplier\n{\n id: Integer[1];\n companyName: String[1];\n contactName: String[0..1];\n contactTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n homepageUrl: String[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Employee\n{\n orders: showcase::northwind::model::Order[*];\n employee: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Shipper\n{\n orders: showcase::northwind::model::Order[*];\n shipper: showcase::northwind::model::crm::ShippingCompany[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_OrderLineItem\n{\n order: showcase::northwind::model::Order[1];\n lineItems: showcase::northwind::model::OrderLineItem[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Customer\n{\n orders: showcase::northwind::model::Order[*];\n customer: showcase::northwind::model::crm::Customer[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Category\n{\n category: showcase::northwind::model::inventory::ProductCategory[0..1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Region\n{\n region: showcase::northwind::model::geography::SalesRegion[1];\n territories: showcase::northwind::model::geography::SalesTerritory[1..*];\n}\n\nAssociation showcase::northwind::model::associations::Customer_CustomerDemographics\n{\n customers: showcase::northwind::model::crm::Customer[*];\n demographics: showcase::northwind::model::crm::CustomerDemographic[*];\n}\n\nAssociation showcase::northwind::model::associations::Employee_Manager\n{\n reports: showcase::northwind::model::crm::Employee[*];\n manager: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Suppliers\n{\n supplier: showcase::northwind::model::inventory::Supplier[1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Employees\n{\n employees: showcase::northwind::model::crm::Employee[*];\n territories: showcase::northwind::model::geography::SalesTerritory[*];\n}\n\nAssociation showcase::northwind::model::associations::OrderLineItem_Product\n{\n orderLineItems: showcase::northwind::model::OrderLineItem[*];\n product: showcase::northwind::model::inventory::Product[1];\n}\n\n\n###Mapping\nMapping showcase::northwind::mapping::NorthwindMapping\n(\n showcase::northwind::model::inventory::ProductCategory[Category]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_NAME,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.DESCRIPTION\n }\n showcase::northwind::model::crm::Customer[Customer]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_NAME,\n companyTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.FAX\n }\n showcase::northwind::model::crm::Employee[Employee]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID,\n lastName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.LAST_NAME,\n firstName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.FIRST_NAME,\n title: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE,\n preferredTitle: EnumerationMapping TitleMapping: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE_OF_COURTESY,\n dateOfBirth: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.BIRTH_DATE,\n dateOfHire: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HIRE_DATE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.COUNTRY\n ),\n homeTelephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HOME_PHONE,\n extension: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EXTENSION\n }\n showcase::northwind::model::Order[Order]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID,\n createdDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_DATE,\n requiredDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.REQUIRED_DATE,\n shippedDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIPPED_DATE,\n shipToName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_NAME,\n shipToAddress\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_COUNTRY\n )\n }\n showcase::northwind::model::OrderLineItem[OrderLineItem]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.ORDER_ID,\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS\n quantity: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.QUANTITY,\n unitPrice: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.UNIT_PRICE,\n unitPriceCurrency: 'USD'\n }\n showcase::northwind::model::inventory::Product[Product]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_NAME,\n quantityPerUnit: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.QUANTITY_PER_UNIT,\n unitsInStock: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_IN_STOCK,\n unitsOnOrder: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_ON_ORDER,\n reorderLevel: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.REORDER_LEVEL,\n discontinued: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.DISCONTINUED\n }\n showcase::northwind::model::geography::SalesRegion[Region]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_DESCRIPTION\n }\n showcase::northwind::model::crm::ShippingCompany[Shipper]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.COMPANY_NAME,\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.PHONE\n }\n showcase::northwind::model::inventory::Supplier[Supplier]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_NAME,\n contactTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.FAX,\n homepageUrl: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.HOMEPAGE\n }\n showcase::northwind::model::geography::SalesTerritory[Territory]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_DESCRIPTION\n }\n showcase::northwind::model::geography::USState[USState]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_NAME,\n code: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ABBR\n }\n\n showcase::northwind::model::associations::Order_Customer: Relational\n {\n AssociationMapping\n (\n orders[Customer,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS,\n customer[Order,Customer]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS\n )\n }\n showcase::northwind::model::associations::Order_Employee: Relational\n {\n AssociationMapping\n (\n orders[Employee,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES,\n employee[Order,Employee]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES\n )\n }\n showcase::northwind::model::associations::Order_Shipper: Relational\n {\n AssociationMapping\n (\n orders[Shipper,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS,\n shipper[Order,Shipper]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS\n )\n }\n showcase::northwind::model::associations::Order_OrderLineItem: Relational\n {\n AssociationMapping\n (\n order[OrderLineItem,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS,\n lineItems[Order,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS\n )\n }\n showcase::northwind::model::associations::OrderLineItem_Product: Relational\n {\n AssociationMapping\n (\n orderLineItems[Product,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS,\n product[OrderLineItem,Product]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS\n )\n }\n showcase::northwind::model::associations::Product_Category: Relational\n {\n AssociationMapping\n (\n category[Product,Category]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES,\n products[Category,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES\n )\n }\n showcase::northwind::model::associations::Product_Suppliers: Relational\n {\n AssociationMapping\n (\n supplier[Product,Supplier]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS,\n products[Supplier,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS\n )\n }\n showcase::northwind::model::associations::Terriroties_Region: Relational\n {\n AssociationMapping\n (\n region[Territory,Region]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION,\n territories[Region,Territory]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION\n )\n }\n showcase::northwind::model::associations::Terriroties_Employees: Relational\n {\n AssociationMapping\n (\n employees[Territory,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES,\n territories[Employee,Territory]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES\n )\n }\n showcase::northwind::model::associations::Employee_Manager: Relational\n {\n AssociationMapping\n (\n reports[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS,\n manager[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS\n )\n }\n\n showcase::northwind::model::crm::Title: EnumerationMapping TitleMapping\n {\n Mr: ['Mr.'],\n Mrs: ['Mrs.'],\n Miss: ['Miss.'],\n Ms: ['Ms.'],\n Dr: ['Dr.'],\n Sir: ['Sir.'],\n Professor: ['Prof.'],\n Duchess: ['Duchess.'],\n Duke: ['Duke.']\n }\n)\n\n\n###Runtime\nRuntime showcase::northwind::runtime::NorthwindRuntime\n{\n mappings:\n [\n showcase::northwind::mapping::NorthwindMapping\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1:\n #{\n RelationalDatabaseConnection\n {\n store: showcase::northwind::store::NorthwindDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'call loadNorthwindData()'\n ];\n };\n auth: DefaultH2;\n }\n }#\n ]\n ];\n}\n"},{"title":"Service Store Connection","documentation":"Service Store connection is linked to External Formats.","development":true,"path":"Store/Service Store/Connection","code":""},{"title":"Service Store Mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Service Store/Mapping","code":""},{"title":"Service Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Service Store/Store","code":""}] \ No newline at end of file +[{"title":"Build a Relational service","documentation":"TODO: Some dummy description","development":true,"path":"End To End Examples/Build a relational service","code":""},{"title":"Build an M2M hosted service","documentation":"TODO: Some dummy description","development":true,"path":"End To End Examples/Build an M2M hosted service","code":""},{"title":"Integrate Mappings","description":"How to integrate your mapping with another group's model without tying yourself to their underlying physical implementation or specific mapping.","documentation":"In this example, the producer of the LegalEntityMapping has released a mapping of LegalEntity. The consumers have created their own mapping (TradeMapping) which they would like to join against the producer mapping for legal entity.\n\nIn order to prevent unnecessarily tying their model to the implementation details of the producer's mapping, they include the producer's dataspace in TradeMapping. Including a dataspace, rather than a mapping, creates a layer of abstraction that protects both parties from unnecessary difficulty when a producer needs to migrate users onto a new mapping. Instead, the dataspace's underlying default mapping is always included behind-the-scenes by the compiler.\n\nThe consumer then defines a XStore Association between their trade class and the default class mapping ID of the Legal Entity class (com_entity_LegalEntity), which is derived from the package address of the target class. This cross store join allows the consumer to tie their mapping to the target class without explicitly defining the SQL joins occurring behind the scenes. The TradeDB and EntityDB can exist independently as packageable elements without hard-coded dependencies on one another.\n\nThe consumer then defines the locality of the stores within the runtime, by co-locating them underneath the same connection. With this language, the compiler can immediately understand whether to treat the XStore Associations between mappings as truly Cross-Store or Local. If a consumer's runtime only has a single connection, they can leverage a SingleConnectionRuntime to inform the platform that all stores underneath the listed mappings of this runtime are co-located.\n\nFinally, when setting up their service or function, the consumer can leverage the test data provided by the producers in their dataspace. For a service, the consumer can place the data underneath the appropriate connection. For a function, the consumer will need to list it underneath the dataspace reference with the displayed syntax. Similar to other functionality, this level of abstraction keeps the consumer from tying their code to the implementation details of the producer store.","path":"End To End Examples/Integrate Mappings","code":"###Data\nData com::entity::EntityData\n{\n Relational\n #{\n Entity.LegalEntity:\n 'ENTITY_ID,name\\n'+\n 'abc,Entity1\\n'+\n 'def,Entity2\\n';\n }#\n}\n\n\n###Relational\nDatabase com::trade::TradeDatabase\n(\n Schema Trade\n (\n Table Trade\n (\n id VARCHAR(32) PRIMARY KEY,\n value INTEGER NOT NULL,\n ENTITY_ID_FK VARCHAR(32) NOT NULL\n )\n )\n)\n\nDatabase com::entity::EntityDatabase\n(\n Schema Entity\n (\n Table LegalEntity\n (\n ENTITY_ID VARCHAR(32) PRIMARY KEY,\n name VARCHAR(32) NOT NULL\n )\n\n View LegalEntity_View\n (\n ENTITY_ID: Entity.LegalEntity.ENTITY_ID PRIMARY KEY,\n name: Entity.LegalEntity.name PRIMARY KEY\n )\n )\n)\n\n\n###Service\nService com::trade::ServiceSimpleProject\n{\n pattern: '/trade/simpleJoinProjectService';\n owners:\n [\n 'user1',\n 'user2'\n ];\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |com::trade::Trade.all()->project(\n [\n x: com::trade::Trade[1]|$x.value,\n x: com::trade::Trade[1]|$x.client.name\n ],\n [\n 'Value',\n 'Client/Name'\n ]\n );\n mapping: com::trade::TradeWithLegalEntityMapping;\n runtime: com::trade::AlternativeTradeRuntime;\n }\n testSuites:\n [\n testSuite_1:\n {\n data:\n [\n connections:\n [\n com::trade::TradeConnection:\n Relational\n #{\n Trade.Trade:\n 'id,value,ENTITY_ID_FK\\n'+\n '1,100,abc\\n'+\n '2,200,def\\n';\n }#,\n com::trade::TradeConnection:\n DataspaceTestData\n #{\n com::entity::EntityDataSpace\n }#\n ]\n ]\n tests:\n [\n test_1:\n {\n serializationFormat: PURE_TDSOBJECT;\n asserts:\n [\n assertion_1:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '[ {\\n \"Value\" : 100,\\n \"Client/Name\" : \"Entity1\"\\n}, {\\n \"Value\" : 200,\\n \"Client/Name\" : \"Entity2\"\\n} ]';\n }#;\n }#\n ]\n }\n ]\n }\n ]\n}\n\n\n###DataSpace\nDataSpace com::entity::EntityDataSpace\n{\n executionContexts:\n [\n {\n name: 'default';\n mapping: com::entity::LegalEntityMapping;\n defaultRuntime: com::entity::EntityRuntime;\n testData:\n Reference\n #{\n com::entity::EntityData\n }#;\n }\n ];\n defaultExecutionContext: 'default';\n}\n\n\n###Pure\nClass com::entity::LegalEntity\n{\n entityId: String[1];\n name: String[1];\n}\n\nClass com::trade::Trade\n{\n id: String[1];\n value: Integer[1];\n}\n\nAssociation com::trade::Trade_LegalEntity\n{\n client: com::entity::LegalEntity[1];\n trades: com::trade::Trade[*];\n}\n\n\n###Mapping\nMapping com::entity::LegalEntityMapping\n(\n *com::entity::LegalEntity: Relational\n {\n ~primaryKey\n (\n [com::entity::EntityDatabase]Entity.LegalEntity_View.ENTITY_ID\n )\n ~mainTable [com::entity::EntityDatabase]Entity.LegalEntity_View\n entityId: [com::entity::EntityDatabase]Entity.LegalEntity_View.ENTITY_ID,\n name: [com::entity::EntityDatabase]Entity.LegalEntity_View.name\n }\n)\n\nMapping com::trade::TradeWithLegalEntityMapping\n(\n include dataspace com::entity::EntityDataSpace\n\n com::trade::Trade[trade]: Relational\n {\n ~primaryKey\n (\n [com::trade::TradeDatabase]Trade.Trade.id\n )\n ~mainTable [com::trade::TradeDatabase]Trade.Trade\n id: [com::trade::TradeDatabase]Trade.Trade.id,\n value: [com::trade::TradeDatabase]Trade.Trade.value,\n +entityIdFk: String[1]: [com::trade::TradeDatabase]Trade.Trade.ENTITY_ID_FK\n }\n\n com::trade::Trade_LegalEntity: XStore\n {\n client[trade, com_entity_LegalEntity]: $this.entityIdFk ==\n $that.entityId,\n trades[com_entity_LegalEntity, trade]: $this.entityId ==\n $that.entityIdFk\n }\n)\n\n\n###Connection\nRelationalDatabaseConnection com::entity::EntityConnection\n{\n store: com::entity::EntityDatabase;\n type: H2;\n specification: LocalH2\n {\n };\n auth: DefaultH2;\n}\n\nRelationalDatabaseConnection com::trade::TradeConnection\n{\n store: com::trade::TradeDatabase;\n type: H2;\n specification: LocalH2\n {\n };\n auth: DefaultH2;\n}\n\n\n###Runtime\nRuntime com::entity::EntityRuntime\n{\n mappings:\n [\n com::entity::LegalEntityMapping\n ];\n connectionStores:\n [\n com::entity::EntityConnection:\n [\n com::entity::EntityDatabase\n ]\n ];\n}\n\nRuntime com::trade::TradeRuntime\n{\n mappings:\n [\n com::trade::TradeWithLegalEntityMapping\n ];\n connectionStores:\n [\n com::trade::TradeConnection:\n [\n com::trade::TradeDatabase,\n com::entity::EntityDatabase\n ]\n ];\n}\n\nSingleConnectionRuntime com::trade::AlternativeTradeRuntime\n{\n mappings:\n [\n com::trade::TradeWithLegalEntityMapping\n ];\n connection: com::trade::TradeConnection;\n}\n"},{"title":"Avro Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Avro/Binding","code":""},{"title":"Avro Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Avro/Externalize","code":""},{"title":"Avro Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Avro/Internalize","code":""},{"title":"CSV Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Flat Data/CSV/Binding","code":""},{"title":"CSV Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Flat Data/CSV/Externalize","code":""},{"title":"CSV Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Flat Data/CSV/Internalize","code":""},{"title":"JSON Schema Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/JSONSchema/Binding","code":""},{"title":"JSON Schema Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/JSONSchema/Externalize","code":""},{"title":"JSON Schema Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/JSONSchema/Internalize","code":""},{"title":"Protobuf Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Protobuf/Binding","code":""},{"title":"Protobuf Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Protobuf/Externalize","code":""},{"title":"Protobuf Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/Protobuf/Internalize","code":""},{"title":"XML Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XML/Binding","code":""},{"title":"XML Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XML/Externalize","code":""},{"title":"XML Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XML/Internalize","code":""},{"title":"XStore Avro Binding","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XStore Avro/Binding","code":""},{"title":"XStore Avro Externalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XStore Avro/Externalize","code":""},{"title":"XStore Avro Internalize","documentation":"TODO: Some dummy description","development":true,"path":"External Format/XStore Avro/Internalize","code":""},{"title":"Graph QL file generation","documentation":"TODO: Some dummy description","development":true,"path":"Generation/Generate files/GraphQL","code":""},{"title":"Jave file generation","documentation":"TODO: Some dummy description","development":true,"path":"Generation/Generate files/Java","code":""},{"title":"Python file generation","documentation":"TODO: Some dummy description","development":true,"path":"Generation/Generate files/Python","code":""},{"title":"Slang file generation","documentation":"TODO: Some dummy description","development":true,"path":"Generation/Generate files/Slang","code":""},{"title":"Big Query activator","documentation":"TODO: Some dummy description","development":true,"path":"Lambda/Activator - Big Query","code":""},{"title":"Hosted service activator","documentation":"TODO: Some dummy description","development":true,"path":"Lambda/Activator - Hosted service","code":""},{"title":"Activator - Service Jar","documentation":"Service execution Jar showcase.","path":"Lambda/Activator - Service Jar","code":"###Diagram\nDiagram diagram::all\n{\n classView 0dee659c-6d6d-41d0-a326-dd0e63250732\n {\n class: domain::Firm;\n position: (639.0,202.0);\n rectangle: (134.32373046875,58.0);\n }\n classView 860aafab-2ae2-4714-8f4e-7d8924c6cec8\n {\n class: domain::Person;\n position: (644.0,327.0);\n rectangle: (124.521484375,58.0);\n }\n propertyView\n {\n property: domain::Person.firm;\n source: 860aafab-2ae2-4714-8f4e-7d8924c6cec8;\n target: 0dee659c-6d6d-41d0-a326-dd0e63250732;\n points: [(706.2607421875,356.0),(706.161865234375,231.0)];\n }\n propertyView\n {\n property: domain::Firm.employees;\n source: 0dee659c-6d6d-41d0-a326-dd0e63250732;\n target: 860aafab-2ae2-4714-8f4e-7d8924c6cec8;\n points: [(706.161865234375,231.0),(706.2607421875,356.0)];\n }\n}\n\n\n###Relational\nDatabase database::h2\n(\n Table PERSON\n (\n ID INTEGER PRIMARY KEY,\n FIRMID INTEGER,\n FIRST_NAME VARCHAR(200),\n LAST_NAME VARCHAR(200)\n )\n Table FIRM\n (\n ID INTEGER PRIMARY KEY,\n LEGAL_NAME VARCHAR(200)\n )\n\n Join Firm_Person(PERSON.FIRMID = FIRM.ID)\n)\n\n\n###Pure\nClass domain::Person\n{\n firstName: String[1];\n lastName: String[1];\n}\n\nClass domain::S_Person\n{\n fullName: String[1];\n}\n\nClass domain::Firm\n{\n legalName: String[1];\n}\n\nClass domain::S_Firm\n{\n legalName: String[1];\n}\n\nAssociation domain::Firm_Person\n{\n firm: domain::Firm[1];\n employees: domain::Person[*];\n}\n\nAssociation domain::S_Firm_S_Person\n{\n firm: domain::S_Firm[1];\n employees: domain::S_Person[*];\n}\n\n\n###Mapping\nMapping mapping::m2m::Firm_Person\n(\n domain::Person: Pure\n {\n ~src domain::S_Person\n firstName: $src.fullName->substring(\n 0,\n $src.fullName->indexOf(' ')\n),\n lastName: $src.fullName->substring(\n $src.fullName->indexOf(' ') + 1,\n $src.fullName->length()\n)\n }\n domain::Firm: Pure\n {\n ~src domain::S_Firm\n legalName: $src.legalName,\n employees[domain_Person]: $src.employees\n }\n\n MappingTests\n [\n test_1\n (\n query: |domain::Firm.all()->graphFetch(\n #{\n domain::Firm{\n legalName,\n employees{\n firstName\n }\n }\n }#\n)->serialize(\n #{\n domain::Firm{\n legalName,\n employees{\n firstName\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '[{\"legalName\":\"ACME Corp.\",\"employees\":[{\"firstName\":\"Road\"},{\"firstName\":\"Wile\"}]},{\"legalName\":\"Monsters Inc.\",\"employees\":[{\"firstName\":\"Jake\"},{\"firstName\":\"Mike\"}]}]';\n )\n ]\n)\n\nMapping mapping::relational::Firm_Person\n(\n domain::Person: Relational\n {\n ~primaryKey\n (\n [database::h2]PERSON.ID\n )\n ~mainTable [database::h2]PERSON\n firstName: [database::h2]PERSON.FIRST_NAME,\n lastName: [database::h2]PERSON.LAST_NAME\n }\n domain::Firm: Relational\n {\n ~primaryKey\n (\n [database::h2]FIRM.ID\n )\n ~mainTable [database::h2]FIRM\n legalName: [database::h2]FIRM.LEGAL_NAME,\n employees[domain_Person]: [database::h2]@Firm_Person\n }\n\n MappingTests\n [\n test_1\n (\n query: |domain::Firm.all()->project(\n [\n x: domain::Firm[1]|$x.legalName,\n x: domain::Firm[1]|$x.employees.firstName,\n x: domain::Firm[1]|$x.employees.lastName\n ],\n [\n 'Legal Name',\n 'Employees/First Name',\n 'Employees/Last Name'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[\"ACME Corp.\",\"Road\",\"Runner\"]},{\"values\":[\"ACME Corp.\",\"Wile\",\"Coyote\"]},{\"values\":[\"Monsters Inc.\",\"Jake\",\"Sullivan\"]},{\"values\":[\"Monsters Inc.\",\"Mike\",\"Wazwoski\"]}]';\n )\n ]\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::h2\n{\n store: database::h2;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'drop table if exists FIRM',\n 'create table FIRM(ID INTEGER, LEGAL_NAME VARCHAR(200))',\n 'insert into FIRM(ID, LEGAL_NAME) values(100, \\'ACME Corp.\\')',\n 'insert into FIRM(ID, LEGAL_NAME) values(200, \\'Monsters Inc.\\')',\n 'drop table if exists PERSON;',\n 'create table PERSON(ID INTEGER, FIRMID INTEGER, FIRST_NAME VARCHAR(200), LAST_NAME VARCHAR(200))',\n 'insert into PERSON(ID, FIRMID, FIRST_NAME, LAST_NAME) values(1, 100, \\'Road\\', \\'Runner\\')',\n 'insert into PERSON(ID, FIRMID, FIRST_NAME, LAST_NAME) values(2, 100, \\'Wile\\', \\'Coyote\\')',\n 'insert into PERSON(ID, FIRMID, FIRST_NAME, LAST_NAME) values(3, 200, \\'Jake\\', \\'Sullivan\\')',\n 'insert into PERSON(ID, FIRMID, FIRST_NAME, LAST_NAME) values(4, 200, \\'Mike\\', \\'Wazwoski\\')'\n ];\n };\n auth: DefaultH2;\n}\n"},{"title":"Snowflake activator","documentation":"TODO: Some dummy description","development":true,"path":"Lambda/Activator - Snowflake","code":""},{"title":"Function Tests","description":"Simple Function with Tests","documentation":"The following showcase shows how to write tests for simple functions with and without parameters. Adding tests to your functions will help ensure your function behaves as expected as it is changed by other users.","path":"Lambda/Function Tests","code":"function model::Simple(): String[1]\n{\n 'Hello' + ' World!'\n}\n{\n testPass | Simple() => 'Hello World!';\n}\n\nfunction model::Hello(name: String[1]): String[1]\n{\n 'Hello World! My name is ' + $name + '.'\n}\n{\n testSuite_1\n (\n testPass | Hello('John') => 'Hello World! My name is John.';\n )\n}\n\nfunction model::SimpleReference(): String[1]\n{\n model::Simple()\n}\n{\n testPass | SimpleReference() => 'Hello World!';\n}\n"},{"title":"String function","description":"Showcases native string legend functions","documentation":"Showcases native string legend functions","path":"Lambda/Write Functions/String Functions","code":"function legend::string::test::testTrim(val: String[1]): String[1]\n{\n $val->trim()\n}\n{\n test1 | testTrim(' A Simple Text To Trim ') => 'A Simple Text To Trim';\n test2 | testTrim(' A Simple Text To Trim') => 'A Simple Text To Trim';\n}\n\nfunction legend::string::test::testToUpper(val: String[1]): String[1]\n{\n $val->toUpper()\n}\n{\n test1 | testToUpper('TesT') => 'TEST';\n test2 | testToUpper('TEST') => 'TEST';\n}\n\nfunction legend::string::test::testToLower(val: String[1]): String[1]\n{\n $val->toLower()\n}\n{\n test1 | testToLower('TesT') => 'test';\n test2 | testToLower('TEST') => 'test';\n}\n\nfunction legend::string::test::testParseInteger(val: String[1]): Integer[1]\n{\n $val->parseInteger()\n}\n{\n test1 | testParseInteger('17') => 17;\n test2 | testParseInteger('+00000017') => 17;\n test3 | testParseInteger('-17') => -17;\n test4 | testParseInteger('9999999999999992') => 9999999999999992;\n}\n\nfunction legend::string::test::testParseFloat(val: String[1]): Float[1]\n{\n $val->parseFloat()\n}\n{\n test1 | testParseFloat('3.14159') => 3.14159;\n test2 | testParseFloat('+0000003.1415900000') => 3.14159;\n test3 | testParseFloat('-0000003.1415900000') => -3.14159;\n test4 | testParseFloat('0.0') => 0.0;\n}\n"},{"title":"Build A Data model","documentation":"Learn how to build foundational data model elements: packages, classes, associations, profiles, functions, units/measures, data elements, diagrams, enumerations, constraints, derived properties, supertypes, tagged values, stereotypes...","development":true,"path":"Model/Build a data model","code":"###Diagram\nDiagram _02_advanced::FinalTradeAccountDiagram\n{\n classView 2607efb4-489b-451c-9fe0-3ee0f71191db\n {\n class: _01_basic::Trade;\n position: (1150.5257568359375,706.5);\n rectangle: (207.88623046875,184.0);\n }\n classView 3f9f55f3-0f34-4aa5-972b-6fb0d0839393\n {\n class: _01_basic::TradeEvent;\n position: (1528.4548415786112,750.0066923369803);\n rectangle: (146.54296875,72.0);\n }\n classView dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d\n {\n class: _01_basic::Account;\n position: (804.5257568359375,756.0);\n rectangle: (179.53759765625,72.0);\n }\n classView 742b39b1-983a-4913-bad9-a45654973427\n {\n class: _02_advanced::AccountWithConstraints;\n position: (789.9989051643056,921.25);\n rectangle: (206.46875,58.0);\n }\n classView 931cb999-5873-4fcd-8e9b-0ca4f1cf9a3f\n {\n class: _02_advanced::SynonymStereoTyped;\n position: (1170.9989051643056,579.625);\n rectangle: (180.54736328125,86.0);\n }\n classView dfcaa3ce-a0e4-47ca-8a08-937129ab8c5e\n {\n class: _02_advanced::ProductUpdated;\n position: (763.9989051643056,565.625);\n rectangle: (224.7783203125,114.0);\n }\n classView 1e46b918-d9c4-4212-90b3-0b51992421dc\n {\n class: _01_basic::Trader;\n position: (1536.7489051643056,594.1887199867499);\n rectangle: (117.796875,58.0);\n }\n propertyView\n {\n property: _01_basic::Account.trades;\n source: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(977.9580688476562,781.5),(1204.9580688476562,782.5)];\n }\n propertyView\n {\n property: _01_basic::Trade.account;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(1156.9580688476562,819.5),(957.9580688476562,819.5)];\n }\n propertyView\n {\n property: _01_basic::Trade.events;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n points: [(1340.9989051643056,779.6887199867499),(1544.9989051643056,779.6887199867499)];\n }\n propertyView\n {\n property: _01_basic::TradeEvent.trade;\n source: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(1533.9989051643056,813.6887199867499),(1320.9989051643056,813.6887199867499)];\n }\n propertyView\n {\n property: _02_advanced::ProductUpdated.synonyms;\n source: dfcaa3ce-a0e4-47ca-8a08-937129ab8c5e;\n target: 931cb999-5873-4fcd-8e9b-0ca4f1cf9a3f;\n points: [(876.3880653205556,622.625),(1261.2725868049306,622.625)];\n }\n propertyView\n {\n property: _02_advanced::SynonymStereoTyped.product;\n source: 931cb999-5873-4fcd-8e9b-0ca4f1cf9a3f;\n target: dfcaa3ce-a0e4-47ca-8a08-937129ab8c5e;\n points: [(1261.2725868049306,622.625),(876.3880653205556,622.625)];\n }\n generalizationView\n {\n source: 742b39b1-983a-4913-bad9-a45654973427;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(893.2332801643056,950.25),(894.2945556640625,792.0)];\n }\n}\n\nDiagram _01_basic::TradeAccountDiagram\n{\n classView 7bac7403-9f7b-44e3-8396-de6093534159\n {\n class: _01_basic::Product;\n position: (789.0,567.0);\n rectangle: (237.00830078125,114.0);\n }\n classView 1e46b918-d9c4-4212-90b3-0b51992421dc\n {\n class: _01_basic::Trader;\n position: (1528.7489051643056,576.1887199867499);\n rectangle: (117.796875,58.0);\n }\n classView 0dd5c051-e28d-413a-a94e-567128bcdbc9\n {\n class: _01_basic::Synonym;\n position: (1170.254150390625,579.5);\n rectangle: (180.54736328125,72.0);\n }\n classView 2607efb4-489b-451c-9fe0-3ee0f71191db\n {\n class: _01_basic::Trade;\n position: (1150.5257568359375,706.5);\n rectangle: (207.88623046875,184.0);\n }\n classView 3f9f55f3-0f34-4aa5-972b-6fb0d0839393\n {\n class: _01_basic::TradeEvent;\n position: (1528.4548415786112,750.0066923369803);\n rectangle: (146.54296875,72.0);\n }\n classView dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d\n {\n class: _01_basic::Account;\n position: (799.5257568359375,757.0);\n rectangle: (179.53759765625,72.0);\n }\n propertyView\n {\n property: _01_basic::Account.trades;\n source: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(972.9580688476562,782.5),(1204.9580688476562,782.5)];\n }\n propertyView\n {\n property: _01_basic::Trade.account;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(1156.9580688476562,819.5),(952.9580688476562,820.5)];\n }\n propertyView\n {\n property: _01_basic::Trade.events;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n points: [(1340.9989051643056,779.6887199867499),(1544.9989051643056,779.6887199867499)];\n }\n propertyView\n {\n property: _01_basic::TradeEvent.trade;\n source: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(1533.9989051643056,813.6887199867499),(1320.9989051643056,813.6887199867499)];\n }\n}\n\n\n###Text\nText _01_basic::README\n{\n type: markdown;\n content: '### Logical Modeling Showcase\\n\\nThis package contains showcase model to demonstrate logical modeling capabilities of Legend\\nIn this showcase, we will show the following:\\n1) How to create new Classes\\n2) How to define associations between related classes\\n3) How to define multiplicities for the fields in a Class\\n4) How to define enumerations\\n5) How to create a diagrams\\n6) How to create a doc like the one you are reading right now';\n}\n\nText _02_advanced::README\n{\n type: markdown;\n content: '###Advanced Modeling Concepts\\n\\nThis package builds upon the basic model developed in previous package and add more features to the model.\\nIn this showcase, we will show the following:\\n1. Class Inheritance\\n2. Derived Properties\\n3. Constraints\\n4. Stereotypes\\n5. Tags\\n\\n\\n';\n}\n\nText _03_modelToModelMapping::README\n{\n type: markdown;\n content: '###Model to Model Mapping\\n\\nThis package contains showcase models to demonstrate Model to model mapping which involves \\nthe transformation of data from source to the desired target model.\\nIn this showcase, we will cover the following:\\n1. Simple Model to model Mapping\\n2. Filtering within a mapping\\n3. Testing the m2m mapping \\n4. Union mappings';\n}\n\n\n###Pure\nEnum _01_basic::ProductSynonymType\n{\n CUSIP,\n ISIN,\n SEDOL\n}\n\nClass _01_basic::Product\n{\n name: String[1];\n classification: _01_basic::ProductClassification[0..1];\n cusip() {$this.synonyms->filter(\n s: _01_basic::Synonym[1]|$s.type ==\n _01_basic::ProductSynonymType.CUSIP\n)->toOne().name}: String[1];\n isin() {$this.synonyms->filter(\n s: _01_basic::Synonym[1]|$s.type ==\n _01_basic::ProductSynonymType.ISIN\n)->toOne().name}: String[1];\n sedol() {$this.synonyms->filter(\n s: _01_basic::Synonym[1]|$s.type ==\n _01_basic::ProductSynonymType.SEDOL\n)->toOne().name}: String[1];\n}\n\nClass _01_basic::TradeEvent\n{\n eventType: String[1];\n eventDate: StrictDate[1];\n initiator: _01_basic::Trader[0..1];\n trade: _01_basic::Trade[1];\n}\n\nClass _03_modelToModelMapping::S_Product\n{\n name: String[1];\n classification: _03_modelToModelMapping::S_ProductClassification[0..1];\n synonym: _03_modelToModelMapping::S_Synonym[*];\n}\n\nClass _01_basic::Trader\n{\n name: String[1];\n address: String[1];\n}\n\nClass _01_basic::Synonym\n{\n type: _01_basic::ProductSynonymType[1];\n name: String[1];\n}\n\nClass _01_basic::Trade\n{\n id: Integer[1];\n tradeDate: StrictDate[1];\n quantity: Float[1];\n settlementDateTime: DateTime[0..1];\n product: _01_basic::Product[0..1];\n account: _01_basic::Account[0..1];\n events: _01_basic::TradeEvent[*];\n productIdentifier() {if(\n $this.product->isNotEmpty(),\n |$this.product->toOne().name,\n |'Unknown'\n)}: String[1];\n eventsByDate(date: Date[1]) {$this.events->filter(\n e: _01_basic::TradeEvent[1]|$e.eventDate ==\n $date\n)}: _01_basic::TradeEvent[*];\n tradeDateEvent() {$this.eventsByDate($this.tradeDate->toOne())->toOne()}: _01_basic::TradeEvent[1];\n tradeDataEventType() {$this.tradeDateEvent.eventType}: String[1];\n initiator() {$this.tradeDateEvent.initiator}: _01_basic::Trader[0..1];\n latestEventDate() {$this.events->map(\n e: _01_basic::TradeEvent[1]|$e.eventDate\n)->sort()->reverse()->at(0)}: StrictDate[1];\n}\n\nClass _01_basic::Account\n{\n name: String[1];\n createDate: StrictDate[1];\n trades: _01_basic::Trade[*];\n closeDate: StrictDate[0..1];\n}\n\nClass <> _02_advanced::SynonymStereoTyped\n{\n type: _01_basic::ProductSynonymType[1];\n name: String[1];\n}\n\nClass _03_modelToModelMapping::S_Synonym\n{\n type: String[1];\n name: String[1];\n}\n\nClass {meta::pure::profiles::doc.doc = 'must pass date for isin/cusip/sedol now.'} _02_advanced::ProductUpdated\n{\n name: String[1];\n classification: _01_basic::ProductClassification[1];\n cusip(businessDate: StrictDate[1]) {$this.synonyms($businessDate)->filter(\n s: _02_advanced::SynonymStereoTyped[1]|$s.type ==\n _01_basic::ProductSynonymType.CUSIP\n)->toOne().name}: String[1];\n isin(businessDate: StrictDate[1]) {$this.synonyms($businessDate)->filter(\n s: _02_advanced::SynonymStereoTyped[1]|$s.type ==\n _01_basic::ProductSynonymType.ISIN\n)->toOne().name}: String[1];\n sedol(businessDate: StrictDate[1]) {$this.synonyms($businessDate)->filter(\n s: _02_advanced::SynonymStereoTyped[1]|$s.type ==\n _01_basic::ProductSynonymType.SEDOL\n)->toOne().name}: String[1];\n}\n\nClass {meta::pure::profiles::doc.doc = 'use tags to add metadata.'} _02_advanced::AccountWithConstraints extends _01_basic::Account\n[\n tradesNotDoubleBooked: $this->project(\n [\n a: _02_advanced::AccountWithConstraints[1]|$a.trades.id\n ],\n ['tradeId']\n)->groupBy(\n 'tradeId',\n 'count'->agg(\n x: meta::pure::tds::TDSRow[1]|$x,\n y: meta::pure::tds::TDSRow[*]|$y->count()\n )\n)->filter(\n t: meta::pure::tds::TDSRow[1]|$t.getInteger('count') > 1\n)->tdsRows()->isEmpty(),\n noTradesAfterCloseDate: true\n]\n{\n isOpen() {$this.closeDate->isEmpty()}: Boolean[1];\n}\n\nClass _03_modelToModelMapping::S_ProductClassification\n{\n type: String[1];\n description: String[1];\n}\n\nClass _01_basic::ProductClassification\n{\n type: String[1];\n description: String[1];\n}\n\nAssociation _02_advanced::ProdSynonymMilestoned\n{\n product: _02_advanced::ProductUpdated[1];\n synonyms: _02_advanced::SynonymStereoTyped[*];\n}\n\nAssociation _01_basic::ProdSynonym\n{\n product: _01_basic::Product[1];\n synonyms: _01_basic::Synonym[*];\n}\n\n\n###Mapping\nMapping _03_modelToModelMapping::simpleModelToModelMapping\n(\n *_01_basic::Product: Pure\n {\n ~src _03_modelToModelMapping::S_Product\n ~filter !($src.classification.type == 'type2')\n name: $src.name,\n synonyms[_01_basic_Synonym]: $src.synonym,\n classification[_01_basic_ProductClassification]: $src.classification\n }\n *_01_basic::ProductClassification: Pure\n {\n ~src _03_modelToModelMapping::S_ProductClassification\n type: $src.type,\n description: $src.description\n }\n *_01_basic::Synonym: Pure\n {\n ~src _03_modelToModelMapping::S_Synonym\n name: $src.name,\n type: EnumerationMapping _01_basic_ProductSynonymType: $src.type\n }\n\n _01_basic::ProductSynonymType: EnumerationMapping\n {\n CUSIP: ['C'],\n ISIN: ['I'],\n SEDOL: ['S']\n }\n\n MappingTests\n [\n test_1\n (\n query: |_01_basic::Product.all()->graphFetchChecked(\n #{\n _01_basic::Product{\n name,\n classification{\n description,\n type\n },\n synonyms{\n type,\n name\n }\n }\n }#\n)->serialize(\n #{\n _01_basic::Product{\n name,\n classification{\n description,\n type\n },\n synonyms{\n type,\n name\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '{\"defects\":[],\"source\":{\"defects\":[],\"source\":{\"number\":1,\"record\":\"{\\\"name\\\":\\\"Product1\\\",\\\"classification\\\":{\\\"type\\\":\\\"type1\\\",\\\"description\\\":\\\"Product classification of type 1\\\"},\\\"synonym\\\":[{\\\"type\\\":\\\"C\\\",\\\"name\\\":\\\"C1\\\"}]}\"},\"value\":{\"classification\":{\"description\":\"Product classification of type 1\",\"type\":\"type1\"},\"name\":\"Product1\",\"synonym\":[{\"name\":\"C1\",\"type\":\"C\"}]}},\"value\":{\"name\":\"Product1\",\"classification\":{\"description\":\"Product classification of type 1\",\"type\":\"type1\"},\"synonyms\":[{\"type\":\"CUSIP\",\"name\":\"C1\"}]}}';\n ),\n test_2\n (\n query: |_01_basic::Product.all()->graphFetchChecked(\n #{\n _01_basic::Product{\n name,\n classification{\n type,\n description\n },\n synonyms{\n name,\n type\n }\n }\n }#\n)->serialize(\n #{\n _01_basic::Product{\n name,\n classification{\n type,\n description\n },\n synonyms{\n name,\n type\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '[]';\n )\n ]\n)\n\nMapping _03_modelToModelMapping::unionMapping\n(\n _01_basic::Product[p1]: Pure\n {\n ~src _03_modelToModelMapping::S_Product\n ~filter !($src.classification.type == 'type2')\n name: $src.name,\n classification[_01_basic_ProductClassification]: $src.classification,\n synonyms[_01_basic_Synonym]: $src.synonym\n }\n _01_basic::Product[p2]: Pure\n {\n ~src _03_modelToModelMapping::S_Product\n ~filter $src.classification.type == 'type2'\n name: $src.name,\n classification[_01_basic_ProductClassification]: $src.classification,\n synonyms[_01_basic_Synonym]: $src.synonym\n }\n *_01_basic::ProductClassification: Pure\n {\n ~src _03_modelToModelMapping::S_ProductClassification\n type: $src.type,\n description: $src.description\n }\n *_01_basic::Synonym: Pure\n {\n ~src _03_modelToModelMapping::S_Synonym\n type: EnumerationMapping _01_basic_ProductSynonymType: $src.type,\n name: $src.name\n }\n *_01_basic::Product[union]: Operation\n {\n meta::pure::router::operations::union_OperationSetImplementation_1__SetImplementation_MANY_(p1,p2)\n }\n\n _01_basic::ProductSynonymType: EnumerationMapping\n {\n CUSIP: ['C'],\n ISIN: ['I'],\n SEDOL: ['S']\n }\n\n MappingTests\n [\n test_1\n (\n query: |_01_basic::Product.all()->graphFetchChecked(\n #{\n _01_basic::Product{\n name,\n synonyms{\n name,\n type\n },\n classification{\n type,\n description\n }\n }\n }#\n)->serialize(\n #{\n _01_basic::Product{\n name,\n synonyms{\n name,\n type\n },\n classification{\n type,\n description\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '{\"defects\":[],\"source\":{\"defects\":[],\"source\":{\"number\":1,\"record\":\"{\\\"name\\\":\\\"Product1\\\",\\\"classification\\\":{\\\"type\\\":\\\"type1\\\",\\\"description\\\":\\\"Product of type1\\\"},\\\"synonym\\\":[{\\\"type\\\":\\\"C\\\",\\\"name\\\":\\\"C1\\\"},{\\\"type\\\":\\\"I\\\",\\\"name\\\":\\\"I1\\\"}]}\"},\"value\":{\"classification\":{\"description\":\"Product of type1\",\"type\":\"type1\"},\"name\":\"Product1\",\"synonym\":[{\"name\":\"C1\",\"type\":\"C\"},{\"name\":\"I1\",\"type\":\"I\"}]}},\"value\":{\"name\":\"Product1\",\"synonyms\":[{\"name\":\"C1\",\"type\":\"CUSIP\"},{\"name\":\"I1\",\"type\":\"ISIN\"}],\"classification\":{\"type\":\"type1\",\"description\":\"Product of type1\"}}}';\n ),\n test_2\n (\n query: |_01_basic::Product.all()->graphFetchChecked(\n #{\n _01_basic::Product{\n name,\n classification{\n type,\n description\n },\n synonyms{\n name,\n type\n }\n }\n }#\n)->serialize(\n #{\n _01_basic::Product{\n name,\n classification{\n type,\n description\n },\n synonyms{\n name,\n type\n }\n }\n }#\n);\n data:\n [\n \n ];\n assert: '{\"defects\":[],\"source\":{\"defects\":[],\"source\":{\"number\":1,\"record\":\"{\\\"name\\\":\\\"Product2\\\",\\\"classification\\\":{\\\"type\\\":\\\"type2\\\",\\\"description\\\":\\\"Product of classification type2\\\"},\\\"synonym\\\":[{\\\"type\\\":\\\"S\\\",\\\"name\\\":\\\"S1\\\"}]}\"},\"value\":{\"classification\":{\"description\":\"Product of classification type2\",\"type\":\"type2\"},\"name\":\"Product2\",\"synonym\":[{\"name\":\"S1\",\"type\":\"S\"}]}},\"value\":{\"name\":\"Product2\",\"classification\":{\"type\":\"type2\",\"description\":\"Product of classification type2\"},\"synonyms\":[{\"name\":\"S1\",\"type\":\"SEDOL\"}]}}';\n )\n ]\n)\n"},{"title":"Data Space Basic Specification","documentation":"DataSpace Basic Specification","path":"Model/Document and share your model/Data Space","code":"###Diagram\nDiagram showcase::northwind::model::NorthwindModelDiagram\n{\n classView 8947a897-a67d-4064-8770-8a440e1220ce\n {\n class: showcase::northwind::model::crm::Employee;\n position: (401.1871744777152,580.7157363134539);\n rectangle: (211.03332710266113,212.0);\n }\n classView d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2\n {\n class: showcase::northwind::model::geography::Address;\n position: (428.11321850038996,365.8790985977993);\n rectangle: (145.85000038146973,114.0);\n }\n classView fd4a376f-11c2-4f8b-9e76-19079a06cc0b\n {\n class: showcase::northwind::model::Order;\n position: (89.66931137749526,364.84316585774513);\n rectangle: (174.01666831970215,114.0);\n }\n classView 51d867fc-1dce-4979-9120-d10a551e23a7\n {\n class: showcase::northwind::model::crm::ShippingCompany;\n position: (-240.98019847552794,379.4990577970102);\n rectangle: (179.4666690826416,86.0);\n }\n classView 4251c20c-4779-4c21-9b9c-900caf75fcc6\n {\n class: showcase::northwind::model::inventory::Product;\n position: (421.60610674363886,-69.9030438054377);\n rectangle: (167.85000038146973,128.0);\n }\n classView 2a461b5d-77dd-43e1-a33f-0759d84b8667\n {\n class: showcase::northwind::model::OrderLineItem;\n position: (92.87799226709058,-43.093765410358316);\n rectangle: (169.10000133514404,86.0);\n }\n classView 8217f514-1928-48bc-b8de-386ca506c1f9\n {\n class: showcase::northwind::model::geography::SalesTerritory;\n position: (806.4847354152803,653.513841427653);\n rectangle: (141.58333110809326,72.0);\n }\n classView 37cda7f9-22dc-4e75-ad3a-a5599d88772a\n {\n class: showcase::northwind::model::inventory::ProductCategory;\n position: (786.770946360032,-49.13039766561275);\n rectangle: (175.1082781744508,86.0);\n }\n classView 09710ba2-c255-4222-a85d-50520d5eae95\n {\n class: showcase::northwind::model::inventory::Supplier;\n position: (768.5537612977755,206.91393580644078);\n rectangle: (179.4666690826416,142.0);\n }\n classView df47922a-2b8a-4b12-b835-d7c75a694670\n {\n class: showcase::northwind::model::crm::Customer;\n position: (382.36050099956327,131.63043674809185);\n rectangle: (236.94999885559082,128.0);\n }\n classView 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1\n {\n class: showcase::northwind::model::geography::SalesRegion;\n position: (806.4847354152804,492.60599452399185);\n rectangle: (133.0166654586792,58.0);\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Customer.address;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(500.8355004273587,195.63043674809185),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.shipper;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 51d867fc-1dce-4979-9120-d10a551e23a7;\n points: [(176.67764553734634,421.84316585774513),(-151.24686393420714,422.4990577970102)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.orders;\n source: 51d867fc-1dce-4979-9120-d10a551e23a7;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(-151.24686393420714,422.4990577970102),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.lineItems;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(176.67764553734634,421.84316585774513),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.order;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(177.4279929346626,-0.09376541035831565),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::Order.shipToAddress;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(176.67764553734634,421.84316585774513),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.customer;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: df47922a-2b8a-4b12-b835-d7c75a694670;\n points: [(176.67764553734634,421.84316585774513),(500.8355004273587,195.63043674809185)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.orders;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(500.8355004273587,195.63043674809185),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::inventory::Supplier.address;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(858.2870958390963,277.9139358064408),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.orders;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(506.70383802904576,686.7157363134539),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.employee;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(176.67764553734634,421.84316585774513),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Employee.address;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(506.70383802904576,686.7157363134539),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.category;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n points: [(505.5311069343737,-5.903043805437704),(874.3250854472574,-6.1303976656127475)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.products;\n source: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(874.3250854472574,-6.1303976656127475),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.orderLineItems;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(505.5311069343737,-5.903043805437704),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.product;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(177.4279929346626,-0.09376541035831565),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.supplier;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 09710ba2-c255-4222-a85d-50520d5eae95;\n points: [(505.5311069343737,-5.903043805437704),(858.2870958390963,277.9139358064408)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.products;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(858.2870958390963,277.9139358064408),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.employees;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(877.2764009693269,689.513841427653),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.territories;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(506.70383802904576,686.7157363134539),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.territories;\n source: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(872.99306814462,521.6059945239919),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.region;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n points: [(877.2764009693269,689.513841427653),(872.99306814462,521.6059945239919)];\n }\n}\n\n\n###DataSpace\nDataSpace showcase::northwind::dataspace::NorthwindDataSpace\n{\n executionContexts:\n [\n {\n name: 'externally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'externally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n }\n ];\n defaultExecutionContext: 'externally-public-PROD';\n}\n\n\n###Service\nService showcase::northwind::services::graph::OrderDetailsByIdGraphFetch\n{\n pattern: '/orderDetailsByIdGraphFetch/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: id: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $id\n )->graphFetch(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::graph::ShipperValidationDefects\n{\n pattern: '/shipperValidationDefects';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::ShippingCompany.all()->graphFetchChecked(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::OrderDetailsByIdTDS\n{\n pattern: '/orderDetailsByIdTDS/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: orderId: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $orderId\n )->project(\n [\n x: showcase::northwind::model::Order[1]|$x.id,\n x: showcase::northwind::model::Order[1]|$x.customer.companyName,\n x: showcase::northwind::model::Order[1]|$x.employee.firstName,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.quantity,\n x: showcase::northwind::model::Order[1]|$x.shipper.name\n ],\n [\n 'Order Id',\n 'Customer/Company Name',\n 'Employee/First Name',\n 'Order Line Items/Product/Product Name',\n 'Order Line Items/Product/Category/Category Name',\n 'Order Line Items/Quantity',\n 'Shipper/Company Name'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'a simple passing validation with static parameter';\n params:[\n |10248\n ];\n assertions:[\n rowCountGreaterThan10: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Employee/First Name')->startsWith('T')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected no Employee/First Name to begin with the letter T')\n ];\n }\n ]\n}\n\nService showcase::northwind::services::tds::TopCategories\n{\n pattern: '/topCategories';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::ProductRankingWithinCategory\n{\n pattern: '/productRankingWithinCategory';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::inventory::ProductCategory.all()->groupBy(\n [\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.name,\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.name\n ],\n [\n agg(\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.orderLineItems.order.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Name',\n 'Products/Product Name',\n 'OrderCount'\n ]\n )->olapGroupBy(\n ['Category Name'],\n desc('OrderCount'),\n x: meta::pure::tds::TDSRow[*]|$x->rank(),\n 'Rank Within Category'\n )->sort(\n [\n asc('Category Name'),\n asc('Rank Within Category')\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::Customers\n{\n pattern: '/customers';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n [\n x: showcase::northwind::model::crm::Customer[1]|$x.id,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyName,\n x: showcase::northwind::model::crm::Customer[1]|$x.contactName,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyTitle,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.country,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.address,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.city,\n x: showcase::northwind::model::crm::Customer[1]|$x.telephoneNumber\n ],\n [\n 'Customer Id',\n 'Company Name',\n 'Contact Name',\n 'Company Title',\n 'Country',\n 'Address',\n 'City',\n 'Phone'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'A simple passing validation';\n params:[\n\n ];\n assertions:[\n noCompanyNamedAroundtheHorn: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Company Name')->contains('Around the Hornsss')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected there is no company named Around the Hornsss')\n ];\n }\n ]\n}\n\n\n###Relational\nDatabase showcase::northwind::store::NorthwindDatabase\n(\n Schema NORTHWIND\n (\n Table CATEGORIES\n (\n CATEGORY_ID SMALLINT PRIMARY KEY,\n CATEGORY_NAME VARCHAR(15) NOT NULL,\n DESCRIPTION VARCHAR(256),\n PICTURE OTHER\n )\n Table CUSTOMERS\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24)\n )\n Table CUSTOMER_CUSTOMER_DEMO\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY\n )\n Table CUSTOMER_DEMOGRAPHICS\n (\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_DESC VARCHAR(256)\n )\n Table EMPLOYEES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n LAST_NAME VARCHAR(20) NOT NULL,\n FIRST_NAME VARCHAR(10) NOT NULL,\n TITLE VARCHAR(30),\n TITLE_OF_COURTESY VARCHAR(25),\n BIRTH_DATE DATE,\n HIRE_DATE DATE,\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n HOME_PHONE VARCHAR(24),\n EXTENSION VARCHAR(4),\n PHOTO OTHER,\n NOTES OTHER,\n REPORTS_TO SMALLINT,\n PHOTO_PATH VARCHAR(255)\n )\n Table EMPLOYEE_TERRITORIES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n TERRITORY_ID VARCHAR(20) PRIMARY KEY\n )\n Table ORDERS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n CUSTOMER_ID VARCHAR(5),\n EMPLOYEE_ID SMALLINT,\n ORDER_DATE DATE,\n REQUIRED_DATE DATE,\n SHIPPED_DATE DATE,\n SHIP_VIA SMALLINT,\n FREIGHT OTHER,\n SHIP_NAME VARCHAR(40),\n SHIP_ADDRESS VARCHAR(60),\n SHIP_CITY VARCHAR(15),\n SHIP_REGION VARCHAR(15),\n SHIP_POSTAL_CODE VARCHAR(10),\n SHIP_COUNTRY VARCHAR(15)\n )\n Table ORDER_DETAILS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n PRODUCT_ID SMALLINT PRIMARY KEY,\n UNIT_PRICE OTHER NOT NULL,\n QUANTITY SMALLINT NOT NULL,\n DISCOUNT OTHER NOT NULL\n )\n Table PRODUCTS\n (\n PRODUCT_ID SMALLINT PRIMARY KEY,\n PRODUCT_NAME VARCHAR(40) NOT NULL,\n SUPPLIER_ID SMALLINT,\n CATEGORY_ID SMALLINT,\n QUANTITY_PER_UNIT VARCHAR(20),\n UNIT_PRICE OTHER,\n UNITS_IN_STOCK SMALLINT,\n UNITS_ON_ORDER SMALLINT,\n REORDER_LEVEL SMALLINT,\n DISCONTINUED INTEGER NOT NULL\n )\n Table REGION\n (\n REGION_ID SMALLINT PRIMARY KEY,\n REGION_DESCRIPTION VARCHAR(60) NOT NULL\n )\n Table SHIPPERS\n (\n SHIPPER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n PHONE VARCHAR(24) NOT NULL\n )\n Table SUPPLIERS\n (\n SUPPLIER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24),\n HOMEPAGE VARCHAR(256)\n )\n Table TERRITORIES\n (\n TERRITORY_ID VARCHAR(20) PRIMARY KEY,\n TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,\n REGION_ID SMALLINT NOT NULL\n )\n Table US_STATES\n (\n STATE_ID SMALLINT PRIMARY KEY,\n STATE_NAME VARCHAR(100),\n STATE_ABBR VARCHAR(2),\n STATE_REGION VARCHAR(50)\n )\n )\n\n Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)\n Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)\n Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)\n Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)\n Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)\n Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)\n Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)\n Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)\n Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)\n Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)\n Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)\n Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)\n Join SUPPLIERS_REGION(NORTHWIND.SUPPLIERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join ORDERS_REGION(NORTHWIND.ORDERS.SHIP_REGION = NORTHWIND.REGION.REGION_ID)\n Join CUSTOMERS_REGION(NORTHWIND.CUSTOMERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_REGION(NORTHWIND.EMPLOYEES.REGION = NORTHWIND.REGION.REGION_ID)\n)\n\n\n###Pure\nEnum showcase::northwind::model::crm::Title\n{\n Mr,\n Mrs,\n Miss,\n Ms,\n Dr,\n Sir,\n Professor,\n Duchess,\n Duke\n}\n\nClass showcase::northwind::model::crm::Employee\n[\n dateOfBirthNotInTheFuture: $this.dateOfBirth <\n now(),\n dateOfBirthValid: $this.dateOfBirth > %1900-01-01,\n employeeIsOverEighteen: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) >= 18,\n employeeIsUnderEighty: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) < 80,\n notDateOfHireNotBeforeDateOfBirth: $this.dateOfHire >\n $this.dateOfBirth\n]\n{\n id: Integer[1];\n lastName: String[1];\n firstName: String[1];\n title: String[0..1];\n preferredTitle: showcase::northwind::model::crm::Title[0..1];\n dateOfBirth: StrictDate[0..1];\n dateOfHire: StrictDate[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n homeTelephoneNumber: String[0..1];\n extension: String[0..1];\n fullName() {if(\n $this.preferredTitle->isNotEmpty(),\n |$this.preferredTitle->toOne()->toString() + ' ',\n |if(\n $this.title->isNotEmpty(),\n |$this.title->toOne() + ' ',\n |''\n )\n) + $this.firstName + ' ' + $this.lastName}: String[1];\n}\n\nClass showcase::northwind::model::Order\n{\n id: Integer[1];\n createdDate: StrictDate[0..1];\n requiredDate: StrictDate[0..1];\n shippedDate: StrictDate[0..1];\n shipToName: String[0..1];\n shipToAddress: showcase::northwind::model::geography::Address[0..1];\n itemCount() {$this.lineItems->count()}: Integer[1];\n}\n\nClass showcase::northwind::model::geography::Address\n{\n address: String[0..1];\n city: String[0..1];\n postalCode: String[0..1];\n region: String[0..1];\n country: String[0..1];\n}\n\nClass showcase::northwind::model::inventory::Product\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n quantityPerUnit: String[0..1];\n unitsInStock: Integer[0..1];\n unitsOnOrder: Integer[0..1];\n reorderLevel: Integer[0..1];\n discontinued: Integer[1];\n}\n\nClass showcase::northwind::model::inventory::Supplier\n{\n id: Integer[1];\n companyName: String[1];\n contactName: String[0..1];\n contactTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n homepageUrl: String[0..1];\n}\n\nClass showcase::northwind::model::crm::Customer\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n companyName: String[1];\n contactName: String[0..1];\n companyTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n}\n\nClass showcase::northwind::model::crm::CustomerDemographic\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::crm::ShippingCompany\n[\n idNotNegative: $this.id >= 0,\n telephoneNumberFormatValid: $this.telephoneNumber->isEmpty() ||\n $this.telephoneNumber->toOne()->matches('(1-)?\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d')\n]\n{\n id: Integer[1];\n name: String[1];\n telephoneNumber: String[1];\n}\n\nClass showcase::northwind::model::geography::USState\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->isEmpty() ||\n ($this.name->toOne()->length() > 0)\n]\n{\n id: Integer[1];\n name: String[0..1];\n code: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesRegion\n[\n idNotNegative: $this.id >= 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: Integer[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::inventory::ProductCategory\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::OrderLineItem\n{\n quantity: Integer[1];\n unitPrice: Float[1];\n unitPriceCurrency: String[1];\n}\n\nClass showcase::northwind::model::geography::SalesTerritory\n[\n idNotBlank: $this.id->length() > 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: String[1];\n description: String[1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Employee\n{\n orders: showcase::northwind::model::Order[*];\n employee: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Category\n{\n category: showcase::northwind::model::inventory::ProductCategory[0..1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Product_Suppliers\n{\n supplier: showcase::northwind::model::inventory::Supplier[1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::OrderLineItem_Product\n{\n orderLineItems: showcase::northwind::model::OrderLineItem[*];\n product: showcase::northwind::model::inventory::Product[1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Customer\n{\n orders: showcase::northwind::model::Order[*];\n customer: showcase::northwind::model::crm::Customer[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_OrderLineItem\n{\n order: showcase::northwind::model::Order[1];\n lineItems: showcase::northwind::model::OrderLineItem[*];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Employees\n{\n employees: showcase::northwind::model::crm::Employee[*];\n territories: showcase::northwind::model::geography::SalesTerritory[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Shipper\n{\n orders: showcase::northwind::model::Order[*];\n shipper: showcase::northwind::model::crm::ShippingCompany[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Region\n{\n region: showcase::northwind::model::geography::SalesRegion[1];\n territories: showcase::northwind::model::geography::SalesTerritory[1..*];\n}\n\nAssociation showcase::northwind::model::associations::Customer_CustomerDemographics\n{\n customers: showcase::northwind::model::crm::Customer[*];\n demographics: showcase::northwind::model::crm::CustomerDemographic[*];\n}\n\nAssociation showcase::northwind::model::associations::Employee_Manager\n{\n reports: showcase::northwind::model::crm::Employee[*];\n manager: showcase::northwind::model::crm::Employee[0..1];\n}\n\n\n###Mapping\nMapping showcase::northwind::mapping::NorthwindMapping\n(\n showcase::northwind::model::inventory::ProductCategory[Category]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_NAME,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.DESCRIPTION\n }\n showcase::northwind::model::crm::Customer[Customer]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_NAME,\n companyTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.FAX\n }\n showcase::northwind::model::crm::Employee[Employee]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID,\n lastName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.LAST_NAME,\n firstName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.FIRST_NAME,\n title: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE,\n preferredTitle: EnumerationMapping TitleMapping: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE_OF_COURTESY,\n dateOfBirth: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.BIRTH_DATE,\n dateOfHire: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HIRE_DATE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.COUNTRY\n ),\n homeTelephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HOME_PHONE,\n extension: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EXTENSION\n }\n showcase::northwind::model::Order[Order]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID,\n createdDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_DATE,\n requiredDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.REQUIRED_DATE,\n shippedDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIPPED_DATE,\n shipToName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_NAME,\n shipToAddress\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_COUNTRY\n )\n }\n showcase::northwind::model::OrderLineItem[OrderLineItem]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.ORDER_ID,\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS\n quantity: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.QUANTITY,\n unitPrice: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.UNIT_PRICE,\n unitPriceCurrency: 'USD'\n }\n showcase::northwind::model::inventory::Product[Product]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_NAME,\n quantityPerUnit: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.QUANTITY_PER_UNIT,\n unitsInStock: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_IN_STOCK,\n unitsOnOrder: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_ON_ORDER,\n reorderLevel: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.REORDER_LEVEL,\n discontinued: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.DISCONTINUED\n }\n showcase::northwind::model::geography::SalesRegion[Region]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_DESCRIPTION\n }\n showcase::northwind::model::crm::ShippingCompany[Shipper]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.COMPANY_NAME,\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.PHONE\n }\n showcase::northwind::model::inventory::Supplier[Supplier]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_NAME,\n contactTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.FAX,\n homepageUrl: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.HOMEPAGE\n }\n showcase::northwind::model::geography::SalesTerritory[Territory]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_DESCRIPTION\n }\n showcase::northwind::model::geography::USState[USState]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_NAME,\n code: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ABBR\n }\n\n showcase::northwind::model::associations::Order_Customer: Relational\n {\n AssociationMapping\n (\n orders[Customer,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS,\n customer[Order,Customer]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS\n )\n }\n showcase::northwind::model::associations::Order_Employee: Relational\n {\n AssociationMapping\n (\n orders[Employee,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES,\n employee[Order,Employee]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES\n )\n }\n showcase::northwind::model::associations::Order_Shipper: Relational\n {\n AssociationMapping\n (\n orders[Shipper,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS,\n shipper[Order,Shipper]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS\n )\n }\n showcase::northwind::model::associations::Order_OrderLineItem: Relational\n {\n AssociationMapping\n (\n order[OrderLineItem,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS,\n lineItems[Order,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS\n )\n }\n showcase::northwind::model::associations::OrderLineItem_Product: Relational\n {\n AssociationMapping\n (\n orderLineItems[Product,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS,\n product[OrderLineItem,Product]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS\n )\n }\n showcase::northwind::model::associations::Product_Category: Relational\n {\n AssociationMapping\n (\n category[Product,Category]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES,\n products[Category,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES\n )\n }\n showcase::northwind::model::associations::Product_Suppliers: Relational\n {\n AssociationMapping\n (\n supplier[Product,Supplier]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS,\n products[Supplier,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS\n )\n }\n showcase::northwind::model::associations::Terriroties_Region: Relational\n {\n AssociationMapping\n (\n region[Territory,Region]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION,\n territories[Region,Territory]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION\n )\n }\n showcase::northwind::model::associations::Terriroties_Employees: Relational\n {\n AssociationMapping\n (\n employees[Territory,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES,\n territories[Employee,Territory]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES\n )\n }\n showcase::northwind::model::associations::Employee_Manager: Relational\n {\n AssociationMapping\n (\n reports[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS,\n manager[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS\n )\n }\n\n showcase::northwind::model::crm::Title: EnumerationMapping TitleMapping\n {\n Mr: ['Mr.'],\n Mrs: ['Mrs.'],\n Miss: ['Miss.'],\n Ms: ['Ms.'],\n Dr: ['Dr.'],\n Sir: ['Sir.'],\n Professor: ['Prof.'],\n Duchess: ['Duchess.'],\n Duke: ['Duke.']\n }\n)\n\n\n###Runtime\nRuntime showcase::northwind::runtime::NorthwindRuntime\n{\n mappings:\n [\n showcase::northwind::mapping::NorthwindMapping\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1:\n #{\n RelationalDatabaseConnection\n {\n store: showcase::northwind::store::NorthwindDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'call loadNorthwindData()'\n ];\n };\n auth: DefaultH2;\n }\n }#\n ]\n ];\n}\n"},{"title":"Data Space With Executables Defined","documentation":"","path":"Model/Document and share your model/Data Space With Exectuables","code":"###Diagram\nDiagram showcase::northwind::model::NorthwindModelDiagram\n{\n classView 8947a897-a67d-4064-8770-8a440e1220ce\n {\n class: showcase::northwind::model::crm::Employee;\n position: (401.1871744777152,580.7157363134539);\n rectangle: (211.03332710266113,212.0);\n }\n classView d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2\n {\n class: showcase::northwind::model::geography::Address;\n position: (428.11321850038996,365.8790985977993);\n rectangle: (145.85000038146973,114.0);\n }\n classView fd4a376f-11c2-4f8b-9e76-19079a06cc0b\n {\n class: showcase::northwind::model::Order;\n position: (89.66931137749526,364.84316585774513);\n rectangle: (174.01666831970215,114.0);\n }\n classView 51d867fc-1dce-4979-9120-d10a551e23a7\n {\n class: showcase::northwind::model::crm::ShippingCompany;\n position: (-240.98019847552794,379.4990577970102);\n rectangle: (179.4666690826416,86.0);\n }\n classView 4251c20c-4779-4c21-9b9c-900caf75fcc6\n {\n class: showcase::northwind::model::inventory::Product;\n position: (421.60610674363886,-69.9030438054377);\n rectangle: (167.85000038146973,128.0);\n }\n classView 2a461b5d-77dd-43e1-a33f-0759d84b8667\n {\n class: showcase::northwind::model::OrderLineItem;\n position: (92.87799226709058,-43.093765410358316);\n rectangle: (169.10000133514404,86.0);\n }\n classView 8217f514-1928-48bc-b8de-386ca506c1f9\n {\n class: showcase::northwind::model::geography::SalesTerritory;\n position: (806.4847354152803,653.513841427653);\n rectangle: (141.58333110809326,72.0);\n }\n classView 37cda7f9-22dc-4e75-ad3a-a5599d88772a\n {\n class: showcase::northwind::model::inventory::ProductCategory;\n position: (786.770946360032,-49.13039766561275);\n rectangle: (175.1082781744508,86.0);\n }\n classView 09710ba2-c255-4222-a85d-50520d5eae95\n {\n class: showcase::northwind::model::inventory::Supplier;\n position: (768.5537612977755,206.91393580644078);\n rectangle: (179.4666690826416,142.0);\n }\n classView df47922a-2b8a-4b12-b835-d7c75a694670\n {\n class: showcase::northwind::model::crm::Customer;\n position: (382.36050099956327,131.63043674809185);\n rectangle: (236.94999885559082,128.0);\n }\n classView 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1\n {\n class: showcase::northwind::model::geography::SalesRegion;\n position: (806.4847354152804,492.60599452399185);\n rectangle: (133.0166654586792,58.0);\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Customer.address;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(500.8355004273587,195.63043674809185),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.shipper;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 51d867fc-1dce-4979-9120-d10a551e23a7;\n points: [(176.67764553734634,421.84316585774513),(-151.24686393420714,422.4990577970102)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.orders;\n source: 51d867fc-1dce-4979-9120-d10a551e23a7;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(-151.24686393420714,422.4990577970102),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.lineItems;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(176.67764553734634,421.84316585774513),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.order;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(177.4279929346626,-0.09376541035831565),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::Order.shipToAddress;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(176.67764553734634,421.84316585774513),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.customer;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: df47922a-2b8a-4b12-b835-d7c75a694670;\n points: [(176.67764553734634,421.84316585774513),(500.8355004273587,195.63043674809185)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.orders;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(500.8355004273587,195.63043674809185),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::inventory::Supplier.address;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(858.2870958390963,277.9139358064408),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.orders;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(506.70383802904576,686.7157363134539),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.employee;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(176.67764553734634,421.84316585774513),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Employee.address;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(506.70383802904576,686.7157363134539),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.category;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n points: [(505.5311069343737,-5.903043805437704),(874.3250854472574,-6.1303976656127475)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.products;\n source: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(874.3250854472574,-6.1303976656127475),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.orderLineItems;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(505.5311069343737,-5.903043805437704),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.product;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(177.4279929346626,-0.09376541035831565),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.supplier;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 09710ba2-c255-4222-a85d-50520d5eae95;\n points: [(505.5311069343737,-5.903043805437704),(858.2870958390963,277.9139358064408)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.products;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(858.2870958390963,277.9139358064408),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.employees;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(877.2764009693269,689.513841427653),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.territories;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(506.70383802904576,686.7157363134539),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.territories;\n source: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(872.99306814462,521.6059945239919),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.region;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n points: [(877.2764009693269,689.513841427653),(872.99306814462,521.6059945239919)];\n }\n}\n\n\n###DataSpace\nDataSpace showcase::northwind::dataspace::NorthwindDataSpaceWithExecutables\n{\n executionContexts:\n [\n {\n name: 'externally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'externally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n }\n ];\n defaultExecutionContext: 'externally-public-PROD';\n executables:\n [\n {\n title: 'Northwind Data Space -Shipper Validation Defects';\n description: 'Shipper Validation Defects';\n executable: showcase::northwind::services::graph::ShipperValidationDefects;\n },\n {\n id: my_id;\n title: 'this is title - Top Categories';\n description: 'this is description - TopCategories';\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n executionContextKey: 'externally-public-PROD';\n }\n ];\n}\n\n\n###Service\nService showcase::northwind::services::graph::OrderDetailsByIdGraphFetch\n{\n pattern: '/orderDetailsByIdGraphFetch/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: id: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $id\n )->graphFetch(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::graph::ShipperValidationDefects\n{\n pattern: '/shipperValidationDefects';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::ShippingCompany.all()->graphFetchChecked(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::OrderDetailsByIdTDS\n{\n pattern: '/orderDetailsByIdTDS/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: orderId: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $orderId\n )->project(\n [\n x: showcase::northwind::model::Order[1]|$x.id,\n x: showcase::northwind::model::Order[1]|$x.customer.companyName,\n x: showcase::northwind::model::Order[1]|$x.employee.firstName,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.quantity,\n x: showcase::northwind::model::Order[1]|$x.shipper.name\n ],\n [\n 'Order Id',\n 'Customer/Company Name',\n 'Employee/First Name',\n 'Order Line Items/Product/Product Name',\n 'Order Line Items/Product/Category/Category Name',\n 'Order Line Items/Quantity',\n 'Shipper/Company Name'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'a simple passing validation with static parameter';\n params:[\n |10248\n ];\n assertions:[\n rowCountGreaterThan10: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Employee/First Name')->startsWith('T')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected no Employee/First Name to begin with the letter T')\n ];\n }\n ]\n}\n\nService showcase::northwind::services::tds::TopCategories\n{\n pattern: '/topCategories';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::ProductRankingWithinCategory\n{\n pattern: '/productRankingWithinCategory';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::inventory::ProductCategory.all()->groupBy(\n [\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.name,\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.name\n ],\n [\n agg(\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.orderLineItems.order.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Name',\n 'Products/Product Name',\n 'OrderCount'\n ]\n )->olapGroupBy(\n ['Category Name'],\n desc('OrderCount'),\n x: meta::pure::tds::TDSRow[*]|$x->rank(),\n 'Rank Within Category'\n )->sort(\n [\n asc('Category Name'),\n asc('Rank Within Category')\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::Customers\n{\n pattern: '/customers';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n [\n x: showcase::northwind::model::crm::Customer[1]|$x.id,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyName,\n x: showcase::northwind::model::crm::Customer[1]|$x.contactName,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyTitle,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.country,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.address,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.city,\n x: showcase::northwind::model::crm::Customer[1]|$x.telephoneNumber\n ],\n [\n 'Customer Id',\n 'Company Name',\n 'Contact Name',\n 'Company Title',\n 'Country',\n 'Address',\n 'City',\n 'Phone'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'A simple passing validation';\n params:[\n\n ];\n assertions:[\n noCompanyNamedAroundtheHorn: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Company Name')->contains('Around the Hornsss')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected there is no company named Around the Hornsss')\n ];\n }\n ]\n}\n\n\n###Relational\nDatabase showcase::northwind::store::NorthwindDatabase\n(\n Schema NORTHWIND\n (\n Table CATEGORIES\n (\n CATEGORY_ID SMALLINT PRIMARY KEY,\n CATEGORY_NAME VARCHAR(15) NOT NULL,\n DESCRIPTION VARCHAR(256),\n PICTURE OTHER\n )\n Table CUSTOMERS\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24)\n )\n Table CUSTOMER_CUSTOMER_DEMO\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY\n )\n Table CUSTOMER_DEMOGRAPHICS\n (\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_DESC VARCHAR(256)\n )\n Table EMPLOYEES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n LAST_NAME VARCHAR(20) NOT NULL,\n FIRST_NAME VARCHAR(10) NOT NULL,\n TITLE VARCHAR(30),\n TITLE_OF_COURTESY VARCHAR(25),\n BIRTH_DATE DATE,\n HIRE_DATE DATE,\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n HOME_PHONE VARCHAR(24),\n EXTENSION VARCHAR(4),\n PHOTO OTHER,\n NOTES OTHER,\n REPORTS_TO SMALLINT,\n PHOTO_PATH VARCHAR(255)\n )\n Table EMPLOYEE_TERRITORIES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n TERRITORY_ID VARCHAR(20) PRIMARY KEY\n )\n Table ORDERS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n CUSTOMER_ID VARCHAR(5),\n EMPLOYEE_ID SMALLINT,\n ORDER_DATE DATE,\n REQUIRED_DATE DATE,\n SHIPPED_DATE DATE,\n SHIP_VIA SMALLINT,\n FREIGHT OTHER,\n SHIP_NAME VARCHAR(40),\n SHIP_ADDRESS VARCHAR(60),\n SHIP_CITY VARCHAR(15),\n SHIP_REGION VARCHAR(15),\n SHIP_POSTAL_CODE VARCHAR(10),\n SHIP_COUNTRY VARCHAR(15)\n )\n Table ORDER_DETAILS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n PRODUCT_ID SMALLINT PRIMARY KEY,\n UNIT_PRICE OTHER NOT NULL,\n QUANTITY SMALLINT NOT NULL,\n DISCOUNT OTHER NOT NULL\n )\n Table PRODUCTS\n (\n PRODUCT_ID SMALLINT PRIMARY KEY,\n PRODUCT_NAME VARCHAR(40) NOT NULL,\n SUPPLIER_ID SMALLINT,\n CATEGORY_ID SMALLINT,\n QUANTITY_PER_UNIT VARCHAR(20),\n UNIT_PRICE OTHER,\n UNITS_IN_STOCK SMALLINT,\n UNITS_ON_ORDER SMALLINT,\n REORDER_LEVEL SMALLINT,\n DISCONTINUED INTEGER NOT NULL\n )\n Table REGION\n (\n REGION_ID SMALLINT PRIMARY KEY,\n REGION_DESCRIPTION VARCHAR(60) NOT NULL\n )\n Table SHIPPERS\n (\n SHIPPER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n PHONE VARCHAR(24) NOT NULL\n )\n Table SUPPLIERS\n (\n SUPPLIER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24),\n HOMEPAGE VARCHAR(256)\n )\n Table TERRITORIES\n (\n TERRITORY_ID VARCHAR(20) PRIMARY KEY,\n TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,\n REGION_ID SMALLINT NOT NULL\n )\n Table US_STATES\n (\n STATE_ID SMALLINT PRIMARY KEY,\n STATE_NAME VARCHAR(100),\n STATE_ABBR VARCHAR(2),\n STATE_REGION VARCHAR(50)\n )\n )\n\n Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)\n Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)\n Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)\n Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)\n Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)\n Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)\n Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)\n Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)\n Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)\n Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)\n Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)\n Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)\n Join SUPPLIERS_REGION(NORTHWIND.SUPPLIERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join ORDERS_REGION(NORTHWIND.ORDERS.SHIP_REGION = NORTHWIND.REGION.REGION_ID)\n Join CUSTOMERS_REGION(NORTHWIND.CUSTOMERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_REGION(NORTHWIND.EMPLOYEES.REGION = NORTHWIND.REGION.REGION_ID)\n)\n\n\n###Pure\nEnum showcase::northwind::model::crm::Title\n{\n Mr,\n Mrs,\n Miss,\n Ms,\n Dr,\n Sir,\n Professor,\n Duchess,\n Duke\n}\n\nClass showcase::northwind::model::crm::Employee\n[\n dateOfBirthNotInTheFuture: $this.dateOfBirth <\n now(),\n dateOfBirthValid: $this.dateOfBirth > %1900-01-01,\n employeeIsOverEighteen: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) >= 18,\n employeeIsUnderEighty: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) < 80,\n notDateOfHireNotBeforeDateOfBirth: $this.dateOfHire >\n $this.dateOfBirth\n]\n{\n id: Integer[1];\n lastName: String[1];\n firstName: String[1];\n title: String[0..1];\n preferredTitle: showcase::northwind::model::crm::Title[0..1];\n dateOfBirth: StrictDate[0..1];\n dateOfHire: StrictDate[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n homeTelephoneNumber: String[0..1];\n extension: String[0..1];\n fullName() {if(\n $this.preferredTitle->isNotEmpty(),\n |$this.preferredTitle->toOne()->toString() + ' ',\n |if(\n $this.title->isNotEmpty(),\n |$this.title->toOne() + ' ',\n |''\n )\n) + $this.firstName + ' ' + $this.lastName}: String[1];\n}\n\nClass showcase::northwind::model::Order\n{\n id: Integer[1];\n createdDate: StrictDate[0..1];\n requiredDate: StrictDate[0..1];\n shippedDate: StrictDate[0..1];\n shipToName: String[0..1];\n shipToAddress: showcase::northwind::model::geography::Address[0..1];\n itemCount() {$this.lineItems->count()}: Integer[1];\n}\n\nClass showcase::northwind::model::geography::Address\n{\n address: String[0..1];\n city: String[0..1];\n postalCode: String[0..1];\n region: String[0..1];\n country: String[0..1];\n}\n\nClass showcase::northwind::model::inventory::Product\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n quantityPerUnit: String[0..1];\n unitsInStock: Integer[0..1];\n unitsOnOrder: Integer[0..1];\n reorderLevel: Integer[0..1];\n discontinued: Integer[1];\n}\n\nClass showcase::northwind::model::inventory::Supplier\n{\n id: Integer[1];\n companyName: String[1];\n contactName: String[0..1];\n contactTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n homepageUrl: String[0..1];\n}\n\nClass showcase::northwind::model::crm::Customer\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n companyName: String[1];\n contactName: String[0..1];\n companyTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n}\n\nClass showcase::northwind::model::crm::CustomerDemographic\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::crm::ShippingCompany\n[\n idNotNegative: $this.id >= 0,\n telephoneNumberFormatValid: $this.telephoneNumber->isEmpty() ||\n $this.telephoneNumber->toOne()->matches('(1-)?\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d')\n]\n{\n id: Integer[1];\n name: String[1];\n telephoneNumber: String[1];\n}\n\nClass showcase::northwind::model::geography::USState\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->isEmpty() ||\n ($this.name->toOne()->length() > 0)\n]\n{\n id: Integer[1];\n name: String[0..1];\n code: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesRegion\n[\n idNotNegative: $this.id >= 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: Integer[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::inventory::ProductCategory\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::OrderLineItem\n{\n quantity: Integer[1];\n unitPrice: Float[1];\n unitPriceCurrency: String[1];\n}\n\nClass showcase::northwind::model::geography::SalesTerritory\n[\n idNotBlank: $this.id->length() > 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: String[1];\n description: String[1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Employee\n{\n orders: showcase::northwind::model::Order[*];\n employee: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Category\n{\n category: showcase::northwind::model::inventory::ProductCategory[0..1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Product_Suppliers\n{\n supplier: showcase::northwind::model::inventory::Supplier[1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::OrderLineItem_Product\n{\n orderLineItems: showcase::northwind::model::OrderLineItem[*];\n product: showcase::northwind::model::inventory::Product[1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Customer\n{\n orders: showcase::northwind::model::Order[*];\n customer: showcase::northwind::model::crm::Customer[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_OrderLineItem\n{\n order: showcase::northwind::model::Order[1];\n lineItems: showcase::northwind::model::OrderLineItem[*];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Employees\n{\n employees: showcase::northwind::model::crm::Employee[*];\n territories: showcase::northwind::model::geography::SalesTerritory[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Shipper\n{\n orders: showcase::northwind::model::Order[*];\n shipper: showcase::northwind::model::crm::ShippingCompany[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Region\n{\n region: showcase::northwind::model::geography::SalesRegion[1];\n territories: showcase::northwind::model::geography::SalesTerritory[1..*];\n}\n\nAssociation showcase::northwind::model::associations::Customer_CustomerDemographics\n{\n customers: showcase::northwind::model::crm::Customer[*];\n demographics: showcase::northwind::model::crm::CustomerDemographic[*];\n}\n\nAssociation showcase::northwind::model::associations::Employee_Manager\n{\n reports: showcase::northwind::model::crm::Employee[*];\n manager: showcase::northwind::model::crm::Employee[0..1];\n}\n\n\n###Mapping\nMapping showcase::northwind::mapping::NorthwindMapping\n(\n showcase::northwind::model::inventory::ProductCategory[Category]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_NAME,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.DESCRIPTION\n }\n showcase::northwind::model::crm::Customer[Customer]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_NAME,\n companyTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.FAX\n }\n showcase::northwind::model::crm::Employee[Employee]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID,\n lastName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.LAST_NAME,\n firstName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.FIRST_NAME,\n title: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE,\n preferredTitle: EnumerationMapping TitleMapping: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE_OF_COURTESY,\n dateOfBirth: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.BIRTH_DATE,\n dateOfHire: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HIRE_DATE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.COUNTRY\n ),\n homeTelephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HOME_PHONE,\n extension: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EXTENSION\n }\n showcase::northwind::model::Order[Order]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID,\n createdDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_DATE,\n requiredDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.REQUIRED_DATE,\n shippedDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIPPED_DATE,\n shipToName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_NAME,\n shipToAddress\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_COUNTRY\n )\n }\n showcase::northwind::model::OrderLineItem[OrderLineItem]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.ORDER_ID,\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS\n quantity: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.QUANTITY,\n unitPrice: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.UNIT_PRICE,\n unitPriceCurrency: 'USD'\n }\n showcase::northwind::model::inventory::Product[Product]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_NAME,\n quantityPerUnit: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.QUANTITY_PER_UNIT,\n unitsInStock: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_IN_STOCK,\n unitsOnOrder: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_ON_ORDER,\n reorderLevel: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.REORDER_LEVEL,\n discontinued: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.DISCONTINUED\n }\n showcase::northwind::model::geography::SalesRegion[Region]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_DESCRIPTION\n }\n showcase::northwind::model::crm::ShippingCompany[Shipper]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.COMPANY_NAME,\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.PHONE\n }\n showcase::northwind::model::inventory::Supplier[Supplier]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_NAME,\n contactTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.FAX,\n homepageUrl: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.HOMEPAGE\n }\n showcase::northwind::model::geography::SalesTerritory[Territory]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_DESCRIPTION\n }\n showcase::northwind::model::geography::USState[USState]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_NAME,\n code: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ABBR\n }\n\n showcase::northwind::model::associations::Order_Customer: Relational\n {\n AssociationMapping\n (\n orders[Customer,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS,\n customer[Order,Customer]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS\n )\n }\n showcase::northwind::model::associations::Order_Employee: Relational\n {\n AssociationMapping\n (\n orders[Employee,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES,\n employee[Order,Employee]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES\n )\n }\n showcase::northwind::model::associations::Order_Shipper: Relational\n {\n AssociationMapping\n (\n orders[Shipper,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS,\n shipper[Order,Shipper]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS\n )\n }\n showcase::northwind::model::associations::Order_OrderLineItem: Relational\n {\n AssociationMapping\n (\n order[OrderLineItem,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS,\n lineItems[Order,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS\n )\n }\n showcase::northwind::model::associations::OrderLineItem_Product: Relational\n {\n AssociationMapping\n (\n orderLineItems[Product,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS,\n product[OrderLineItem,Product]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS\n )\n }\n showcase::northwind::model::associations::Product_Category: Relational\n {\n AssociationMapping\n (\n category[Product,Category]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES,\n products[Category,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES\n )\n }\n showcase::northwind::model::associations::Product_Suppliers: Relational\n {\n AssociationMapping\n (\n supplier[Product,Supplier]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS,\n products[Supplier,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS\n )\n }\n showcase::northwind::model::associations::Terriroties_Region: Relational\n {\n AssociationMapping\n (\n region[Territory,Region]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION,\n territories[Region,Territory]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION\n )\n }\n showcase::northwind::model::associations::Terriroties_Employees: Relational\n {\n AssociationMapping\n (\n employees[Territory,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES,\n territories[Employee,Territory]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES\n )\n }\n showcase::northwind::model::associations::Employee_Manager: Relational\n {\n AssociationMapping\n (\n reports[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS,\n manager[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS\n )\n }\n\n showcase::northwind::model::crm::Title: EnumerationMapping TitleMapping\n {\n Mr: ['Mr.'],\n Mrs: ['Mrs.'],\n Miss: ['Miss.'],\n Ms: ['Ms.'],\n Dr: ['Dr.'],\n Sir: ['Sir.'],\n Professor: ['Prof.'],\n Duchess: ['Duchess.'],\n Duke: ['Duke.']\n }\n)\n\n\n###Runtime\nRuntime showcase::northwind::runtime::NorthwindRuntime\n{\n mappings:\n [\n showcase::northwind::mapping::NorthwindMapping\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1:\n #{\n RelationalDatabaseConnection\n {\n store: showcase::northwind::store::NorthwindDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'call loadNorthwindData()'\n ];\n };\n auth: DefaultH2;\n }\n }#\n ]\n ];\n}\n"},{"title":"Stereotypes","documentation":"TODO: Some dummy description","development":true,"path":"Model/Leverage profiles in your model/Stereotypes","code":""},{"title":"Super types","documentation":"TODO: Some dummy description","development":true,"path":"Model/Leverage profiles in your model/Super types","code":""},{"title":"Tagged values","documentation":"TODO: Some dummy description","development":true,"path":"Model/Leverage profiles in your model/Tagged values","code":""},{"title":"Markdown","documentation":"TODO: Some dummy description","development":true,"path":"Model/Use text elements/Text/Markdown","code":"\r\n"},{"title":"Mermaid","documentation":"TODO: Some dummy description","development":true,"path":"Model/Use text elements/Text/Mermaid","code":"\r\n"},{"title":"Service Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Elastic Store/Connection","code":""},{"title":"Elastic Store Mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Elastic Store/Mapping","code":""},{"title":"Elastic Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Elastic Store/Store","code":""},{"title":"Model Store Connection","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Connection","code":""},{"title":"Association - Inheritance","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/association/inheritance","code":""},{"title":"Association - ClassMappingByClass","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/classMappingByClass","code":""},{"title":"Association - ClassMappingFilterWithInnerJoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/classMappingFilterWithInnerJoin","code":""},{"title":"DataType","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/dataType","code":""},{"title":"Dates - datetime","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/dates/datetime","code":""},{"title":"Dates - strictdate","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/dates/strictdate","code":""},{"title":"Distinct","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/distinct","code":""},{"title":"Dynajoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/dynajoin","code":""},{"title":"Enumeration","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/enumeration","code":""},{"title":"Extend - all","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/all","code":""},{"title":"Extend - distinct","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/distinct","code":""},{"title":"Extend - embeddedPropertyMapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/embeddedPropertyMapping","code":""},{"title":"Extend - filter","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/filter","code":""},{"title":"Extend - groupBy","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/groupBy","code":""},{"title":"Extent - inlineEmbeddedPropertyMapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/inlineEmbeddedPropertyMapping","code":""},{"title":"Extend - mainTable","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/mainTable","code":""},{"title":"Extend - model","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/model","code":""},{"title":"Extend - primaryKey","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/primaryKey","code":""},{"title":"Extend - propertyMapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/propertyMapping","code":""},{"title":"Extend - store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/store","code":""},{"title":"Extend - storeSubstitution","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/storeSubstitution","code":""},{"title":"Extend - Union","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/extend/union","code":""},{"title":"Extend - Filter","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/filter","code":""},{"title":"GroupBy","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/groupBy","code":""},{"title":"In","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/in","code":""},{"title":"Include","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/include","code":""},{"title":"Inheritance - Cross","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/inheritance/cross","code":""},{"title":"Inheritance - Relational - multiJoins","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/inheritance/relational/multiJoins","code":""},{"title":"Inheritance - Relational - selfJoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/inheritance/relational/selfJoin","code":""},{"title":"Inheritance - Relational - union","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/inheritance/relational/union","code":""},{"title":"Innerjoin - Isolation","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/innerJoin/isolation","code":""},{"title":"Join","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/join","code":""},{"title":"Merge","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/merge","code":""},{"title":"Multigrain","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/multigrain","code":""},{"title":"Propertyfunc - simple","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/propertyfunc/simple","code":""},{"title":"Propertyfunc - withjoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/propertyfunc/withjoin","code":""},{"title":"SelfJoin","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/selfJoin","code":""},{"title":"Model To Model Service - Querying _Firm using json input","description":"Mapping of Firm to _Firm with tests and a service fetching _Firm output","documentation":"This project showcases a model to model mapping from `Firm` to `_Firm` outlining a mapping test and a service test for model to model.","path":"Store/Model Store/Mapping/service/basic","code":"###Data\nData data::IBMFirmData\n{\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\": [\\n {\\n \"firstName\": \"John\",\\n \"lastName\": \"Smith\"\\n }\\n ],\\n \"legalName\": \"IBM\",\\n \"type\": \"llc\"\\n}';\n }#\n}\n\n\n###Service\nService mapping::FirmService\n{\n pattern: '/83a0d72d-e69d-453e-8f23-8059767aeab7';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |model::target::_Firm.all()->graphFetch(\n #{\n model::target::_Firm{\n myLegalName,\n name,\n employees{\n fullName\n }\n }\n }#\n )->serialize(\n #{\n model::target::_Firm{\n myLegalName,\n name,\n employees{\n fullName\n }\n }\n }#\n );\n mapping: mapping::ModelToModelMapping;\n runtime: mapping::FirmRuntime;\n }\n testSuites:\n [\n testSuite_1:\n {\n data:\n [\n connections:\n [\n connection_1:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\": [\\n {\\n \"firstName\": \"John\",\\n \"lastName\": \"Smith\"\\n }\\n ],\\n \"legalName\": \"IBM\",\\n \"type\": \"llc\"\\n}';\n }#\n ]\n ]\n tests:\n [\n test_1:\n {\n serializationFormat: PURE;\n asserts:\n [\n assertion_1:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"myLegalName()\": \"my name is: IBM\",\\n \"name\": \"IBM\",\\n \"employees\": [\\n {\\n \"fullName\": \"John Smith\"\\n }\\n ]\\n}';\n }#;\n }#\n ]\n }\n ]\n }\n ]\n}\n\n\n###Pure\nEnum model::target::IncType\n{\n LLC,\n CORP\n}\n\nClass model::Person\n{\n firstName: String[1];\n lastName: String[1];\n}\n\nClass model::Firm\n{\n employees: model::Person[1..*];\n legalName: String[1];\n}\n\nClass model::target::_Firm\n{\n employees: model::target::_Person[1..*];\n name: String[1];\n myLegalName() {'my name is: ' + $this.name}: String[1];\n}\n\nClass model::target::_Person\n{\n fullName: String[1];\n}\n\n\n###Mapping\nMapping mapping::ModelToModelMapping\n(\n *model::target::_Person: Pure\n {\n ~src model::Person\n fullName: $src.firstName + ' ' + $src.lastName\n }\n *model::target::_Firm: Pure\n {\n ~src model::Firm\n employees[model_target__Person]: $src.employees,\n name: $src.legalName\n }\n\n model::target::IncType: EnumerationMapping\n {\n LLC: ['llc'],\n CORP: ['corp']\n }\n\n testSuites:\n [\n FirmSuite:\n {\n function: |model::target::_Firm.all()->graphFetch(\n #{\n model::target::_Firm{\n employees{\n fullName\n },\n name,\n myLegalName\n }\n }#\n)->serialize(\n #{\n model::target::_Firm{\n employees{\n fullName\n },\n name,\n myLegalName\n }\n }#\n);\n tests:\n [\n AppleData:\n {\n doc: 'This test will use Apple Data and assert the transformation.';\n data:\n [\n ModelStore:\n ModelStore\n #{\n model::Firm:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\": [\\n {\\n \"firstName\": \"firstEmployeeName\",\\n \"lastName\": \"secondEmployeeName\"\\n }\\n ],\\n \"legalName\": \"Apple Inc\"\\n}';\n }#\n }#\n ];\n asserts:\n [\n expectedAssertion:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\" : [ {\\n \"fullName\" : \"firstEmployeeName secondEmployeeName\"\\n } ],\\n \"name\" : \"Apple Inc\",\\n \"myLegalName()\" : \"my name is: Apple Inc\"\\n}';\n }#;\n }#\n ];\n },\n GoogleData:\n {\n data:\n [\n ModelStore:\n ModelStore\n #{\n model::Firm:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\": [\\n {\\n \"firstName\": \"firstEmployeeName\",\\n \"lastName\": \"secondEmployeeName\"\\n }\\n ],\\n \"legalName\": \"Google\"\\n}';\n }#\n }#\n ];\n asserts:\n [\n expectedAssertion:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\r\\n \"employees\" : [ {\\r\\n \"fullName\" : \"firstEmployeeName secondEmployeeName\"\\r\\n } ],\\r\\n \"name\" : \"Google\",\\r\\n \"myLegalName()\" : \"my name is: Google\"\\r\\n}';\n }#;\n }#\n ];\n },\n IBMData:\n {\n doc: '';\n data:\n [\n ModelStore:\n ModelStore\n #{\n model::Firm:\n Reference\n #{\n data::IBMFirmData\n }#\n }#\n ];\n asserts:\n [\n expectedAssertion:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\r\\n \"employees\" : [ {\\r\\n \"fullName\" : \"John Smith\"\\r\\n } ],\\r\\n \"name\" : \"IBM\",\\r\\n \"myLegalName()\" : \"my name is: IBM\"\\r\\n}';\n }#;\n }#\n ];\n },\n IBMData2:\n {\n doc: '';\n data:\n [\n ModelStore:\n ModelStore\n #{\n model::Firm:\n Reference\n #{\n data::IBMFirmData\n }#\n }#\n ];\n asserts:\n [\n expectedAssertion:\n EqualToJson\n #{\n expected:\n ExternalFormat\n #{\n contentType: 'application/json';\n data: '{\\n \"employees\" : [ {\\n \"fullName\" : \"John Smith\"\\n } ],\\n \"name\" : \"IBM\",\\n \"myLegalName()\" : \"my name is: IBM\"\\n}';\n }#;\n }#\n ];\n }\n ];\n }\n ]\n)\n\n\n###Connection\nJsonModelConnection mapping::FirmConnection\n{\n class: model::Firm;\n url: 'data:application/json,%7B%7D';\n}\n\n\n###Runtime\nRuntime mapping::FirmRuntime\n{\n mappings:\n [\n mapping::ModelToModelMapping\n ];\n connections:\n [\n ModelStore:\n [\n connection_1: mapping::FirmConnection\n ]\n ];\n}\n"},{"title":"Subtype","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/subtype","code":""},{"title":"Tree","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/tree","code":""},{"title":"Union - Extend","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/extend","code":""},{"title":"Union - MultipleChainedJoins","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/multipleChainedJoins","code":""},{"title":"Union - Optimized","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/optimized","code":""},{"title":"Union - Partial","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/partial","code":""},{"title":"Union - PartialForeignKeyUsage","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/partialForeignKeyUsage","code":""},{"title":"Union - SqlQueryMerging","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Mapping/union/sqlQueryMerging","code":""},{"title":"Model Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Model Store/Store","code":""},{"title":"Mongo Store Connection","documentation":"TODO: Some dummy description","development":true,"path":"Store/Mongo Store/Connection","code":""},{"title":"Mongo Store Mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Mongo Store/Mapping","code":""},{"title":"Mongo Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Mongo Store/Store","code":""},{"title":"MongoDB Query","description":"Example of querying MongoDB","documentation":"This showcase exemplifies how we can connect to MongoDB and run queries on it.\n\nThe connection is made using the database type, store, and authentication method. In this project, we used kerberos for authentication.\nElements can be found in the domain directory, and these are all the models queries can be run on.\nThe mapping here is used to map the mongo store to a person class, and the binding in this project is used to map json to elements.\nFinally the service is how the query is run. A mapping and runtime is required for a service.","path":"Store/Mongo Store","code":"###Service\nService cde::store::mongodb::executionTest::service::PersonService\n{\n pattern: '/api/allPersons';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |cde::store::mongodb::executionTest::domain::Person.all()->filter(\n x|($x.firstName == 'Chev') ||\n ($x.birthDate > %1990-01-01T12:00:01)\n )->graphFetch(\n #{\n cde::store::mongodb::executionTest::domain::Person{\n firstName,\n lastName,\n department{\n name\n },\n firm{\n legalName\n },\n birthDate\n }\n }#\n )->serialize(\n #{\n cde::store::mongodb::executionTest::domain::Person{\n firstName,\n lastName,\n department{\n name\n },\n firm{\n legalName\n },\n birthDate\n }\n }#\n );\n mapping: cde::store::mongodb::executionTest::mapping::TestPersonMapping;\n runtime: cde::store::mongodb::executionTest::runtime::TestMongoDBRuntime;\n }\n}\n\n\n###Text\nText cde::mongoREADME\n{\n type: plainText;\n content: '---\\ntitle: MongoDB Query\\ndescription: Example of querying MongoDB\\n---\\n\\nThis showcase exemplifies how we can connect to MongoDB and run queries on it.\\n\\nThe connection is made using the database type, store, and authentication method. In this project, we used kerberos for authentication.\\nElements can be found in the domain directory, and these are all the models queries can be run on. \\nThe mapping here is used to map the mongo store to a person class, and the binding in this project is used to map json to elements.\\nFinally the service is how the query is run. A mapping and runtime is required for a service.';\n}\n\n\n###ExternalFormat\nBinding cde::store::mongodb::executionTest::binding::PersonCollectionBinding\n{\n contentType: 'application/json';\n modelIncludes: [\n cde::store::mongodb::executionTest::domain::Person,\n cde::store::mongodb::executionTest::domain::Firm,\n cde::store::mongodb::executionTest::domain::Address,\n cde::store::mongodb::executionTest::domain::Department\n ];\n}\n\n\n###MongoDB\nDatabase cde::store::mongodb::executionTest::store::mydatabase\n(\n Collection person\n (\n validationLevel: strict;\n validationAction: warn;\n jsonSchema: {\n \"bsonType\": \"object\",\n \"title\": \"Record of Firm\",\n \"properties\": {\n \"firstName\": {\n \"bsonType\": \"string\",\n \"description\": \"firstName of the person\",\n \"minLength\": 2\n },\n \"lastName\": {\n \"bsonType\": \"string\",\n \"description\": \"lastName of the person\",\n \"minLength\": 2\n },\n \"age\": {\n \"bsonType\": \"int\",\n \"description\": \"age of the person\"\n },\n \"firm\": {\n \"bsonType\": \"object\",\n \"description\": \"firm of the person\",\n \"properties\": {\n \"legalName\": {\n \"bsonType\": \"string\",\n \"description\": \"legal name of the firm\"\n },\n \"address\": {\n \"bsonType\": \"string\",\n \"description\": \"address of the firm\"\n }\n },\n \"additionalProperties\": false\n }\n },\n \"additionalProperties\": false\n };\n )\n)\n\n\n###Pure\nClass cde::store::mongodb::executionTest::domain::Address\n{\n city: String[1];\n buildingNumber: Integer[0..1];\n isActive: Boolean[0..1];\n lastUpdated: DateTime[1];\n}\n\nClass cde::store::mongodb::executionTest::domain::Department\n{\n name: String[1];\n numberOfEmployees: Integer[0..1];\n dateCreated: DateTime[1];\n isActive: Boolean[1];\n}\n\nClass cde::store::mongodb::executionTest::domain::Firm\n{\n legalName: String[0..1];\n numberOfEmployees: Integer[1];\n dateFounded: DateTime[1];\n phoneNumbers: String[1..*];\n yearsAwarded: Integer[1..*];\n address: cde::store::mongodb::executionTest::domain::Address[0..1];\n public: Boolean[0..1];\n}\n\nClass cde::store::mongodb::executionTest::domain::Person\n{\n firstName: String[0..1];\n lastName: String[1];\n age: Integer[0..1];\n birthDate: DateTime[1];\n otherPhoneNumbers: String[*];\n yearsEmployed: Integer[1..*];\n legallyCompetent: Boolean[1];\n address: cde::store::mongodb::executionTest::domain::Address[1];\n firm: cde::store::mongodb::executionTest::domain::Firm[0..1];\n}\n\nAssociation cde::store::mongodb::executionTest::domain::Firm_Department\n{\n firm: cde::store::mongodb::executionTest::domain::Firm[0..1];\n department: cde::store::mongodb::executionTest::domain::Department[*];\n}\n\nAssociation cde::store::mongodb::executionTest::domain::Person_Department\n{\n person: cde::store::mongodb::executionTest::domain::Person[0..1];\n department: cde::store::mongodb::executionTest::domain::Department[0..1];\n}\n\n\n###Mapping\nMapping cde::store::mongodb::executionTest::mapping::TestPersonMapping\n(\n *cde::store::mongodb::executionTest::domain::Person[Person]: MongoDB\n {\n ~mainCollection [cde::store::mongodb::executionTest::store::mydatabase] person\n ~binding cde::store::mongodb::executionTest::binding::PersonCollectionBinding\n }\n)\n\n\n###Connection\nMongoDBConnection cde::store::mongodb::executionTest::connection::testConnection\n{\n database: mongo-query-poc;\n store: cde::store::mongodb::executionTest::store::mydatabase;\n serverURLs: [d1234.url.com:123];\n authentication: # Kerberos {\n }#;\n}\n\n\n###Runtime\nRuntime cde::store::mongodb::executionTest::runtime::TestMongoDBRuntime\n{\n mappings:\n [\n cde::store::mongodb::executionTest::mapping::TestPersonMapping\n ];\n connections:\n [\n cde::store::mongodb::executionTest::store::mydatabase:\n [\n connection_1: cde::store::mongodb::executionTest::connection::testConnection\n ]\n ];\n}\n"},{"title":"Relational Database Connection BigQuery with Default Credentials","description":"BigQuery connection using only default credentials. Does not include proxy.","documentation":"","path":"Store/Relational Store/Connection/BigQuery/DefaultCredentials","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: BigQuery;\n specification: BigQuery\n {\n projectId: 'proj1';\n defaultDataset: 'dataset1';\n };\n auth: GCPApplicationDefaultCredentials;\n}\n"},{"title":"Relational Database Connection BigQuery with Default Credentials and Proxy","description":"BigQuery connection using only default credentials. Does include proxy.","documentation":"","path":"Store/Relational Store/Connection/BigQuery/DefaultCredentialsWithProxy","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: BigQuery;\n specification: BigQuery\n {\n projectId: 'proj1';\n defaultDataset: 'dataset1';\n proxyHost: 'proxyHost1';\n proxyPort: 'proxyPort1';\n };\n auth: GCPApplicationDefaultCredentials;\n}\n"},{"title":"Relational Database Connection BigQuery with Identity Federation","description":"BigQuery connection using Identity Federation.","documentation":"","path":"Store/Relational Store/Connection/BigQuery/IdentityFederation","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: BigQuery;\n specification: BigQuery\n {\n projectId: 'proj1';\n defaultDataset: 'dataset1';\n };\n auth: GCPWorkloadIdentityFederation\n {\n serviceAccountEmail: 'name';\n };\n}\n"},{"title":"Relational Database Connection BigQuery with Identity Federation additional scopes","description":"BigQuery connection using Identity Federation including additional scopes.","documentation":"","path":"Store/Relational Store/Connection/BigQuery/IdentityFederationWithScopes","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: BigQuery;\n specification: BigQuery\n {\n projectId: 'proj1';\n defaultDataset: 'dataset1';\n };\n auth: GCPWorkloadIdentityFederation\n {\n serviceAccountEmail: 'name';\n additionalGcpScopes: [\n 'gcpScope',\n 'anotherGcpScope'\n ];\n };\n}\n"},{"title":"Relational Database Connection Databricks","description":"Examples of all valid Databricks connection specs","documentation":"","path":"Store/Relational Store/Connection/Databricks","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection\n{\n store: store::Store;\n type: Databricks;\n specification: Databricks\n {\n hostname: 'databricks.com';\n port: '443';\n protocol: 'https';\n httpPath: 'databricks/api/path';\n };\n auth: ApiToken\n {\n apiToken: 'databricks.api.token';\n };\n}"},{"title":"Relational Database Connection MemSQL","description":"Examples of all valid MemSQL connection specs","documentation":"","development":true,"path":"Store/Relational Store/Connection/MemSQL","code":""},{"title":"Relational Database Connection Postgres","description":"Examples of all valid Postgres connection specs","documentation":"","development":true,"path":"Store/Relational Store/Connection/Postgres","code":""},{"title":"Relational Database Connection SQL Server","description":"Examples of all valid SQL Server connection specs","documentation":"","development":true,"path":"Store/Relational Store/Connection/SQL Server","code":""},{"title":"Relational Database Connection Spanner","description":"Examples of all valid Spanner connection specs","documentation":"","path":"Store/Relational Store/Connection/Spanner","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::mySimpleConnection1\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n proxyHost: 'localhost';\n proxyPort: 9010;\n };\n auth: GCPApplicationDefaultCredentials;\n}\n\nRelationalDatabaseConnection connection::mySimpleConnection2\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n };\n auth: GCPApplicationDefaultCredentials;\n}\n\nRelationalDatabaseConnection connection::mySimpleConnection3\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n };\n auth: DelegatedKerberos;\n}\n\nRelationalDatabaseConnection connection::mySimpleConnection4\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n proxyHost: 'localhost';\n proxyPort: 9010;\n };\n auth: GCPWorkloadIdentityFederation\n {\n serviceAccountEmail: 'name';\n };\n}\n\nRelationalDatabaseConnection connection::mySimpleConnection5\n{\n store: store::Store;\n type: Spanner;\n specification: Spanner\n {\n projectId: 'spanner-emulator-test-1';\n instanceId: 'test-instance-1';\n databaseId: 'test-db';\n proxyHost: 'localhost';\n proxyPort: 9010;\n };\n auth: GCPWorkloadIdentityFederation\n {\n serviceAccountEmail: 'name';\n additionalGcpScopes: [\n 'gcpScope',\n 'anotherGcpScope'\n ];\n };\n}"},{"title":"Relational Database Connection Trino","description":"Examples of all valid Trino connection specs","documentation":"","path":"Store/Relational Store/Connection/Trino","code":"###Relational\nDatabase store::Store\n(\n)\n\n\n###Connection\nRelationalDatabaseConnection connection::TrinoConnection\n{\n store: store::Store;\n type: Trino;\n specification: Trino\n {\n host: 'host';\n port: 1234;\n catalog: 'tpch';\n schema: 'tiny';\n clientTags: 'cg::vega';\n sslSpecification:\n {\n ssl: false;\n trustStorePathVaultReference: 'abc12cde';\n trustStorePasswordVaultReference: 'abc12cde';\n };\n };\n auth: TrinoDelegatedKerberos\n {\n kerberosUseCanonicalHostname: false;\n kerberosRemoteServiceName: 'HTTP';\n };\n}"},{"title":"Basic Relational Database Specification","description":"Example of database specification with no explicit schema or joins","documentation":"","path":"Store/Relational Store/Database Specification/Basic","code":"###Relational\nDatabase store::SimpleDB\n(\n // There is an implicit 'default' schema \n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n)\n"},{"title":"Relational Database Specification with Filter","description":"Example of database specification with Filter","documentation":"","path":"Store/Relational Store/Database Specification/Filter","code":"###Relational\nDatabase store::SimpleDB\n(\n // There is an implicit 'default' schema \n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n\n // Filters at the database level can be shared with several mappings\n Filter largePersonIds(People.id > 100)\n)\n"},{"title":"Basic Relational Database Specification with Includes","description":"Example of database specification with other Database definitions included","documentation":"","path":"Store/Relational Store/Database Specification/Include","code":"###Relational\nDatabase store::SimpleDB\n(\n include store::IncludedDB\n\n // Definitions in included DB are available here\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n)\n\nDatabase store::IncludedDB\n(\n Table PeoplePart2\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n)"},{"title":"Relational Database Specification with Milestoning","description":"Example of database specification with Milestoning","documentation":"","path":"Store/Relational Store/Database Specification/Join/Basic","code":"###Relational\nDatabase store::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n\n Join PersonCompany(People.firm_id = Firms.id)\n // Joins can also be defined across schemas\n)\n"},{"title":"Relational Database Specification with Join placeholder","description":"Example of database specification with join placeholder.","documentation":"TODO: explain what this feature is useful for.","path":"Store/Relational Store/Database Specification/Join/Self Join","code":"###Relational\nDatabase store::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n\n Join PersonCompany(People.id = {target}.firm_id)\n)\n"},{"title":"Relational Database Specification with Bitemporal Milestoning","description":"Example of database specification with Bitemporal Milestoning.","documentation":"","path":"Store/Relational Store/Database Specification/Milestoning/Bitemporal","code":"###Relational\nDatabase store::MilestonedDB\n(\n Table BiTemporalProductTable\n (\n milestoning\n (\n processing(PROCESSING_IN = in_z, PROCESSING_OUT = out_z, INFINITY_DATE = %9999-12-31T00:00:00.0000),\n business(BUS_FROM = from_z, BUS_THRU = thru_z, INFINITY_DATE = %9999-12-31T00:00:00.0000)\n )\n\n id INTEGER PRIMARY KEY,\n type VARCHAR(200),\n in_z DATE,\n out_z DATE,\n from_z DATE,\n thru_z DATE\n )\n)"},{"title":"Relational Database Specification with Business Milestoning","description":"Example of database specification with Business Milestoning.","documentation":"","path":"Store/Relational Store/Database Specification/Milestoning/Business","code":"###Relational\nDatabase store::MilestonedDB\n(\n Table ProductTable\n (\n milestoning\n (\n // A subset of the following options can be used with the minimal being BUS_FROM and BUS_THRU\n business(BUS_FROM = from_z, BUS_THRU = thru_z, THRU_IS_INCLUSIVE = true, INFINITY_DATE = %9999-12-31T00:00:00.0000)\n )\n\n id INTEGER PRIMARY KEY,\n name VARCHAR(200) PRIMARY KEY,\n type VARCHAR(200),\n exchange VARCHAR(200),\n classificationSystemId INTEGER,\n referenceSystemName VARCHAR(200),\n externalReferenceSystemName VARCHAR(200),\n from_z DATE,\n thru_z DATE\n )\n Table ProductTableWithBusinessSnapshotMilestoning\n (\n milestoning\n (\n business(BUS_SNAPSHOT_DATE = snapshotDate)\n )\n\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n type VARCHAR(200),\n snapshotDate DATE\n )\n)\n"},{"title":"Relational Database Specification with Processing Milestoning","description":"Example of database specification with Temporal Milestoning.","documentation":"","path":"Store/Relational Store/Database Specification/Milestoning/Processing","code":"###Relational\nDatabase store::MilestonedDB\n(\n Table BiTemporalProductTableWithProcessingMilestoning\n (\n milestoning\n (\n // The minimal set of options is PROCESSING_IN and PROCESSING_OUT\n processing(PROCESSING_IN = in_z, PROCESSING_OUT = out_z, OUT_IS_INCLUSIVE = true, INFINITY_DATE = %9999-12-31T00:00:00.0000)\n )\n\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n type VARCHAR(200),\n in_z DATE,\n out_z DATE\n )\n)\n"},{"title":"Relational Database Specification with explicit Schema","description":"Example of database specification with explicit schema","documentation":"","path":"Store/Relational Store/Database Specification/Schema","code":"###Relational\nDatabase store::SimpleDB\n(\n Schema SimpleSchema\n (\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n )\n // Joins go outside the schema\n)\n"},{"title":"Relational Database Specification with Views","description":"Example of database specification with Views.","documentation":"Views are effectively transformations at the database level. They have the same syntax as Mappings but have a few different features.\nTODO: include a description on why views are required.","path":"Store/Relational Store/Database Specification/View","code":"###Relational\nDatabase store::SimpleDB\n(\n Schema SimpleSchema\n (\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n\n View ImportantPeople\n (\n id: SimpleSchema.People.id PRIMARY KEY,\n name: SimpleSchema.People.name\n )\n )\n)\n"},{"title":"Relational Querying Using Functions","description":"Example of Relational Function","documentation":"","path":"Store/Relational Store/Function","code":"###Data\nData data::RelationalData\n{\n Relational\n #{\n default.PersonTable:\n 'id,firm_id,firstName,lastName,employeeType\\n'+\n '1,1,John,Doe,FTO\\n'+\n '2,1,Nicole,Smith,FTC\\n'+\n '3,2,Time,Smith,FTE\\n';\n\n default.FirmTable:\n 'id,legal_name\\n'+\n '1,Finos\\n'+\n '2,Apple\\n';\n }#\n}\n\n\n###Relational\nDatabase store::TestDB\n(\n Table FirmTable\n (\n id INTEGER PRIMARY KEY,\n legal_name VARCHAR(200)\n )\n Table PersonTable\n (\n id INTEGER PRIMARY KEY,\n firm_id INTEGER,\n firstName VARCHAR(200),\n lastName VARCHAR(200),\n employeeType VARCHAR(200)\n )\n\n Join FirmPerson(PersonTable.firm_id = FirmTable.id)\n)\n\n\n###Pure\nClass model::Person\n{\n firstName: String[1];\n lastName: String[1];\n employeeType: model::EmployeeType[1];\n}\n\nEnum model::EmployeeType\n{\n CONTRACT,\n FULL_TIME\n}\n\nClass model::Firm\n{\n legalName: String[1];\n employees: model::Person[*];\n}\n\n\n###Mapping\nMapping execution::RelationalMapping\n(\n *model::Person: Relational\n {\n ~primaryKey\n (\n [store::TestDB]PersonTable.id\n )\n ~mainTable [store::TestDB]PersonTable\n firstName: [store::TestDB]PersonTable.firstName,\n lastName: [store::TestDB]PersonTable.lastName,\n employeeType: EnumerationMapping EmployeeTypeMapping: [store::TestDB]PersonTable.employeeType\n }\n *model::Firm: Relational\n {\n ~primaryKey\n (\n [store::TestDB]FirmTable.id\n )\n ~mainTable [store::TestDB]FirmTable\n legalName: [store::TestDB]FirmTable.legal_name,\n employees[model_Person]: [store::TestDB]@FirmPerson\n }\n\n model::EmployeeType: EnumerationMapping EmployeeTypeMapping\n {\n CONTRACT: ['FTC', 'FTO'],\n FULL_TIME: ['FTE']\n }\n)\n\n\n###Connection\nRelationalDatabaseConnection model::MyConnection\n{\n store: store::TestDB;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'Drop table if exists FirmTable;\\nDrop table if exists PersonTable;\\nCreate Table FirmTable(id INT, Legal_Name VARCHAR(200));\\nCreate Table PersonTable(id INT, firm_id INT, lastName VARCHAR(200), firstName VARCHAR(200), employeeType VARCHAR(200));\\nInsert into FirmTable (id, Legal_Name) values (1, \\'FirmA\\');\\nInsert into FirmTable (id, Legal_Name) values (2, \\'Apple\\');\\nInsert into PersonTable (id, firm_id, lastName, firstName, employeeType) values (1, 1, \\'John\\', \\'Doe\\', \\'FTC\\');\\nInsert into PersonTable (id, firm_id, lastName, firstName, employeeType) values (2, 2, \\'Tim\\', \\'Smith\\', \\'FTE\\');\\nInsert into PersonTable (id, firm_id, lastName, firstName, employeeType) values (3, 3, \\'Nicole\\', \\'Doe\\', \\'FTO\\');\\n\\n'\n ];\n };\n auth: DefaultH2;\n}\n\n\n###Runtime\nRuntime execution::Runtime\n{\n mappings:\n [\n execution::RelationalMapping\n ];\n connections:\n [\n store::TestDB:\n [\n connection_1: model::MyConnection\n ]\n ];\n}\n\n\n###Runtime\nRuntime execution::RuntimeWithStoreConnections\n{\n mappings:\n [\n execution::RelationalMapping\n ];\n connectionStores:\n [\n model::MyConnection:\n [\n store::TestDB\n ]\n ];\n}\n\n\n###Pure\nfunction model::PersonQuery(): meta::pure::tds::TabularDataSet[1]\n{\n model::Person.all()->project(\n [\n x: model::Person[1]|$x.firstName,\n x: model::Person[1]|$x.lastName\n ],\n [\n 'First Name',\n 'Last Name'\n ]\n )->from(\n execution::RelationalMapping,\n execution::Runtime\n )\n}\n\nfunction model::PersonWithParams(firstName: String[1]): meta::pure::tds::TabularDataSet[1]\n{\n model::Person.all()->filter(\n x: model::Person[1]|$x.firstName ==\n $firstName\n )->project(\n [\n x: model::Person[1]|$x.firstName,\n x: model::Person[1]|$x.lastName\n ],\n [\n 'First Name',\n 'Last Name'\n ]\n )->from(\n execution::RelationalMapping,\n execution::Runtime\n )\n}\n{\n testSuite_1\n (\n store::TestDB:\n Relational\n #{\n default.PersonTable:\n 'id,firm_id,firstName,lastName,employeeType\\n'+\n '1,1,I\\'m John,\"Doe, Jr\",FTO\\n'+\n '2,1,Nicole,Smith,FTC\\n'+\n '3,2,Time,Smith,FTE\\n';\n }#;\n testPass | PersonWithParams('Nicole') => (JSON) '[{\\n \"First Name\" : \"Nicole\",\"Last Name\" : \"Smith\"} ]';\n )\n}\n\nfunction model::PersonQuerySharedData(): meta::pure::tds::TabularDataSet[1]\n{\n model::Person.all()->project(\n [\n x: model::Person[1]|$x.firstName,\n x: model::Person[1]|$x.lastName\n ],\n [\n 'First Name',\n 'Last Name'\n ]\n )->from(\n execution::RelationalMapping,\n execution::Runtime\n )\n}\n\nfunction model::PersonWithConnectionStores(): meta::pure::tds::TabularDataSet[1]\n{\n model::Person.all()->project(\n [\n x: model::Person[1]|$x.firstName,\n x: model::Person[1]|$x.lastName\n ],\n [\n 'First Name',\n 'Last Name'\n ]\n )->from(\n execution::RelationalMapping,\n execution::RuntimeWithStoreConnections\n )\n}\n"},{"title":"SqlFunction","documentation":"TODO: Some dummy description","development":true,"path":"Store/Relational Store/Function/sqlFunction","code":""},{"title":"Relational Database Distinct Mapping","description":"A simple example of a mapping containing a distinct operator.","documentation":"","path":"Store/Relational Store/Mapping/Distinct","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleDistinctMapping\n(\n Person: Relational\n {\n ~distinct\n name: [SimpleDB]People.name\n }\n)\n\n\n###Pure\nClass models::Person\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(100)\n )\n)\n"},{"title":"Relational Database Embedded Inline Mapping","description":"An example of an inline mapping.","documentation":"","path":"Store/Relational Store/Mapping/Embedded/Inline","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleInlineMapping\n(\n Person[normalPerson]: Relational\n {\n name: [SimpleDB]People.name,\n address() Inline[USAddress],\n hobby\n (\n name: [SimpleDB]People.hobby_name\n )\n }\n Address[USAddress]: Relational\n {\n ~mainTable [SimpleDB]Addresses\n street_address: [SimpleDB]Addresses.street_address,\n zip: [SimpleDB]US_Zips.zip_code\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n address: Address[1];\n hobby: Hobby[1];\n}\n\nClass models::Hobby\n{\n name: String[1];\n}\n\nClass models::Address\n{\n street_address: String[1];\n zip: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n hobby_name VARCHAR(100)\n )\n Table Addresses\n (\n street_address VARCHAR(200)\n )\n Table US_Zips\n (\n zip_code CHAR(5)\n )\n)\n"},{"title":"Relational database inline nested mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Relational Store/Mapping/Embedded/Inline/nested","code":""},{"title":"Relational database inline targetid mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Relational Store/Mapping/Embedded/Inline/targetId","code":""},{"title":"Relational Database Otherwise Mapping","description":"A simple example of a mapping containing the otherwise operator.","documentation":"","path":"Store/Relational Store/Mapping/Embedded/Otherwise","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleOtherwiseMapping\n(\n Person: Relational\n {\n name: [SimpleDB]People.name,\n pet\n (\n name: [SimpleDB]People.pet_name\n ) Otherwise ([backupPetMapping]: [SimpleDB]@PetOwner)\n }\n Pet[backupPetMapping]: Relational\n {\n name: [SimpleDB]Pets.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n pet: Pet[1];\n}\n\nClass models::Pet\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n pet_id INTEGER,\n pet_name VARCHAR(50)\n )\n Table Pets\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(50)\n )\n\n Join PetOwner(People.pet_id = Pets.id)\n)\n"},{"title":"Relational Database Mapping with Inheritance","description":"A simple example of a mapping that demonstrates inheritance through the extends keyword.","documentation":"","path":"Store/Relational Store/Mapping/Extends","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleInheritanceMapping\n(\n Person[basePerson]: Relational\n {\n name: [SimpleDB]People.name\n }\n PromotableWorker[promotableWorker] extends [basePerson]: Relational\n {\n available_promotion_titles: [SimpleDB]Promotions.title\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\nClass models::PromotableWorker\n{\n available_promotion_titles: String[1..*];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n Table Promotions\n (\n title VARCHAR(50)\n )\n)\n"},{"title":"Relational Database Filter Mapping","description":"A simple example of a mapping that uses a filter.","documentation":"","path":"Store/Relational Store/Mapping/Filter","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleFilterMapping\n(\n Person: Relational\n {\n ~filter [SimpleDB]longNameFilter\n name: [SimpleDB]People.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n\n Filter longNameFilter(length(People.name) >= 100)\n)\n"},{"title":"Relational Database GroupBy Mapping","description":"A simple example of a mapping using the groupBy operator.","documentation":"","path":"Store/Relational Store/Mapping/GroupBy","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleGroupByMapping\n(\n Person: Relational\n {\n ~groupBy\n (\n [SimpleDB]People.firm_id\n )\n name: [SimpleDB]People.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n)\n"},{"title":"Relational Database Mapping with Includes","description":"An example of a Mapping with include statements.","documentation":"","path":"Store/Relational Store/Mapping/Include/Basic","code":"###Mapping\nimport models::*;\nimport stores::*;\nimport mappings::*;\nMapping mappings::IncludeMapping\n(\n include mapping BaseMapping\n\n Person: Relational\n {\n name: [SimpleDB]People.name\n }\n)\n\nMapping mappings::BaseMapping\n(\n Firm: Relational\n {\n name: [SimpleDB]Firms.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n\n Join FirmPerson(People.firm_id = Firms.id)\n)\n"},{"title":"Relational Database Mapping with Store Substitution","description":"An example of a Mapping using store substitution across mappings.","documentation":"Store substitution changes the store used in the included mapping.","path":"Store/Relational Store/Mapping/Include/Store Substitution","code":"###Mapping\nimport models::*;\nimport stores::*;\nimport mappings::*;\nMapping mappings::IncludeSubstitutionMapping\n(\n include mapping BaseMapping[SimpleDB->ComplexDB]\n\n Person: Relational\n {\n name: [ComplexDB]People.name\n }\n)\n\nMapping mappings::BaseMapping\n(\n Firm: Relational\n {\n name: [SimpleDB]Firms.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n)\n\nDatabase stores::ComplexDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_sector VARCHAR(50)\n )\n)"},{"title":"Relational Database Mapping with Joins","description":"A simple example of a mapping with a join.","documentation":"","path":"Store/Relational Store/Mapping/Joins/Basic","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mapping::SimpleJoinMapping\n(\n Person: Relational\n {\n name: [SimpleDB]People.name,\n firm: [SimpleDB]@FirmPerson,\n pet_name: [SimpleDB]@PersonPet | [SimpleDB]Pets.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n firm: Firm[1];\n pet_name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\nClass models::Pet\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER,\n pet_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n Table Pets\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(50)\n )\n\n Join FirmPerson(People.firm_id = Firms.id)\n Join PersonPet(People.pet_id = Pets.id)\n)\n"},{"title":"Relational Database Mapping with Chained Joins","description":"An example of a Mapping with Chained joins including setting join type.","documentation":"","path":"Store/Relational Store/Mapping/Joins/Chained","code":"###Mapping\nimport models::*;\nimport stores::*;\nMapping mappings::ChainedJoinMapping\n(\n Person: Relational\n {\n name: [SimpleDB]People.name,\n firm: [SimpleDB]@FirmPerson,\n good_pet_name: [SimpleDB]@PersonPet > (INNER) [SimpleDB]@GoodPets | [SimpleDB]Pets.name\n }\n)\n\n\n###Pure\nimport models::*;\nClass models::Person\n{\n name: String[1];\n firm: Firm[1];\n good_pet_name: String[1];\n}\n\nClass models::Firm\n{\n name: String[1];\n}\n\nClass models::Pet\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200),\n firm_id INTEGER,\n pet_id INTEGER\n )\n Table Firms\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n Table Pets\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(50)\n )\n Table GoodPets\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(50)\n )\n\n Join FirmPerson(People.firm_id = Firms.id)\n Join PersonPet(People.pet_id = Pets.id)\n Join GoodPets(Pets.id = GoodPets.id)\n)\n"},{"title":"Relational Mapping with tests","documentation":"This package contains showcase model to demonstrate relational mapping capabilities of Legend\nIn this showcase, we will show the following:\n1) Relational store specifications (schema, tables, column data types, quoting, join, self-join, filter)\n2) Relational mappings with tests\n3) Relational functions – dyna functions\n4) PURE function support","path":"Store/Relational Store/Mapping/Mapping Test","code":"###Diagram\nDiagram relationalMapping::TradeAccountDiagram\n{\n classView 2607efb4-489b-451c-9fe0-3ee0f71191db\n {\n class: relationalMapping::Trade;\n position: (1150.5257568359375,706.5);\n rectangle: (207.88623046875,184.0);\n }\n classView 3f9f55f3-0f34-4aa5-972b-6fb0d0839393\n {\n class: relationalMapping::TradeEvent;\n position: (1528.4548415786112,750.0066923369803);\n rectangle: (146.54296875,72.0);\n }\n classView dfcaa3ce-a0e4-47ca-8a08-937129ab8c5e\n {\n class: relationalMapping::Product;\n position: (763.9989051643056,565.625);\n rectangle: (247.4994525821528,150.3125);\n }\n classView 1e46b918-d9c4-4212-90b3-0b51992421dc\n {\n class: relationalMapping::Trader;\n position: (1536.7489051643056,594.1887199867499);\n rectangle: (117.796875,58.0);\n }\n classView 931cb999-5873-4fcd-8e9b-0ca4f1cf9a3f\n {\n class: relationalMapping::Synonym;\n position: (1170.9989051643056,579.625);\n rectangle: (180.54736328125,100.0);\n }\n classView 742b39b1-983a-4913-bad9-a45654973427\n {\n class: relationalMapping::AccountWithConstraints;\n position: (789.9989051643056,922.25);\n rectangle: (206.46875,58.0);\n }\n classView dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d\n {\n class: relationalMapping::Account;\n position: (804.5257568359375,756.0);\n rectangle: (179.53759765625,72.0);\n }\n propertyView\n {\n property: relationalMapping::Account.trades;\n source: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(977.9580688476562,781.5),(1204.9580688476562,782.5)];\n }\n propertyView\n {\n property: relationalMapping::Trade.account;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(1156.9580688476562,819.5),(957.9580688476562,819.5)];\n }\n propertyView\n {\n property: relationalMapping::Trade.events;\n source: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n target: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n points: [(1340.9989051643056,779.6887199867499),(1544.9989051643056,779.6887199867499)];\n }\n propertyView\n {\n property: relationalMapping::TradeEvent.trade;\n source: 3f9f55f3-0f34-4aa5-972b-6fb0d0839393;\n target: 2607efb4-489b-451c-9fe0-3ee0f71191db;\n points: [(1533.9989051643056,813.6887199867499),(1320.9989051643056,813.6887199867499)];\n }\n generalizationView\n {\n source: 742b39b1-983a-4913-bad9-a45654973427;\n target: dbbcb7fc-5ca1-485d-a9e6-86bcb5813b9d;\n points: [(893.2332801643056,951.25),(894.2945556640625,792.0)];\n }\n}\n\n\n###Text\nText relationalMapping::README\n{\n type: markdown;\n content: '### Relational Mapping Showcase\\n\\nThis package contains showcase model to demonstrate relational mapping capabilities of Legend\\nIn this showcase, we will show the following:\\n1) Relational store specifications (schema, tables, column data types, quoting, join, self-join, filter)\\n2) Relational mappings with tests\\n3) Relational functions \\u2013 dyna functions\\n4) PURE function support\\n';\n}\n\n\n###Relational\nDatabase relationalMapping::TradeAccountDb\n(\n Schema productSchema\n (\n Table synonymTable\n (\n ID INTEGER PRIMARY KEY,\n PROD_ID INTEGER,\n TYPE VARCHAR(200),\n NAME VARCHAR(200)\n )\n Table productTable\n (\n ID INTEGER PRIMARY KEY,\n PROD_CLASSIFICATION_ID INTEGER,\n NAME VARCHAR(200)\n )\n Table productClassificationTable\n (\n ID INTEGER PRIMARY KEY,\n TYPE VARCHAR(200),\n DESCRIPTION VARCHAR(200)\n )\n )\n\n Table tradeTable\n (\n ID INTEGER PRIMARY KEY,\n PROD_ID INTEGER,\n ACCOUNT_ID INTEGER,\n QUANTITY FLOAT,\n TRADE_DATE DATE,\n SETTLEMENT_DATETIME TIMESTAMP\n )\n Table accountTable\n (\n ID INTEGER PRIMARY KEY,\n NAME VARCHAR(200),\n \"CREATE DATE\" DATE,\n \"CLOSE DATE\" DATE\n )\n Table tradeEventTable\n (\n ID INTEGER PRIMARY KEY,\n TRADE_ID INTEGER,\n EVENT_TYPE VARCHAR(10),\n EVENT_DATE DATE,\n TRADER_ID INTEGER\n )\n Table traderTable\n (\n ID INTEGER PRIMARY KEY,\n NAME VARCHAR(200),\n ADDRESS VARCHAR(200)\n )\n\n Join Product_Synonym(productSchema.synonymTable.PROD_ID = productSchema.productTable.ID)\n Join Product_Classification(productSchema.productTable.PROD_CLASSIFICATION_ID = productSchema.productClassificationTable.ID)\n Join TradeEvent_Trader(tradeEventTable.TRADER_ID = traderTable.ID)\n Join TradeEvent_Trade(tradeEventTable.TRADE_ID = tradeTable.ID)\n Join Trade_Account(tradeTable.ACCOUNT_ID = accountTable.ID)\n Join Trade_Product(tradeTable.PROD_ID = productSchema.productTable.ID)\n\n Filter AccountActiveFilter(accountTable.\"CLOSE DATE\" > now())\n Filter TradeEventSettledFilter(tradeEventTable.EVENT_TYPE = 'Settle')\n)\n\n\n###Pure\nEnum relationalMapping::ProductSynonymType\n{\n CUSIP,\n ISIN,\n SEDOL\n}\n\nClass relationalMapping::Trader\n{\n name: String[1];\n address: String[1];\n}\n\nClass relationalMapping::Synonym\n{\n type: relationalMapping::ProductSynonymType[1];\n name: String[1];\n}\n\nClass {meta::pure::profiles::doc.doc = 'use tags to add metadata.'} relationalMapping::AccountWithConstraints extends relationalMapping::Account\n[\n tradesNotDoubleBooked: $this->project(\n [\n a: relationalMapping::AccountWithConstraints[1]|$a.trades.id\n ],\n ['tradeId']\n)->groupBy(\n 'tradeId',\n 'count'->agg(\n x: meta::pure::tds::TDSRow[1]|$x,\n y: meta::pure::tds::TDSRow[*]|$y->count()\n )\n)->filter(\n t: meta::pure::tds::TDSRow[1]|$t.getInteger('count') > 1\n)->tdsRows()->isEmpty(),\n noTradesAfterCloseDate: true\n]\n{\n isOpen() {$this.closeDate->isEmpty()}: Boolean[1];\n}\n\nClass relationalMapping::TradeEvent\n{\n eventType: String[1];\n eventDate: StrictDate[1];\n initiator: relationalMapping::Trader[0..1];\n trade: relationalMapping::Trade[1];\n}\n\nClass relationalMapping::Account\n{\n name: String[1];\n createDate: StrictDate[1];\n trades: relationalMapping::Trade[*];\n closeDate: StrictDate[0..1];\n}\n\nClass relationalMapping::ProductClassification\n{\n type: String[1];\n description: String[1];\n}\n\nClass relationalMapping::Trade\n{\n id: Integer[1];\n tradeDate: StrictDate[1];\n quantity: Float[1];\n settlementDateTime: DateTime[0..1];\n product: relationalMapping::Product[0..1];\n account: relationalMapping::Account[0..1];\n events: relationalMapping::TradeEvent[*];\n productIdentifier() {if(\n $this.product->isNotEmpty(),\n |$this.product->toOne().name,\n |'Unknown'\n)}: String[1];\n eventsByDate(date: Date[1]) {$this.events->filter(\n e: relationalMapping::TradeEvent[1]|$e.eventDate ==\n $date\n)}: relationalMapping::TradeEvent[*];\n tradeDateEvent() {$this.eventsByDate($this.tradeDate->toOne())->toOne()}: relationalMapping::TradeEvent[1];\n tradeDateEventType() {$this.tradeDateEvent.eventType}: String[1];\n initiator() {$this.tradeDateEvent.initiator}: relationalMapping::Trader[0..1];\n}\n\nClass {meta::pure::profiles::doc.doc = 'must pass date for isin/cusip/sedol now.'} relationalMapping::Product\n{\n name: String[1];\n classification: relationalMapping::ProductClassification[1];\n cusip() {$this.synonyms->filter(\n s: relationalMapping::Synonym[1]|$s.type ==\n relationalMapping::ProductSynonymType.CUSIP\n)->toOne().name}: String[1];\n isin() {$this.synonyms->filter(\n s: relationalMapping::Synonym[1]|$s.type ==\n relationalMapping::ProductSynonymType.ISIN\n)->toOne().name}: String[1];\n sedol() {$this.synonyms->filter(\n s: relationalMapping::Synonym[1]|$s.type ==\n relationalMapping::ProductSynonymType.SEDOL\n)->toOne().name}: String[1];\n}\n\nAssociation relationalMapping::ProdSynonym\n{\n product: relationalMapping::Product[1];\n synonyms: relationalMapping::Synonym[*];\n}\n\n\n###Mapping\nMapping relationalMapping::RelationalMappingWithFilters\n(\n relationalMapping::Account: Relational\n {\n ~filter [relationalMapping::TradeAccountDb]AccountActiveFilter\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]accountTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]accountTable\n name: [relationalMapping::TradeAccountDb]accountTable.NAME,\n createDate: [relationalMapping::TradeAccountDb]accountTable.\"CREATE DATE\",\n closeDate: [relationalMapping::TradeAccountDb]accountTable.\"CLOSE DATE\"\n }\n relationalMapping::TradeEvent: Relational\n {\n ~filter [relationalMapping::TradeAccountDb]TradeEventSettledFilter\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]tradeEventTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]tradeEventTable\n eventType: [relationalMapping::TradeAccountDb]tradeEventTable.EVENT_TYPE,\n eventDate: [relationalMapping::TradeAccountDb]tradeEventTable.EVENT_DATE\n }\n\n MappingTests\n [\n test_1\n (\n query: |relationalMapping::Account.all()->graphFetch(\n #{\n relationalMapping::Account{\n name,\n createDate,\n closeDate\n }\n }#\n)->serialize(\n #{\n relationalMapping::Account{\n name,\n createDate,\n closeDate\n }\n }#\n);\n data:\n [\n \n ];\n assert: '[{\"name\":\"Acct 2\",\"createDate\":\"2020-01-01\",\"closeDate\":\"2025-01-01\"},{\"name\":\"Acct 2\",\"createDate\":\"2020-01-01\",\"closeDate\":\"2029-01-01\"}]';\n ),\n test_2\n (\n query: |relationalMapping::TradeEvent.all()->graphFetch(\n #{\n relationalMapping::TradeEvent{\n eventDate,\n eventType\n }\n }#\n)->serialize(\n #{\n relationalMapping::TradeEvent{\n eventDate,\n eventType\n }\n }#\n);\n data:\n [\n \n ];\n assert: '{\"eventDate\":\"2021-01-03\",\"eventType\":\"Settle\"}';\n )\n ]\n)\n\nMapping relationalMapping::TradeAccountRelationalMapping\n(\n *relationalMapping::ProductClassification: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]productSchema.productClassificationTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]productSchema.productClassificationTable\n type: [relationalMapping::TradeAccountDb]productSchema.productClassificationTable.TYPE,\n description: toUpper([relationalMapping::TradeAccountDb]productSchema.productClassificationTable.DESCRIPTION)\n }\n *relationalMapping::Synonym: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]productSchema.synonymTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]productSchema.synonymTable\n name: [relationalMapping::TradeAccountDb]productSchema.synonymTable.NAME,\n type: EnumerationMapping relationalMapping_ProductSynonymType: [relationalMapping::TradeAccountDb]productSchema.synonymTable.TYPE,\n product[relationalMapping_Product]: [relationalMapping::TradeAccountDb]@Product_Synonym\n }\n *relationalMapping::Product: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]productSchema.productTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]productSchema.productTable\n synonyms[relationalMapping_Synonym]: [relationalMapping::TradeAccountDb]@Product_Synonym,\n name: [relationalMapping::TradeAccountDb]productSchema.productTable.NAME,\n classification[relationalMapping_ProductClassification]: [relationalMapping::TradeAccountDb]@Product_Classification\n }\n *relationalMapping::Account: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]accountTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]accountTable\n name: [relationalMapping::TradeAccountDb]accountTable.NAME,\n createDate: [relationalMapping::TradeAccountDb]accountTable.\"CREATE DATE\",\n closeDate: [relationalMapping::TradeAccountDb]accountTable.\"CLOSE DATE\"\n }\n *relationalMapping::Trader: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]traderTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]traderTable\n name: [relationalMapping::TradeAccountDb]traderTable.NAME,\n address: [relationalMapping::TradeAccountDb]traderTable.ADDRESS\n }\n *relationalMapping::TradeEvent: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]tradeEventTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]tradeEventTable\n eventType: [relationalMapping::TradeAccountDb]tradeEventTable.EVENT_TYPE,\n eventDate: [relationalMapping::TradeAccountDb]tradeEventTable.EVENT_DATE,\n initiator[relationalMapping_Trader]: [relationalMapping::TradeAccountDb]@TradeEvent_Trader\n }\n *relationalMapping::Trade: Relational\n {\n ~primaryKey\n (\n [relationalMapping::TradeAccountDb]tradeTable.ID\n )\n ~mainTable [relationalMapping::TradeAccountDb]tradeTable\n id: [relationalMapping::TradeAccountDb]tradeTable.ID,\n tradeDate: [relationalMapping::TradeAccountDb]tradeTable.TRADE_DATE,\n quantity: [relationalMapping::TradeAccountDb]tradeTable.QUANTITY,\n settlementDateTime: [relationalMapping::TradeAccountDb]tradeTable.SETTLEMENT_DATETIME,\n product[relationalMapping_Product]: [relationalMapping::TradeAccountDb]@Trade_Product,\n account[relationalMapping_Account]: [relationalMapping::TradeAccountDb]@Trade_Account,\n events[relationalMapping_TradeEvent]: [relationalMapping::TradeAccountDb]@TradeEvent_Trade\n }\n\n relationalMapping::ProductSynonymType: EnumerationMapping\n {\n CUSIP: ['CUSIP'],\n ISIN: ['ISIN'],\n SEDOL: ['SEDOL']\n }\n\n MappingTests\n [\n test_1\n (\n query: |relationalMapping::ProductClassification.all()->project(\n [\n x: relationalMapping::ProductClassification[1]|$x.description,\n x: relationalMapping::ProductClassification[1]|$x.type->contains('Type A'),\n x: relationalMapping::ProductClassification[1]|$x.type\n ],\n [\n 'Description',\n 'Is Type A',\n 'Type'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[\"TYPE A PRODUCT\",true,\"Type A\"]},{\"values\":[\"TYPE B PRODUCT\",false,\"Type B\"]},{\"values\":[\"TYPE C PRODUCT\",false,\"Type C\"]}]';\n ),\n test_2\n (\n query: |relationalMapping::Product.all()->filter(\n x: relationalMapping::Product[1]|$x.classification.type == 'Type A'\n)->project(\n [\n x: relationalMapping::Product[1]|$x.name,\n x: relationalMapping::Product[1]|$x.classification.type,\n x: relationalMapping::Product[1]|$x.classification.description,\n x: relationalMapping::Product[1]|$x.synonyms.type,\n x: relationalMapping::Product[1]|$x.synonyms.name\n ],\n [\n 'Name',\n 'Classification/Type',\n 'Classification/Description',\n 'Synonyms/Type',\n 'Synonyms/Name'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[\"Product1\",\"Type A\",\"TYPE A PRODUCT\",\"CUSIP\",\"CUSIP1\"]},{\"values\":[\"Product1\",\"Type A\",\"TYPE A PRODUCT\",\"ISIN\",\"ISIN1\"]}]';\n ),\n test_3\n (\n query: |relationalMapping::Account.all()->project(\n [\n x: relationalMapping::Account[1]|$x.name,\n x: relationalMapping::Account[1]|$x.closeDate,\n x: relationalMapping::Account[1]|$x.createDate,\n x: relationalMapping::Account[1]|$x.createDate->monthNumber(),\n x: relationalMapping::Account[1]|$x.createDate->dayOfMonth()\n ],\n [\n 'Name',\n 'Close Date',\n 'Create Date',\n 'Create Month Number',\n 'Create dayOfMonth'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[\"Acct 1\",\"2021-01-01\",\"2020-01-01\",1,1]}]';\n ),\n test_4\n (\n query: |relationalMapping::Trade.all()->project(\n [\n x: relationalMapping::Trade[1]|$x.id,\n x: relationalMapping::Trade[1]|$x.quantity,\n x: relationalMapping::Trade[1]|$x.settlementDateTime,\n x: relationalMapping::Trade[1]|$x.tradeDate,\n x: relationalMapping::Trade[1]|$x.account.name,\n x: relationalMapping::Trade[1]|$x.product.name,\n x: relationalMapping::Trade[1]|$x.tradeDateEvent.eventDate,\n x: relationalMapping::Trade[1]|$x.tradeDateEventType,\n x: relationalMapping::Trade[1]|$x.initiator.name\n ],\n [\n 'Id',\n 'Quantity',\n 'Settlement Date Time',\n 'Trade Date',\n 'Account_Name',\n 'Product_Name',\n 'Trade Event Date',\n 'Trade Date Event Type',\n 'Initiator'\n ]\n);\n data:\n [\n \n ];\n assert: '[{\"values\":[1,100.0,\"2021-01-01T12:00:00.000000000+0000\",\"2021-01-01\",\"Acct 1\",\"Product1\",\"2021-01-01\",\"New\",\"Jack\"]}]';\n )\n ]\n)\n"},{"title":"Relational Database Mapping with Scoped Block","description":"An example of a Mapping using a scoped block for readability.","documentation":"","path":"Store/Relational Store/Mapping/Scope","code":"###Mapping\nimport stores::*;\nimport models::*;\nMapping mappings::SimpleScopedMapping\n(\n Person: Relational\n {\n // scope([SimpleDB]SimpleSchema.People) can be used to extract the prefix\n // it is just syntactic sugar and will be string replaced.\n name: [SimpleDB]SimpleSchema.People.name\n }\n)\n\n\n###Pure\nClass models::Person\n{\n name: String[1];\n}\n\n\n###Relational\nDatabase stores::SimpleDB\n(\n Schema SimpleSchema\n (\n Table People\n (\n id INTEGER PRIMARY KEY,\n name VARCHAR(200)\n )\n )\n)"},{"title":"Basic Querying Semi Structure Data","documentation":"Basic Querying Semi Structure Data with mapping and functions defined.","path":"Store/Relational Store/Mapping/Semi Structure/Basic","code":"###Pure\nClass simple::model::Firm\n{\n ID: Integer[1];\n legalName: String[1];\n employeeCount: Integer[1];\n mnc: Boolean[1];\n estDate: StrictDate[1];\n lastUpdate: DateTime[1];\n entityType: simple::model::EntityType[1];\n secondLineOfAddress: String[0..1];\n}\n\nEnum simple::model::EntityType\n{\n Organization,\n Company\n}\n\n\n###Relational\nDatabase simple::store::H2DB\n(\n Schema FIRM_SCHEMA\n (\n Table FIRM_TABLE\n (\n ID INTEGER PRIMARY KEY,\n FIRM_DETAILS VARCHAR(1000)\n )\n )\n)\n\nDatabase simple::store::SnowflakeDB\n(\n Schema FIRM_SCHEMA\n (\n Table FIRM_TABLE\n (\n ID INTEGER PRIMARY KEY,\n FIRM_DETAILS SEMISTRUCTURED\n )\n )\n)\n\nDatabase simple::store::MemSQLDB\n(\n Schema FIRM_SCHEMA\n (\n Table FIRM_TABLE\n (\n ID INTEGER PRIMARY KEY,\n FIRM_DETAILS JSON\n )\n )\n)\n\n\n###Mapping\nMapping simple::mapping::SnowflakeMapping\n(\n *simple::model::Firm: Relational\n {\n ~primaryKey\n (\n [simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.ID\n )\n ~mainTable [simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE\n ID: [simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.ID,\n legalName: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'legalName', 'VARCHAR'),\n employeeCount: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'employeeCount', 'INTEGER'),\n mnc: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'mnc', 'BOOLEAN'),\n estDate: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'dates.estDate', 'DATE'),\n lastUpdate: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, '[\"dates\"][\"last Update\"]', 'TIMESTAMP'),\n entityType: EnumerationMapping simple_model_EntityType: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'entity.entityType', 'VARCHAR'),\n secondLineOfAddress: extractFromSemiStructured([simple::store::SnowflakeDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'address.lines[1][\"details\"]', 'VARCHAR')\n }\n\n simple::model::EntityType: EnumerationMapping\n {\n Organization: ['O'],\n Company: ['P']\n }\n)\n\nMapping simple::mapping::MemSQLMapping\n(\n *simple::model::Firm: Relational\n {\n ~primaryKey\n (\n [simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.ID\n )\n ~mainTable [simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE\n ID: [simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.ID,\n legalName: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'legalName', 'VARCHAR'),\n employeeCount: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'employeeCount', 'INTEGER'),\n mnc: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'mnc', 'BOOLEAN'),\n estDate: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'dates.estDate', 'DATE'),\n lastUpdate: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, '[\"dates\"][\"last Update\"]', 'TIMESTAMP'),\n entityType: EnumerationMapping simple_model_EntityType: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'entity.entityType', 'VARCHAR'),\n secondLineOfAddress: extractFromSemiStructured([simple::store::MemSQLDB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'address.lines[1][\"details\"]', 'VARCHAR')\n }\n\n simple::model::EntityType: EnumerationMapping\n {\n Organization: ['O'],\n Company: ['P']\n }\n)\n\nMapping simple::mapping::H2Mapping\n(\n *simple::model::Firm: Relational\n {\n ~primaryKey\n (\n [simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.ID\n )\n ~mainTable [simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE\n ID: [simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.ID,\n legalName: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'legalName', 'VARCHAR'),\n employeeCount: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'employeeCount', 'INTEGER'),\n mnc: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'mnc', 'BOOLEAN'),\n estDate: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'dates.estDate', 'DATE'),\n lastUpdate: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, '[\"dates\"][\"last Update\"]', 'TIMESTAMP'),\n entityType: EnumerationMapping simple_model_EntityType: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'entity.entityType', 'VARCHAR'),\n secondLineOfAddress: extractFromSemiStructured([simple::store::H2DB]FIRM_SCHEMA.FIRM_TABLE.FIRM_DETAILS, 'address.lines[1][\"details\"]', 'VARCHAR')\n }\n\n simple::model::EntityType: EnumerationMapping\n {\n Organization: ['O'],\n Company: ['C']\n }\n)\n\n\n###Runtime\nRuntime simple::runtime::SnowflakeRuntime\n{\n mappings:\n [\n simple::mapping::SnowflakeMapping\n ];\n connections:\n [\n simple::store::SnowflakeDB:\n [\n connection_1:\n #{\n RelationalDatabaseConnection\n {\n store: simple::store::SnowflakeDB;\n type: Snowflake;\n specification: Snowflake\n {\n name: 'dbName';\n account: 'account';\n warehouse: 'warehouse';\n region: 'region';\n };\n auth: DefaultH2;\n }\n }#\n ]\n ];\n}\n\n\n###Pure\nfunction simple::dotAndBracketNotationAccess(): TabularDataSet[1]\n{\n simple::model::Firm.all()->project(\n [\n x: simple::model::Firm[1]|$x.ID,\n x: simple::model::Firm[1]|$x.estDate,\n x: simple::model::Firm[1]|$x.lastUpdate,\n x: simple::model::Firm[1]|$x.secondLineOfAddress\n ],\n [\n 'Id',\n 'Dot Only',\n 'Bracket Only',\n 'Dot & Bracket'\n ]\n )\n}\n\nfunction simple::arrayElementNoFlattenAccess(): TabularDataSet[1]\n{\n simple::model::Firm.all()->project(\n [\n x: simple::model::Firm[1]|$x.ID,\n x: simple::model::Firm[1]|$x.secondLineOfAddress\n ],\n [\n 'Id',\n 'Second Line of Address'\n ]\n )\n}\n\nfunction simple::extractEnumProperty(): TabularDataSet[1]\n{\n simple::model::Firm.all()->project(\n [\n x: simple::model::Firm[1]|$x.ID,\n x: simple::model::Firm[1]|$x.entityType\n ],\n [\n 'Id',\n 'Entity Type'\n ]\n )\n}\n\nfunction simple::allDataTypesAccess(): TabularDataSet[1]\n{\n simple::model::Firm.all()->project(\n [\n x: simple::model::Firm[1]|$x.ID,\n x: simple::model::Firm[1]|$x.legalName,\n x: simple::model::Firm[1]|$x.estDate,\n x: simple::model::Firm[1]|$x.mnc,\n x: simple::model::Firm[1]|$x.employeeCount,\n x: simple::model::Firm[1]|$x.lastUpdate\n ],\n [\n 'Id',\n 'Legal Name',\n 'Est Date',\n 'Mnc',\n 'Employee Count',\n 'Last Update'\n ]\n )\n}\n"},{"title":"Association - Embedded","documentation":"TODO: Some dummy description","development":true,"path":"Store/Relational Store/Mapping/association/embedded","code":""},{"title":"Querying Relational Store using Relation Functions","description":"Showcases Querying Relational Store using Typed Relation Functions both on a Modeled Store and directly on the Relational Store","documentation":"","path":"Store/Relational Store/Query","code":"###Service\nService showcase::northwind::service::model::GetCustomer\n{\n pattern: '/bed74c09-bef9-45dc-b7aa-95a9408d6c87';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle,\n contactName: x|$x.contactName,\n faxNumber: x|$x.faxNumber,\n id: x|$x.id,\n telephoneNumber: x|$x.telephoneNumber\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService {doc.doc = 'was trying to do -> distinct(~[companyTile]) but does not work'} showcase::northwind::service::model::GetCustomerDistinctTitle\n{\n pattern: '/bed74c09-bef9-45dc-b7aa-95a9408d6c87';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyTitle: x|$x.companyTitle\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService showcase::northwind::service::model::GetCustomerWithDrop\n{\n pattern: '/bed74c09-bef9-45dc-b7aa-95a9408d6c87';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle,\n contactName: x|$x.contactName,\n faxNumber: x|$x.faxNumber,\n id: x|$x.id,\n telephoneNumber: x|$x.telephoneNumber\n ]\n )->drop(1);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService showcase::northwind::service::model::GetCustomerWithLimit\n{\n pattern: '/bed74c09-bef9-45dc-b7aa-95a9408d6c87';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle,\n contactName: x|$x.contactName,\n faxNumber: x|$x.faxNumber,\n id: x|$x.id,\n telephoneNumber: x|$x.telephoneNumber\n ]\n )->limit(1);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService {doc.doc = 'Does not work -> route function'} showcase::northwind::service::model::ProductService\n{\n pattern: '/67591400-468d-4bb5-b875-f1fe2699d143';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::inventory::Product.all()->project(\n ~[\n quantityPerUnit: x|$x.quantityPerUnit,\n discontinued: x|$x.discontinued,\n id: x|$x.id,\n name: x|$x.name,\n reorderLevel: x|$x.reorderLevel,\n unitsInStock: x|$x.unitsInStock,\n unitsOnOrder: x|$x.unitsOnOrder\n ]\n )->filter(\n x|$x.unitsInStock > 1\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService showcase::northwind::service::model::CustomerExtend\n{\n pattern: '/fde94d89-b181-4fbe-b615-fc450772438f';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle\n ]\n )->extend(\n ~name: c|$c.companyName->toOne() + ' , title: ' + $c.companyTitle->toOne()->toString()\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\nService showcase::northwind::service::model::CustomerSelect\n{\n pattern: '/fde94d89-b181-4fbe-b615-fc450772438f';\n ownership: DID { identifier: '' };\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n ~[\n companyName: x|$x.companyName,\n companyTitle: x|$x.companyTitle\n ]\n )->select(\n ~[\n companyName\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::mapping::ModelNorthWindRuntime;\n }\n}\n\n\n###Relational\nDatabase showcase::northwind::store::NorthwindDatabase\n(\n Schema NORTHWIND\n (\n Table CATEGORIES\n (\n CATEGORY_ID SMALLINT PRIMARY KEY,\n CATEGORY_NAME VARCHAR(15) NOT NULL,\n DESCRIPTION VARCHAR(256),\n PICTURE OTHER\n )\n Table CUSTOMERS\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24)\n )\n Table CUSTOMER_CUSTOMER_DEMO\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY\n )\n Table CUSTOMER_DEMOGRAPHICS\n (\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_DESC VARCHAR(256)\n )\n Table EMPLOYEES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n LAST_NAME VARCHAR(20) NOT NULL,\n FIRST_NAME VARCHAR(10) NOT NULL,\n TITLE VARCHAR(30),\n TITLE_OF_COURTESY VARCHAR(25),\n BIRTH_DATE DATE,\n HIRE_DATE DATE,\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n HOME_PHONE VARCHAR(24),\n EXTENSION VARCHAR(4),\n PHOTO OTHER,\n NOTES OTHER,\n REPORTS_TO SMALLINT,\n PHOTO_PATH VARCHAR(255)\n )\n Table EMPLOYEE_TERRITORIES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n TERRITORY_ID VARCHAR(20) PRIMARY KEY\n )\n Table ORDERS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n CUSTOMER_ID VARCHAR(5),\n EMPLOYEE_ID SMALLINT,\n ORDER_DATE DATE,\n REQUIRED_DATE DATE,\n SHIPPED_DATE DATE,\n SHIP_VIA SMALLINT,\n FREIGHT OTHER,\n SHIP_NAME VARCHAR(40),\n SHIP_ADDRESS VARCHAR(60),\n SHIP_CITY VARCHAR(15),\n SHIP_REGION VARCHAR(15),\n SHIP_POSTAL_CODE VARCHAR(10),\n SHIP_COUNTRY VARCHAR(15)\n )\n Table ORDER_DETAILS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n PRODUCT_ID SMALLINT PRIMARY KEY,\n UNIT_PRICE OTHER NOT NULL,\n QUANTITY SMALLINT NOT NULL,\n DISCOUNT OTHER NOT NULL\n )\n Table PRODUCTS\n (\n PRODUCT_ID SMALLINT PRIMARY KEY,\n PRODUCT_NAME VARCHAR(40) NOT NULL,\n SUPPLIER_ID SMALLINT,\n CATEGORY_ID SMALLINT,\n QUANTITY_PER_UNIT VARCHAR(20),\n UNIT_PRICE OTHER,\n UNITS_IN_STOCK SMALLINT,\n UNITS_ON_ORDER SMALLINT,\n REORDER_LEVEL SMALLINT,\n DISCONTINUED INTEGER NOT NULL\n )\n Table REGION\n (\n REGION_ID SMALLINT PRIMARY KEY,\n REGION_DESCRIPTION VARCHAR(60) NOT NULL\n )\n Table SHIPPERS\n (\n SHIPPER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n PHONE VARCHAR(24) NOT NULL\n )\n Table SUPPLIERS\n (\n SUPPLIER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24),\n HOMEPAGE VARCHAR(256)\n )\n Table TERRITORIES\n (\n TERRITORY_ID VARCHAR(20) PRIMARY KEY,\n TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,\n REGION_ID SMALLINT NOT NULL\n )\n Table US_STATES\n (\n STATE_ID SMALLINT PRIMARY KEY,\n STATE_NAME VARCHAR(100),\n STATE_ABBR VARCHAR(2),\n STATE_REGION VARCHAR(50)\n )\n )\n\n Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)\n Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)\n Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)\n Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)\n Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)\n Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)\n Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)\n Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)\n Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)\n Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)\n Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)\n Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)\n Join SUPPLIERS_REGION(NORTHWIND.SUPPLIERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join ORDERS_REGION(NORTHWIND.ORDERS.SHIP_REGION = NORTHWIND.REGION.REGION_ID)\n Join CUSTOMERS_REGION(NORTHWIND.CUSTOMERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_REGION(NORTHWIND.EMPLOYEES.REGION = NORTHWIND.REGION.REGION_ID)\n)\n\nDatabase showcase::simple::store::TestDatabase\n(\n Table TEST0\n (\n FIRSTNAME VARCHAR(200),\n LASTNAME VARCHAR(200)\n )\n)\n\n\n###Pure\nEnum showcase::northwind::model::crm::Title\n{\n Mr,\n Mrs,\n Miss,\n Ms,\n Dr,\n Sir,\n Professor,\n Duchess,\n Duke\n}\n\nClass showcase::northwind::model::inventory::Product\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n quantityPerUnit: String[0..1];\n unitsInStock: Integer[0..1];\n unitsOnOrder: Integer[0..1];\n reorderLevel: Integer[0..1];\n discontinued: Integer[1];\n}\n\nClass showcase::northwind::model::OrderLineItem\n{\n quantity: Integer[1];\n unitPrice: Float[1];\n unitPriceCurrency: String[1];\n}\n\nClass showcase::northwind::model::geography::Address\n{\n address: String[0..1];\n city: String[0..1];\n postalCode: String[0..1];\n region: String[0..1];\n country: String[0..1];\n}\n\nClass showcase::northwind::model::crm::Employee\n[\n dateOfBirthNotInTheFuture: $this.dateOfBirth <\n now(),\n dateOfBirthValid: $this.dateOfBirth > %1900-01-01,\n employeeIsOverEighteen: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) >= 18,\n employeeIsUnderEighty: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) < 80,\n notDateOfHireNotBeforeDateOfBirth: $this.dateOfHire >\n $this.dateOfBirth\n]\n{\n id: Integer[1];\n lastName: String[1];\n firstName: String[1];\n title: String[0..1];\n preferredTitle: showcase::northwind::model::crm::Title[0..1];\n dateOfBirth: StrictDate[0..1];\n dateOfHire: StrictDate[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n homeTelephoneNumber: String[0..1];\n extension: String[0..1];\n fullName() {if(\n $this.preferredTitle->isNotEmpty(),\n |$this.preferredTitle->toOne()->toString() + ' ',\n |if(\n $this.title->isNotEmpty(),\n |$this.title->toOne() + ' ',\n |''\n )\n) + $this.firstName + ' ' + $this.lastName}: String[1];\n}\n\nClass showcase::northwind::model::crm::CustomerDemographic\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesRegion\n[\n idNotNegative: $this.id >= 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: Integer[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::crm::Customer\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n companyName: String[1];\n contactName: String[0..1];\n companyTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n}\n\nClass showcase::northwind::model::Order\n{\n id: Integer[1];\n createdDate: StrictDate[0..1];\n requiredDate: StrictDate[0..1];\n shippedDate: StrictDate[0..1];\n shipToName: String[0..1];\n shipToAddress: showcase::northwind::model::geography::Address[0..1];\n itemCount() {$this.lineItems->count()}: Integer[1];\n}\n\nClass showcase::northwind::model::inventory::ProductCategory\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::inventory::Supplier\n{\n id: Integer[1];\n companyName: String[1];\n contactName: String[0..1];\n contactTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n homepageUrl: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesTerritory\n[\n idNotBlank: $this.id->length() > 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: String[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::geography::USState\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->isEmpty() ||\n ($this.name->toOne()->length() > 0)\n]\n{\n id: Integer[1];\n name: String[0..1];\n code: String[0..1];\n}\n\nClass showcase::northwind::model::crm::ShippingCompany\n[\n idNotNegative: $this.id >= 0,\n telephoneNumberFormatValid: $this.telephoneNumber->isEmpty() ||\n $this.telephoneNumber->toOne()->matches('(1-)?\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d')\n]\n{\n id: Integer[1];\n name: String[1];\n telephoneNumber: String[1];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Employees\n{\n employees: showcase::northwind::model::crm::Employee[*];\n territories: showcase::northwind::model::geography::SalesTerritory[*];\n}\n\nAssociation showcase::northwind::model::associations::Product_Suppliers\n{\n supplier: showcase::northwind::model::inventory::Supplier[1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Employee\n{\n orders: showcase::northwind::model::Order[*];\n employee: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Category\n{\n category: showcase::northwind::model::inventory::ProductCategory[0..1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Customer_CustomerDemographics\n{\n customers: showcase::northwind::model::crm::Customer[*];\n demographics: showcase::northwind::model::crm::CustomerDemographic[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Customer\n{\n orders: showcase::northwind::model::Order[*];\n customer: showcase::northwind::model::crm::Customer[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Shipper\n{\n orders: showcase::northwind::model::Order[*];\n shipper: showcase::northwind::model::crm::ShippingCompany[0..1];\n}\n\nAssociation showcase::northwind::model::associations::OrderLineItem_Product\n{\n orderLineItems: showcase::northwind::model::OrderLineItem[*];\n product: showcase::northwind::model::inventory::Product[1];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Region\n{\n region: showcase::northwind::model::geography::SalesRegion[1];\n territories: showcase::northwind::model::geography::SalesTerritory[1..*];\n}\n\nAssociation showcase::northwind::model::associations::Employee_Manager\n{\n reports: showcase::northwind::model::crm::Employee[*];\n manager: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_OrderLineItem\n{\n order: showcase::northwind::model::Order[1];\n lineItems: showcase::northwind::model::OrderLineItem[*];\n}\n\nfunction showcase::northwind::store::functions::SelectOnNorthWindCustomer(): Any[*]\n{\n #>{showcase::northwind::store::NorthwindDatabase.NORTHWIND.CUSTOMERS}#->select(\n ~[\n COMPANY_NAME\n ]\n )->from(\n showcase::northwind::store::NorthwindRuntime\n )\n}\n\nfunction showcase::northwind::store::functions::NorthwindDrop(): Any[*]\n{\n #>{showcase::northwind::store::NorthwindDatabase.NORTHWIND.CUSTOMERS}#->drop(10)->from(\n showcase::northwind::store::NorthwindRuntime\n )\n}\n\nfunction showcase::northwind::store::functions::NorthwindExtendd(): Any[*]\n{\n #>{showcase::northwind::store::NorthwindDatabase.NORTHWIND.CUSTOMERS}#->extend(\n ~newCol: x|$x.CONTACT_NAME->toOne() + ' |' + $x.CONTACT_TITLE->toOne()\n )->from(\n showcase::northwind::store::NorthwindRuntime\n )\n}\n\nfunction showcase::simple::functions::simpleFunctionSort(): Any[*]\n{\n #>{showcase::simple::store::TestDatabase.TEST0}#->filter(\n c|!($c.FIRSTNAME == 'Doe')\n )->from(\n showcase::simple::connection::TestRuntime\n )->sort(\n [\n ~FIRSTNAME->ascending()\n ]\n )\n}\n\nfunction showcase::simple::functions::simpleTableFunctionFilter(): Any[*]\n{\n #>{showcase::simple::store::TestDatabase.TEST0}#->filter(\n c|!($c.FIRSTNAME == 'Doe') &&\n !($c.LASTNAME == 'Doe')\n )->from(\n showcase::simple::connection::TestRuntime\n )->sort(\n [\n ~FIRSTNAME->ascending()\n ]\n )\n}\n\nfunction showcase::simple::functions::simpleTableFunctionGroup(): Any[*]\n{\n #>{showcase::simple::store::TestDatabase.TEST0}#->filter(\n c|!($c.FIRSTNAME == 'Doe')\n )->from(\n showcase::simple::connection::TestRuntime\n )->groupBy(\n ~[\n FIRSTNAME\n ],\n ~[\n count: x|$x.FIRSTNAME:y|$y->count()\n ]\n )\n}\n\nfunction showcase::simple::functions::simpleTableFunctionSlice(): Any[*]\n{\n #>{showcase::simple::store::TestDatabase.TEST0}#->filter(\n c|!($c.FIRSTNAME == 'Doe') &&\n !($c.LASTNAME == 'Doe')\n )->from(\n showcase::simple::connection::TestRuntime\n )\n}\n\n\n###Mapping\nMapping showcase::northwind::mapping::NorthwindMapping\n(\n showcase::northwind::model::inventory::ProductCategory[Category]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_NAME,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.DESCRIPTION\n }\n showcase::northwind::model::crm::Customer[Customer]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_NAME,\n companyTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.FAX\n }\n showcase::northwind::model::crm::Employee[Employee]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID,\n lastName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.LAST_NAME,\n firstName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.FIRST_NAME,\n title: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE,\n preferredTitle: EnumerationMapping TitleMapping: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE_OF_COURTESY,\n dateOfBirth: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.BIRTH_DATE,\n dateOfHire: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HIRE_DATE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.COUNTRY\n ),\n homeTelephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HOME_PHONE,\n extension: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EXTENSION\n }\n showcase::northwind::model::Order[Order]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID,\n createdDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_DATE,\n requiredDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.REQUIRED_DATE,\n shippedDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIPPED_DATE,\n shipToName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_NAME,\n shipToAddress\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_COUNTRY\n )\n }\n showcase::northwind::model::OrderLineItem[OrderLineItem]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.ORDER_ID,\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS\n quantity: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.QUANTITY,\n unitPrice: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.UNIT_PRICE,\n unitPriceCurrency: 'USD'\n }\n showcase::northwind::model::inventory::Product[Product]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_NAME,\n quantityPerUnit: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.QUANTITY_PER_UNIT,\n unitsInStock: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_IN_STOCK,\n unitsOnOrder: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_ON_ORDER,\n reorderLevel: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.REORDER_LEVEL,\n discontinued: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.DISCONTINUED\n }\n showcase::northwind::model::geography::SalesRegion[Region]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_DESCRIPTION\n }\n showcase::northwind::model::crm::ShippingCompany[Shipper]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.COMPANY_NAME,\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.PHONE\n }\n showcase::northwind::model::inventory::Supplier[Supplier]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_NAME,\n contactTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.FAX,\n homepageUrl: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.HOMEPAGE\n }\n showcase::northwind::model::geography::SalesTerritory[Territory]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_DESCRIPTION\n }\n showcase::northwind::model::geography::USState[USState]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_NAME,\n code: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ABBR\n }\n\n showcase::northwind::model::associations::Order_Customer: Relational\n {\n AssociationMapping\n (\n orders[Customer,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS,\n customer[Order,Customer]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS\n )\n }\n showcase::northwind::model::associations::Order_Employee: Relational\n {\n AssociationMapping\n (\n orders[Employee,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES,\n employee[Order,Employee]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES\n )\n }\n showcase::northwind::model::associations::Order_Shipper: Relational\n {\n AssociationMapping\n (\n orders[Shipper,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS,\n shipper[Order,Shipper]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS\n )\n }\n showcase::northwind::model::associations::Order_OrderLineItem: Relational\n {\n AssociationMapping\n (\n order[OrderLineItem,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS,\n lineItems[Order,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS\n )\n }\n showcase::northwind::model::associations::OrderLineItem_Product: Relational\n {\n AssociationMapping\n (\n orderLineItems[Product,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS,\n product[OrderLineItem,Product]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS\n )\n }\n showcase::northwind::model::associations::Product_Category: Relational\n {\n AssociationMapping\n (\n category[Product,Category]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES,\n products[Category,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES\n )\n }\n showcase::northwind::model::associations::Product_Suppliers: Relational\n {\n AssociationMapping\n (\n supplier[Product,Supplier]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS,\n products[Supplier,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS\n )\n }\n showcase::northwind::model::associations::Terriroties_Region: Relational\n {\n AssociationMapping\n (\n region[Territory,Region]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION,\n territories[Region,Territory]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION\n )\n }\n showcase::northwind::model::associations::Terriroties_Employees: Relational\n {\n AssociationMapping\n (\n employees[Territory,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES,\n territories[Employee,Territory]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES\n )\n }\n showcase::northwind::model::associations::Employee_Manager: Relational\n {\n AssociationMapping\n (\n reports[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS,\n manager[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS\n )\n }\n\n showcase::northwind::model::crm::Title: EnumerationMapping TitleMapping\n {\n Mr: ['Mr.'],\n Mrs: ['Mrs.'],\n Miss: ['Miss.'],\n Ms: ['Ms.'],\n Dr: ['Dr.'],\n Sir: ['Sir.'],\n Professor: ['Prof.'],\n Duchess: ['Duchess.'],\n Duke: ['Duke.']\n }\n)\n\n\n###Connection\nRelationalDatabaseConnection showcase::simple::connection::TestConnection\n{\n store: showcase::simple::store::TestDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n '\\nDrop table if exists TEST0;\\nCreate Table TEST0(FIRSTNAME VARCHAR(200), LASTNAME VARCHAR(200));\\nInsert into TEST0 (FIRSTNAME, LASTNAME) values (\\'John\\', \\'Doe\\');\\nInsert into TEST0 (FIRSTNAME, LASTNAME) values (\\'Tim\\', \\'Smith\\');\\nInsert into TEST0 (FIRSTNAME, LASTNAME) values (\\'Nicole\\', \\'Doe\\');\\n\\n'\n ];\n };\n auth: DefaultH2;\n}\n\nRelationalDatabaseConnection showcase::northwind::connection::NorthwindConnection\n{\n store: showcase::northwind::store::NorthwindDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'call loadNorthwindData()'\n ];\n };\n auth: DefaultH2;\n}\n\n\n###Runtime\nRuntime showcase::northwind::mapping::ModelNorthWindRuntime\n{\n mappings:\n [\n showcase::northwind::mapping::NorthwindMapping\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1: showcase::northwind::connection::NorthwindConnection\n ]\n ];\n}\n\nRuntime showcase::northwind::store::NorthwindRuntime\n{\n mappings:\n [\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1: showcase::northwind::connection::NorthwindConnection\n ]\n ];\n}\n\nRuntime showcase::simple::connection::TestRuntime\n{\n mappings:\n [\n ];\n connections:\n [\n showcase::simple::store::TestDatabase:\n [\n connection: showcase::simple::connection::TestConnection\n ]\n ];\n}\n"},{"title":"Relational Service - Querying Product Northwind Data","description":"Example of Relational Service querying northwind test data with Mapping and Service Tests","documentation":"The connection used here loads sample data from [northwind](https://github.com/pthom/northwind_psql). It includes a sample service querying products. Additionally it includes services and mapping tests. Some of the services include [post validations](https://github.com/finos/legend-engine/blob/master/docs/data-quality/service-post-validations.md) for better data quality.","path":"Store/Relational Store/Service/Basic","code":"###Diagram\nDiagram showcase::northwind::model::NorthwindModelDiagram\n{\n classView 8947a897-a67d-4064-8770-8a440e1220ce\n {\n class: showcase::northwind::model::crm::Employee;\n position: (401.1871744777152,580.7157363134539);\n rectangle: (211.03332710266113,212.0);\n }\n classView d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2\n {\n class: showcase::northwind::model::geography::Address;\n position: (428.11321850038996,365.8790985977993);\n rectangle: (145.85000038146973,114.0);\n }\n classView fd4a376f-11c2-4f8b-9e76-19079a06cc0b\n {\n class: showcase::northwind::model::Order;\n position: (89.66931137749526,364.84316585774513);\n rectangle: (174.01666831970215,114.0);\n }\n classView 51d867fc-1dce-4979-9120-d10a551e23a7\n {\n class: showcase::northwind::model::crm::ShippingCompany;\n position: (-240.98019847552794,379.4990577970102);\n rectangle: (179.4666690826416,86.0);\n }\n classView 4251c20c-4779-4c21-9b9c-900caf75fcc6\n {\n class: showcase::northwind::model::inventory::Product;\n position: (421.60610674363886,-69.9030438054377);\n rectangle: (167.85000038146973,128.0);\n }\n classView 2a461b5d-77dd-43e1-a33f-0759d84b8667\n {\n class: showcase::northwind::model::OrderLineItem;\n position: (92.87799226709058,-43.093765410358316);\n rectangle: (169.10000133514404,86.0);\n }\n classView 8217f514-1928-48bc-b8de-386ca506c1f9\n {\n class: showcase::northwind::model::geography::SalesTerritory;\n position: (806.4847354152803,653.513841427653);\n rectangle: (141.58333110809326,72.0);\n }\n classView 37cda7f9-22dc-4e75-ad3a-a5599d88772a\n {\n class: showcase::northwind::model::inventory::ProductCategory;\n position: (786.770946360032,-49.13039766561275);\n rectangle: (175.1082781744508,86.0);\n }\n classView 09710ba2-c255-4222-a85d-50520d5eae95\n {\n class: showcase::northwind::model::inventory::Supplier;\n position: (768.5537612977755,206.91393580644078);\n rectangle: (179.4666690826416,142.0);\n }\n classView df47922a-2b8a-4b12-b835-d7c75a694670\n {\n class: showcase::northwind::model::crm::Customer;\n position: (382.36050099956327,131.63043674809185);\n rectangle: (236.94999885559082,128.0);\n }\n classView 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1\n {\n class: showcase::northwind::model::geography::SalesRegion;\n position: (806.4847354152804,492.60599452399185);\n rectangle: (133.0166654586792,58.0);\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Customer.address;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(500.8355004273587,195.63043674809185),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.shipper;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 51d867fc-1dce-4979-9120-d10a551e23a7;\n points: [(176.67764553734634,421.84316585774513),(-151.24686393420714,422.4990577970102)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Shipper.orders;\n source: 51d867fc-1dce-4979-9120-d10a551e23a7;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(-151.24686393420714,422.4990577970102),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.lineItems;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(176.67764553734634,421.84316585774513),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_OrderLineItem.order;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(177.4279929346626,-0.09376541035831565),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::Order.shipToAddress;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(176.67764553734634,421.84316585774513),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.customer;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: df47922a-2b8a-4b12-b835-d7c75a694670;\n points: [(176.67764553734634,421.84316585774513),(500.8355004273587,195.63043674809185)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Customer.orders;\n source: df47922a-2b8a-4b12-b835-d7c75a694670;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(500.8355004273587,195.63043674809185),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::inventory::Supplier.address;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(858.2870958390963,277.9139358064408),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.orders;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n points: [(506.70383802904576,686.7157363134539),(176.67764553734634,421.84316585774513)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Order_Employee.employee;\n source: fd4a376f-11c2-4f8b-9e76-19079a06cc0b;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(176.67764553734634,421.84316585774513),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::crm::Employee.address;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: d30683e5-5c3c-4e4b-9d75-08ba75aa2bf2;\n points: [(506.70383802904576,686.7157363134539),(501.0382186911248,422.8790985977993)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.category;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n points: [(505.5311069343737,-5.903043805437704),(874.3250854472574,-6.1303976656127475)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Category.products;\n source: 37cda7f9-22dc-4e75-ad3a-a5599d88772a;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(874.3250854472574,-6.1303976656127475),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.orderLineItems;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n points: [(505.5311069343737,-5.903043805437704),(177.4279929346626,-0.09376541035831565)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::OrderLineItem_Product.product;\n source: 2a461b5d-77dd-43e1-a33f-0759d84b8667;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(177.4279929346626,-0.09376541035831565),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.supplier;\n source: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n target: 09710ba2-c255-4222-a85d-50520d5eae95;\n points: [(505.5311069343737,-5.903043805437704),(858.2870958390963,277.9139358064408)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Product_Suppliers.products;\n source: 09710ba2-c255-4222-a85d-50520d5eae95;\n target: 4251c20c-4779-4c21-9b9c-900caf75fcc6;\n points: [(858.2870958390963,277.9139358064408),(505.5311069343737,-5.903043805437704)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.employees;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 8947a897-a67d-4064-8770-8a440e1220ce;\n points: [(877.2764009693269,689.513841427653),(506.70383802904576,686.7157363134539)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Employees.territories;\n source: 8947a897-a67d-4064-8770-8a440e1220ce;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(506.70383802904576,686.7157363134539),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.territories;\n source: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n target: 8217f514-1928-48bc-b8de-386ca506c1f9;\n points: [(872.99306814462,521.6059945239919),(877.2764009693269,689.513841427653)];\n }\n propertyView\n {\n property: showcase::northwind::model::associations::Terriroties_Region.region;\n source: 8217f514-1928-48bc-b8de-386ca506c1f9;\n target: 6bb172ca-aab8-4c80-a825-dccc9b0f2ef1;\n points: [(877.2764009693269,689.513841427653),(872.99306814462,521.6059945239919)];\n }\n}\n\n\n###DataSpace\nDataSpace showcase::northwind::dataspace::NorthwindDataSpace\n{\n executionContexts:\n [\n {\n name: 'externally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'externally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n }\n ];\n defaultExecutionContext: 'externally-public-PROD';\n}\n\nDataSpace showcase::northwind::dataspace::NorthwindDataSpaceWithTemplateQuery\n{\n executionContexts:\n [\n {\n name: 'externally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'externally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-public-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-QA';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n },\n {\n name: 'internally-restricted-PROD';\n mapping: showcase::northwind::mapping::NorthwindMapping;\n defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;\n }\n ];\n defaultExecutionContext: 'externally-public-PROD';\n executables:\n [\n {\n id: my_id;\n title: 'this is title - Top Categories';\n description: 'this is description - TopCategories';\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n executionContextKey: 'externally-public-PROD';\n }\n ];\n}\n\n\n###Service\nService showcase::northwind::services::graph::OrderDetailsByIdGraphFetch\n{\n pattern: '/orderDetailsByIdGraphFetch/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: id: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $id\n )->graphFetch(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::Order{\n id,\n createdDate,\n customer{\n companyName\n },\n employee{\n firstName\n },\n lineItems{\n product{\n name,\n category{\n name\n }\n },\n quantity\n },\n shipper{\n name\n }\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::TopCategories\n{\n pattern: '/topCategories';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::Order.all()->groupBy(\n [\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name\n ],\n [\n agg(\n x: showcase::northwind::model::Order[1]|$x.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Id',\n 'Category Name',\n 'Order Count'\n ]\n )->sort(\n [\n desc('Order Count')\n ]\n )->take(5);\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::OrderDetailsByIdTDS\n{\n pattern: '/orderDetailsByIdTDS/{id}';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: orderId: Integer[1]|showcase::northwind::model::Order.all()->filter(\n x: showcase::northwind::model::Order[1]|$x.id ==\n $orderId\n )->project(\n [\n x: showcase::northwind::model::Order[1]|$x.id,\n x: showcase::northwind::model::Order[1]|$x.customer.companyName,\n x: showcase::northwind::model::Order[1]|$x.employee.firstName,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name,\n x: showcase::northwind::model::Order[1]|$x.lineItems.quantity,\n x: showcase::northwind::model::Order[1]|$x.shipper.name\n ],\n [\n 'Order Id',\n 'Customer/Company Name',\n 'Employee/First Name',\n 'Order Line Items/Product/Product Name',\n 'Order Line Items/Product/Category/Category Name',\n 'Order Line Items/Quantity',\n 'Shipper/Company Name'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'a simple passing validation with static parameter';\n params:[\n |10248\n ];\n assertions:[\n rowCountGreaterThan10: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Employee/First Name')->startsWith('T')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected no Employee/First Name to begin with the letter T')\n ];\n }\n ]\n}\n\nService showcase::northwind::services::tds::ProductRankingWithinCategory\n{\n pattern: '/productRankingWithinCategory';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::inventory::ProductCategory.all()->groupBy(\n [\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.name,\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.name\n ],\n [\n agg(\n x: showcase::northwind::model::inventory::ProductCategory[1]|$x.products.orderLineItems.order.id,\n x: Integer[*]|$x->distinct()->count()\n )\n ],\n [\n 'Category Name',\n 'Products/Product Name',\n 'OrderCount'\n ]\n )->olapGroupBy(\n ['Category Name'],\n desc('OrderCount'),\n x: meta::pure::tds::TDSRow[*]|$x->rank(),\n 'Rank Within Category'\n )->sort(\n [\n asc('Category Name'),\n asc('Rank Within Category')\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\nService showcase::northwind::services::tds::Customers\n{\n pattern: '/customers';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::Customer.all()->project(\n [\n x: showcase::northwind::model::crm::Customer[1]|$x.id,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyName,\n x: showcase::northwind::model::crm::Customer[1]|$x.contactName,\n x: showcase::northwind::model::crm::Customer[1]|$x.companyTitle,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.country,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.address,\n x: showcase::northwind::model::crm::Customer[1]|$x.address.city,\n x: showcase::northwind::model::crm::Customer[1]|$x.telephoneNumber\n ],\n [\n 'Customer Id',\n 'Company Name',\n 'Contact Name',\n 'Company Title',\n 'Country',\n 'Address',\n 'City',\n 'Phone'\n ]\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n postValidations:\n [\n {\n description: 'A simple passing validation';\n params:[\n\n ];\n assertions:[\n noCompanyNamedAroundtheHorn: tds: TabularDataSet[1]|$tds->filter(\n row: meta::pure::tds::TDSRow[1]|$row.getString('Company Name')->contains('Around the Hornsss')\n)->meta::legend::service::validation::assertTabularDataSetEmpty('Expected there is no company named Around the Hornsss')\n ];\n }\n ]\n}\n\nService showcase::northwind::services::graph::ShipperValidationDefects\n{\n pattern: '/shipperValidationDefects';\n documentation: '';\n autoActivateUpdates: true;\n execution: Single\n {\n query: |showcase::northwind::model::crm::ShippingCompany.all()->graphFetchChecked(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n )->serialize(\n #{\n showcase::northwind::model::crm::ShippingCompany{\n id,\n telephoneNumber\n }\n }#\n );\n mapping: showcase::northwind::mapping::NorthwindMapping;\n runtime: showcase::northwind::runtime::NorthwindRuntime;\n }\n}\n\n\n###Relational\nDatabase showcase::northwind::store::NorthwindDatabase\n(\n Schema NORTHWIND\n (\n Table CATEGORIES\n (\n CATEGORY_ID SMALLINT PRIMARY KEY,\n CATEGORY_NAME VARCHAR(15) NOT NULL,\n DESCRIPTION VARCHAR(256),\n PICTURE OTHER\n )\n Table CUSTOMERS\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24)\n )\n Table CUSTOMER_CUSTOMER_DEMO\n (\n CUSTOMER_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY\n )\n Table CUSTOMER_DEMOGRAPHICS\n (\n CUSTOMER_TYPE_ID VARCHAR(5) PRIMARY KEY,\n CUSTOMER_DESC VARCHAR(256)\n )\n Table EMPLOYEES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n LAST_NAME VARCHAR(20) NOT NULL,\n FIRST_NAME VARCHAR(10) NOT NULL,\n TITLE VARCHAR(30),\n TITLE_OF_COURTESY VARCHAR(25),\n BIRTH_DATE DATE,\n HIRE_DATE DATE,\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n HOME_PHONE VARCHAR(24),\n EXTENSION VARCHAR(4),\n PHOTO OTHER,\n NOTES OTHER,\n REPORTS_TO SMALLINT,\n PHOTO_PATH VARCHAR(255)\n )\n Table EMPLOYEE_TERRITORIES\n (\n EMPLOYEE_ID SMALLINT PRIMARY KEY,\n TERRITORY_ID VARCHAR(20) PRIMARY KEY\n )\n Table ORDERS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n CUSTOMER_ID VARCHAR(5),\n EMPLOYEE_ID SMALLINT,\n ORDER_DATE DATE,\n REQUIRED_DATE DATE,\n SHIPPED_DATE DATE,\n SHIP_VIA SMALLINT,\n FREIGHT OTHER,\n SHIP_NAME VARCHAR(40),\n SHIP_ADDRESS VARCHAR(60),\n SHIP_CITY VARCHAR(15),\n SHIP_REGION VARCHAR(15),\n SHIP_POSTAL_CODE VARCHAR(10),\n SHIP_COUNTRY VARCHAR(15)\n )\n Table ORDER_DETAILS\n (\n ORDER_ID SMALLINT PRIMARY KEY,\n PRODUCT_ID SMALLINT PRIMARY KEY,\n UNIT_PRICE OTHER NOT NULL,\n QUANTITY SMALLINT NOT NULL,\n DISCOUNT OTHER NOT NULL\n )\n Table PRODUCTS\n (\n PRODUCT_ID SMALLINT PRIMARY KEY,\n PRODUCT_NAME VARCHAR(40) NOT NULL,\n SUPPLIER_ID SMALLINT,\n CATEGORY_ID SMALLINT,\n QUANTITY_PER_UNIT VARCHAR(20),\n UNIT_PRICE OTHER,\n UNITS_IN_STOCK SMALLINT,\n UNITS_ON_ORDER SMALLINT,\n REORDER_LEVEL SMALLINT,\n DISCONTINUED INTEGER NOT NULL\n )\n Table REGION\n (\n REGION_ID SMALLINT PRIMARY KEY,\n REGION_DESCRIPTION VARCHAR(60) NOT NULL\n )\n Table SHIPPERS\n (\n SHIPPER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n PHONE VARCHAR(24) NOT NULL\n )\n Table SUPPLIERS\n (\n SUPPLIER_ID SMALLINT PRIMARY KEY,\n COMPANY_NAME VARCHAR(40) NOT NULL,\n CONTACT_NAME VARCHAR(30),\n CONTACT_TITLE VARCHAR(30),\n ADDRESS VARCHAR(60),\n CITY VARCHAR(15),\n REGION VARCHAR(15),\n POSTAL_CODE VARCHAR(10),\n COUNTRY VARCHAR(15),\n PHONE VARCHAR(24),\n FAX VARCHAR(24),\n HOMEPAGE VARCHAR(256)\n )\n Table TERRITORIES\n (\n TERRITORY_ID VARCHAR(20) PRIMARY KEY,\n TERRITORY_DESCRIPTION VARCHAR(60) NOT NULL,\n REGION_ID SMALLINT NOT NULL\n )\n Table US_STATES\n (\n STATE_ID SMALLINT PRIMARY KEY,\n STATE_NAME VARCHAR(100),\n STATE_ABBR VARCHAR(2),\n STATE_REGION VARCHAR(50)\n )\n )\n\n Join ORDERS_CUSTMERS(NORTHWIND.ORDERS.CUSTOMER_ID = NORTHWIND.CUSTOMERS.CUSTOMER_ID)\n Join ORDERS_EMPLOYEES(NORTHWIND.ORDERS.EMPLOYEE_ID = NORTHWIND.EMPLOYEES.EMPLOYEE_ID)\n Join ORDERS_SHIPPERS(NORTHWIND.ORDERS.SHIP_VIA = NORTHWIND.SHIPPERS.SHIPPER_ID)\n Join ORDERS_ORDER_DETAILS(NORTHWIND.ORDERS.ORDER_ID = NORTHWIND.ORDER_DETAILS.ORDER_ID)\n Join ORDERS_DETAILS_PRODUCTS(NORTHWIND.ORDER_DETAILS.PRODUCT_ID = NORTHWIND.PRODUCTS.PRODUCT_ID)\n Join PRODUCTS_CATEGORIES(NORTHWIND.PRODUCTS.CATEGORY_ID = NORTHWIND.CATEGORIES.CATEGORY_ID)\n Join PRODUCTS_SUPPLIERS(NORTHWIND.PRODUCTS.SUPPLIER_ID = NORTHWIND.SUPPLIERS.SUPPLIER_ID)\n Join TERRITORIES_REGION(NORTHWIND.TERRITORIES.REGION_ID = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_EMPLOYEE_TERRITORIES(NORTHWIND.EMPLOYEES.EMPLOYEE_ID = NORTHWIND.EMPLOYEE_TERRITORIES.EMPLOYEE_ID)\n Join EMPLOYEE_TERRITORIES_TERRITORIES(NORTHWIND.EMPLOYEE_TERRITORIES.TERRITORY_ID = NORTHWIND.TERRITORIES.TERRITORY_ID)\n Join CUSTOMER_CURSTOMER_DEMO(NORTHWIND.CUSTOMERS.CUSTOMER_ID = NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_ID)\n Join CURSTOMER_DEMO_DEMOGRAPHICS(NORTHWIND.CUSTOMER_CUSTOMER_DEMO.CUSTOMER_TYPE_ID = NORTHWIND.CUSTOMER_DEMOGRAPHICS.CUSTOMER_TYPE_ID)\n Join EMPLOYEE_REPORTS(NORTHWIND.EMPLOYEES.REPORTS_TO = {target}.EMPLOYEE_ID)\n Join SUPPLIERS_REGION(NORTHWIND.SUPPLIERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join ORDERS_REGION(NORTHWIND.ORDERS.SHIP_REGION = NORTHWIND.REGION.REGION_ID)\n Join CUSTOMERS_REGION(NORTHWIND.CUSTOMERS.REGION = NORTHWIND.REGION.REGION_ID)\n Join EMPLOYEES_REGION(NORTHWIND.EMPLOYEES.REGION = NORTHWIND.REGION.REGION_ID)\n)\n\n\n###Pure\nEnum showcase::northwind::model::crm::Title\n{\n Mr,\n Mrs,\n Miss,\n Ms,\n Dr,\n Sir,\n Professor,\n Duchess,\n Duke\n}\n\nClass showcase::northwind::model::geography::Address\n{\n address: String[0..1];\n city: String[0..1];\n postalCode: String[0..1];\n region: String[0..1];\n country: String[0..1];\n}\n\nClass showcase::northwind::model::crm::Employee\n[\n dateOfBirthNotInTheFuture: $this.dateOfBirth <\n now(),\n dateOfBirthValid: $this.dateOfBirth > %1900-01-01,\n employeeIsOverEighteen: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) >= 18,\n employeeIsUnderEighty: $this.dateOfBirth->dateDiff(\n today(),\n meta::pure::functions::date::DurationUnit.YEARS\n) < 80,\n notDateOfHireNotBeforeDateOfBirth: $this.dateOfHire >\n $this.dateOfBirth\n]\n{\n id: Integer[1];\n lastName: String[1];\n firstName: String[1];\n title: String[0..1];\n preferredTitle: showcase::northwind::model::crm::Title[0..1];\n dateOfBirth: StrictDate[0..1];\n dateOfHire: StrictDate[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n homeTelephoneNumber: String[0..1];\n extension: String[0..1];\n fullName() {if(\n $this.preferredTitle->isNotEmpty(),\n |$this.preferredTitle->toOne()->toString() + ' ',\n |if(\n $this.title->isNotEmpty(),\n |$this.title->toOne() + ' ',\n |''\n )\n) + $this.firstName + ' ' + $this.lastName}: String[1];\n}\n\nClass showcase::northwind::model::geography::USState\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->isEmpty() ||\n ($this.name->toOne()->length() > 0)\n]\n{\n id: Integer[1];\n name: String[0..1];\n code: String[0..1];\n}\n\nClass showcase::northwind::model::OrderLineItem\n{\n quantity: Integer[1];\n unitPrice: Float[1];\n unitPriceCurrency: String[1];\n}\n\nClass showcase::northwind::model::inventory::ProductCategory\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::Order\n{\n id: Integer[1];\n createdDate: StrictDate[0..1];\n requiredDate: StrictDate[0..1];\n shippedDate: StrictDate[0..1];\n shipToName: String[0..1];\n shipToAddress: showcase::northwind::model::geography::Address[0..1];\n itemCount() {$this.lineItems->count()}: Integer[1];\n}\n\nClass showcase::northwind::model::geography::SalesRegion\n[\n idNotNegative: $this.id >= 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: Integer[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::crm::Customer\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n companyName: String[1];\n contactName: String[0..1];\n companyTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n}\n\nClass showcase::northwind::model::crm::CustomerDemographic\n[\n idNotBlank: $this.id->length() > 0\n]\n{\n id: String[1];\n description: String[0..1];\n}\n\nClass showcase::northwind::model::geography::SalesTerritory\n[\n idNotBlank: $this.id->length() > 0,\n descriptionNotBlank: $this.description->length() > 0\n]\n{\n id: String[1];\n description: String[1];\n}\n\nClass showcase::northwind::model::crm::ShippingCompany\n[\n idNotNegative: $this.id >= 0,\n telephoneNumberFormatValid: $this.telephoneNumber->isEmpty() ||\n $this.telephoneNumber->toOne()->matches('(1-)?\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d-\\\\d\\\\d\\\\d\\\\d')\n]\n{\n id: Integer[1];\n name: String[1];\n telephoneNumber: String[1];\n}\n\nClass showcase::northwind::model::inventory::Product\n[\n idNotNegative: $this.id >= 0,\n nameNotBlank: $this.name->length() > 0\n]\n{\n id: Integer[1];\n name: String[1];\n quantityPerUnit: String[0..1];\n unitsInStock: Integer[0..1];\n unitsOnOrder: Integer[0..1];\n reorderLevel: Integer[0..1];\n discontinued: Integer[1];\n}\n\nClass showcase::northwind::model::inventory::Supplier\n{\n id: Integer[1];\n companyName: String[1];\n contactName: String[0..1];\n contactTitle: String[0..1];\n address: showcase::northwind::model::geography::Address[0..1];\n telephoneNumber: String[0..1];\n faxNumber: String[0..1];\n homepageUrl: String[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Employee\n{\n orders: showcase::northwind::model::Order[*];\n employee: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_Shipper\n{\n orders: showcase::northwind::model::Order[*];\n shipper: showcase::northwind::model::crm::ShippingCompany[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Order_OrderLineItem\n{\n order: showcase::northwind::model::Order[1];\n lineItems: showcase::northwind::model::OrderLineItem[*];\n}\n\nAssociation showcase::northwind::model::associations::Order_Customer\n{\n orders: showcase::northwind::model::Order[*];\n customer: showcase::northwind::model::crm::Customer[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Category\n{\n category: showcase::northwind::model::inventory::ProductCategory[0..1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Region\n{\n region: showcase::northwind::model::geography::SalesRegion[1];\n territories: showcase::northwind::model::geography::SalesTerritory[1..*];\n}\n\nAssociation showcase::northwind::model::associations::Customer_CustomerDemographics\n{\n customers: showcase::northwind::model::crm::Customer[*];\n demographics: showcase::northwind::model::crm::CustomerDemographic[*];\n}\n\nAssociation showcase::northwind::model::associations::Employee_Manager\n{\n reports: showcase::northwind::model::crm::Employee[*];\n manager: showcase::northwind::model::crm::Employee[0..1];\n}\n\nAssociation showcase::northwind::model::associations::Product_Suppliers\n{\n supplier: showcase::northwind::model::inventory::Supplier[1];\n products: showcase::northwind::model::inventory::Product[*];\n}\n\nAssociation showcase::northwind::model::associations::Terriroties_Employees\n{\n employees: showcase::northwind::model::crm::Employee[*];\n territories: showcase::northwind::model::geography::SalesTerritory[*];\n}\n\nAssociation showcase::northwind::model::associations::OrderLineItem_Product\n{\n orderLineItems: showcase::northwind::model::OrderLineItem[*];\n product: showcase::northwind::model::inventory::Product[1];\n}\n\n\n###Mapping\nMapping showcase::northwind::mapping::NorthwindMapping\n(\n showcase::northwind::model::inventory::ProductCategory[Category]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.CATEGORY_NAME,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CATEGORIES.DESCRIPTION\n }\n showcase::northwind::model::crm::Customer[Customer]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CUSTOMER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_NAME,\n companyTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.CUSTOMERS.FAX\n }\n showcase::northwind::model::crm::Employee[Employee]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EMPLOYEE_ID,\n lastName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.LAST_NAME,\n firstName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.FIRST_NAME,\n title: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE,\n preferredTitle: EnumerationMapping TitleMapping: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.TITLE_OF_COURTESY,\n dateOfBirth: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.BIRTH_DATE,\n dateOfHire: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HIRE_DATE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.COUNTRY\n ),\n homeTelephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.HOME_PHONE,\n extension: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.EMPLOYEES.EXTENSION\n }\n showcase::northwind::model::Order[Order]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_ID,\n createdDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.ORDER_DATE,\n requiredDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.REQUIRED_DATE,\n shippedDate: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIPPED_DATE,\n shipToName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_NAME,\n shipToAddress\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDERS.SHIP_COUNTRY\n )\n }\n showcase::northwind::model::OrderLineItem[OrderLineItem]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.ORDER_ID,\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS\n quantity: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.QUANTITY,\n unitPrice: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.ORDER_DETAILS.UNIT_PRICE,\n unitPriceCurrency: 'USD'\n }\n showcase::northwind::model::inventory::Product[Product]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.PRODUCT_NAME,\n quantityPerUnit: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.QUANTITY_PER_UNIT,\n unitsInStock: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_IN_STOCK,\n unitsOnOrder: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.UNITS_ON_ORDER,\n reorderLevel: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.REORDER_LEVEL,\n discontinued: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.PRODUCTS.DISCONTINUED\n }\n showcase::northwind::model::geography::SalesRegion[Region]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.REGION.REGION_DESCRIPTION\n }\n showcase::northwind::model::crm::ShippingCompany[Shipper]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.SHIPPER_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.COMPANY_NAME,\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SHIPPERS.PHONE\n }\n showcase::northwind::model::inventory::Supplier[Supplier]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.SUPPLIER_ID,\n companyName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COMPANY_NAME,\n contactName: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_NAME,\n contactTitle: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CONTACT_TITLE,\n address\n (\n address: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.ADDRESS,\n city: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.CITY,\n region: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.REGION,\n postalCode: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.POSTAL_CODE,\n country: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.COUNTRY\n ),\n telephoneNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.PHONE,\n faxNumber: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.FAX,\n homepageUrl: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.SUPPLIERS.HOMEPAGE\n }\n showcase::northwind::model::geography::SalesTerritory[Territory]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_ID,\n description: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.TERRITORIES.TERRITORY_DESCRIPTION\n }\n showcase::northwind::model::geography::USState[USState]: Relational\n {\n ~primaryKey\n (\n [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID\n )\n ~mainTable [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES\n id: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ID,\n name: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_NAME,\n code: [showcase::northwind::store::NorthwindDatabase]NORTHWIND.US_STATES.STATE_ABBR\n }\n\n showcase::northwind::model::associations::Order_Customer: Relational\n {\n AssociationMapping\n (\n orders[Customer,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS,\n customer[Order,Customer]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_CUSTMERS\n )\n }\n showcase::northwind::model::associations::Order_Employee: Relational\n {\n AssociationMapping\n (\n orders[Employee,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES,\n employee[Order,Employee]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_EMPLOYEES\n )\n }\n showcase::northwind::model::associations::Order_Shipper: Relational\n {\n AssociationMapping\n (\n orders[Shipper,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS,\n shipper[Order,Shipper]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_SHIPPERS\n )\n }\n showcase::northwind::model::associations::Order_OrderLineItem: Relational\n {\n AssociationMapping\n (\n order[OrderLineItem,Order]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS,\n lineItems[Order,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_ORDER_DETAILS\n )\n }\n showcase::northwind::model::associations::OrderLineItem_Product: Relational\n {\n AssociationMapping\n (\n orderLineItems[Product,OrderLineItem]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS,\n product[OrderLineItem,Product]: [showcase::northwind::store::NorthwindDatabase]@ORDERS_DETAILS_PRODUCTS\n )\n }\n showcase::northwind::model::associations::Product_Category: Relational\n {\n AssociationMapping\n (\n category[Product,Category]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES,\n products[Category,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_CATEGORIES\n )\n }\n showcase::northwind::model::associations::Product_Suppliers: Relational\n {\n AssociationMapping\n (\n supplier[Product,Supplier]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS,\n products[Supplier,Product]: [showcase::northwind::store::NorthwindDatabase]@PRODUCTS_SUPPLIERS\n )\n }\n showcase::northwind::model::associations::Terriroties_Region: Relational\n {\n AssociationMapping\n (\n region[Territory,Region]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION,\n territories[Region,Territory]: [showcase::northwind::store::NorthwindDatabase]@TERRITORIES_REGION\n )\n }\n showcase::northwind::model::associations::Terriroties_Employees: Relational\n {\n AssociationMapping\n (\n employees[Territory,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES,\n territories[Employee,Territory]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEES_EMPLOYEE_TERRITORIES > [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_TERRITORIES_TERRITORIES\n )\n }\n showcase::northwind::model::associations::Employee_Manager: Relational\n {\n AssociationMapping\n (\n reports[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS,\n manager[Employee,Employee]: [showcase::northwind::store::NorthwindDatabase]@EMPLOYEE_REPORTS\n )\n }\n\n showcase::northwind::model::crm::Title: EnumerationMapping TitleMapping\n {\n Mr: ['Mr.'],\n Mrs: ['Mrs.'],\n Miss: ['Miss.'],\n Ms: ['Ms.'],\n Dr: ['Dr.'],\n Sir: ['Sir.'],\n Professor: ['Prof.'],\n Duchess: ['Duchess.'],\n Duke: ['Duke.']\n }\n)\n\n\n###Runtime\nRuntime showcase::northwind::runtime::NorthwindRuntime\n{\n mappings:\n [\n showcase::northwind::mapping::NorthwindMapping\n ];\n connections:\n [\n showcase::northwind::store::NorthwindDatabase:\n [\n connection_1:\n #{\n RelationalDatabaseConnection\n {\n store: showcase::northwind::store::NorthwindDatabase;\n type: H2;\n specification: LocalH2\n {\n testDataSetupSqls: [\n 'call loadNorthwindData()'\n ];\n };\n auth: DefaultH2;\n }\n }#\n ]\n ];\n}\n"},{"title":"Service Store Connection","documentation":"Service Store connection is linked to External Formats.","development":true,"path":"Store/Service Store/Connection","code":""},{"title":"Service Store Mapping","documentation":"TODO: Some dummy description","development":true,"path":"Store/Service Store/Mapping","code":""},{"title":"Service Store","documentation":"TODO: Some dummy description","development":true,"path":"Store/Service Store/Store","code":""}] \ No newline at end of file