First post for months; the PerformancePoint Planning announcement forced some redirection and rebuilding. We’ve grieved, we’ve moaned, but at some point, you just have to move on.
—————–
I’m not a fan of hacks – it normally means you are doing something wrong, but in this case, where I’m after a quick win, I’ve had to work out and resort to a bit of a hack. It actually looks like the issue I’m facing maybe addressed in Entity Framework v2 (Microsoft .NET 4.0) – so maybe it’s more of a workaround than a hack after all ;o)
I’m using the ADO.NET Entity Framework and ADO.NET Data Services to expose a subsection of a database for consumption by Gemini. In order to relate the exposed database objects together in Gemini, I need to apply this hack to ensure I have Foreign Keys available in my Gemini models to support creating the relationships. By default, the Entity Framework exposes Foreign Keys as Navigation Properties rather than Scalar Properties. Gemini does not consume Navigation Properties.
Lets take the scenario where I want to create an Entity Framework Model based on the following tables from the AdventureWorksDW2008 sample database:
-FactInternetSales
-DimCustomer
-DimProduct
-DimSalesTerritory
Step 1) Identify the table(s) that contain Foreign Keys.
In this case FactInternetSales.
Step 2) Load those table(s) into the Entity Framework Model on their own.
This ensures the Foreign Keys are set as Scalar Properties. If you load in all the tables at once, the Foreign Keys are not exposed as Scalar Properties.
Step 3) Load in the related tables. (DimCustomer, DimProduct, DimSalesTerritory)
At this point a bunch of Navigation Properties would have been set up, along with relationships between the related tables but the trouble now is the project will no longer build. If you try you receive the following error for each relationship:
Error 3007: Problem in Mapping Fragments starting at lines 322, 428: Non-Primary-Key column(s) [CustomerKey] are being mapped in both fragments to different conceptual side properties – data inconsistency is possible because the corresponding conceptual side properties can be independently modified.
Step 4) Manually remove the relationships between tables.
Clicking on the relationship line on the diagram and hitting delete, removes the relationship.
Step 5) Remove all Association Sets
By editing the edmx file manually in a text or XML editor you need to remove all … occurrences from the section:
<EntityContainer Name="AdventureWorksDW2008Model1StoreContainer"> <EntitySet Name="DimCustomer" EntityType="AdventureWorksDW2008Model1.Store.DimCustomer" … /> <EntitySet Name="DimProduct" EntityType="AdventureWorksDW2008Model1.Store.DimProduct" … /> <EntitySet Name="DimSalesTerritory" EntityType="AdventureWorksDW2008Model1.Store.DimSalesTerritory" … /> <EntitySet Name="FactInternetSales" EntityType="AdventureWorksDW2008Model1.Store.FactInternetSales" … /> <AssociationSet Name="FK_FactInternetSales_DimCustomer" Association="AWDW08.FK_FactInternetSales_DimCustomer"> <End Role="DimCustomer" EntitySet="DimCustomer" /> <End Role="FactInternetSales" EntitySet="FactInternetSales" /> </AssociationSet> <AssociationSet Name="FK_FactInternetSales_DimProduct" Association="AWDW08.FK_FactInternetSales_DimProduct"> <End Role="DimProduct" EntitySet="DimProduct" /> <End Role="FactInternetSales" EntitySet="FactInternetSales" /> </AssociationSet> <AssociationSet Name="FK_FactInternetSales_DimSalesTerritory" Association="ADW08.FK_FactInternetSales_DimSalesTerritory"> <End Role="DimSalesTerritory" EntitySet="DimSalesTerritory" /> <End Role="FactInternetSales" EntitySet="FactInternetSales" /> </AssociationSet> </EntityContainer>
The project should now build, with the foreign keys exposed as Scalar Properties. Obviously no inherent relationships exist, so this could be dangerous in certain applications. For Gemini however, providing you setup the relationships manually, it works a treat.
Introduction to Data Wrangler in Microsoft Fabric
What is Data Wrangler? A key selling point of Microsoft Fabric is the Data Science
Jul
Autogen Power BI Model in Tabular Editor
In the realm of business intelligence, Power BI has emerged as a powerful tool for
Jul
Microsoft Healthcare Accelerator for Fabric
Microsoft released the Healthcare Data Solutions in Microsoft Fabric in Q1 2024. It was introduced
Jul
Unlock the Power of Colour: Make Your Power BI Reports Pop
Colour is a powerful visual tool that can enhance the appeal and readability of your
Jul
Python vs. PySpark: Navigating Data Analytics in Databricks – Part 2
Part 2: Exploring Advanced Functionalities in Databricks Welcome back to our Databricks journey! In this
May
GPT-4 with Vision vs Custom Vision in Anomaly Detection
Businesses today are generating data at an unprecedented rate. Automated processing of data is essential
May
Exploring DALL·E Capabilities
What is DALL·E? DALL·E is text-to-image generation system developed by OpenAI using deep learning methodologies.
May
Using Copilot Studio to Develop a HR Policy Bot
The next addition to Microsoft’s generative AI and large language model tools is Microsoft Copilot
Apr