<commit_before><!--
  == $Id$
  == This software is subject to the terms of the Common Public License
  == Agreement, available at the following URL:
  == http://www.opensource.org/licenses/cpl.html.
  == (C) Copyright 2000-2002 Kana Software, Inc. and others.
  == All Rights Reserved.
  == You must accept the terms of that agreement to use this software.
  -->
<Schema>

<!-- Shared dimensions -->

	<Dimension name="Store">
		<Hierarchy hasAll="true" primaryKey="store_id">
			<Table name="store"/>
			<Level name="Store Country" column="store_country" uniqueMembers="true"/>
			<Level name="Store State" column="store_state" uniqueMembers="true"/>
			<Level name="Store City" column="store_city" uniqueMembers="false"/>
			<Level name="Store Name" column="store_name" uniqueMembers="true">
				<Property name="Store Type" column="store_type"/>
				<Property name="Store Manager" column="store_manager"/>
				<Property name="Store Sqft" column="store_sqft" type="Numeric"/>
				<Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
				<Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
				<Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
				<Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
				<Property name="Street address" column="store_street_address" type="String"/>
			</Level>
		</Hierarchy>
	</Dimension>

	<Dimension name="Store Size in SQFT">
		<Hierarchy hasAll="true" primaryKey="store_id">
			<Table name="store"/>
			<Level name="Store Sqft" column="store_sqft" type="Numeric" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>

	<Dimension name="Store Type">
		<Hierarchy hasAll="true" primaryKey="store_id">
			<Table name="store"/>
			<Level name="Store Type" column="store_type" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>

	<Dimension name="Time" foreignKey="time_id">
		<Hierarchy hasAll="false" primaryKey="time_id">
			<Table name="time_by_day"/>
			<Level name="Year" column="the_year" type="Numeric" uniqueMembers="true"/>
			<Level name="Quarter" column="quarter" uniqueMembers="false"/>
			<Level name="Month" column="month_of_year" uniqueMembers="false" type="Numeric"/>
		</Hierarchy>
	</Dimension>

	<Dimension name="Product" foreignKey="product_id">
		<Hierarchy hasAll="true" primaryKey="product_id" primaryKeyTable="product">
			<Join leftKey="product_class_id" rightKey="product_class_id">
				<Table name="product"/>
				<Table name="product_class"/>
			</Join>
<!--
			<Query>
				<SQL dialect="generic">
SELECT *
FROM "product", "product_class"
WHERE "product"."product_class_id" = "product_class"."product_class_id"
				</SQL>
			</Query>
			<Level name="Product Family" column="product_family" uniqueMembers="true"/>
			<Level name="Product Department" column="product_department" uniqueMembers="false"/>
			<Level name="Product Category" column="product_category" uniqueMembers="false"/>
			<Level name="Product Subcategory" column="product_subcategory" uniqueMembers="false"/>
			<Level name="Brand Name" column="brand_name" uniqueMembers="false"/>
			<Level name="Product Name" column="product_name" uniqueMembers="true"/>
-->
			<Level name="Product Family" table="product_class" column="product_family" uniqueMembers="true"/>
			<Level name="Product Department" table="product_class" column="product_department" uniqueMembers="false"/>
			<Level name="Product Category" table="product_class" column="product_category" uniqueMembers="false"/>
			<Level name="Product Subcategory" table="product_class" column="product_subcategory" uniqueMembers="false"/>
			<Level name="Brand Name" table="product" column="brand_name" uniqueMembers="false"/>
			<Level name="Product Name" table="product" column="product_name" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>

	<Dimension name="Warehouse">
		<Hierarchy hasAll="true" primaryKey="warehouse_id">
			<Table name="warehouse"/>
			<Level name="Country" column="warehouse_country" uniqueMembers="true"/>
			<Level name="State Province" column="warehouse_state_province" uniqueMembers="true"/>
			<Level name="City" column="warehouse_city" uniqueMembers="false"/>
			<Level name="Warehouse Name" column="warehouse_name" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>

<!-- Sales -->
<Cube name="Sales">
	<Table name="sales_fact_1997"/>
	<DimensionUsage name="Store" source="Store" foreignKey="store_id"/>
	<DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT" foreignKey="store_id"/>
	<DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
	<DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
	<DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
	<Dimension name="Promotion Media" foreignKey="promotion_id">
		<Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id">
			<Table name="promotion"/>
			<Level name="Media Type" column="media_type" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>
	<Dimension name="Promotions" foreignKey="promotion_id">
		<Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id">
			<Table name="promotion"/>
			<Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>
	<Dimension name="Customers" foreignKey="customer_id">
		<Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id">
			<Table name="customer"/>
			<Level name="Country" column="country" uniqueMembers="true"/>
			<Level name="State Province" column="state_province" uniqueMembers="true"/>
			<Level name="City" column="city" uniqueMembers="false"/>
			<Level name="Name" uniqueMembers="true">
				<ExpressionView>
					<SQL dialect="oracle">
"fname" || ' ' || "lname"
					</SQL>
					<SQL dialect="access">
[fname] + ' ' + [lname]
					</SQL>
					<SQL dialect="postgres">
"fname" || ' ' || "lname"
					</SQL>
					<SQL dialect="mysql">
CONCAT(`customer`.`fname`, " ", `customer`.`lname`)
					</SQL>
					<SQL dialect="generic">
"lname"
					</SQL>
				</ExpressionView>
				<Property name="Gender" column="gender"/>
				<Property name="Marital Status" column="marital_status"/>
				<Property name="Education" column="education"/>
				<Property name="Yearly Income" column="yearly_income"/>
			</Level>
		</Hierarchy>
	</Dimension>
	<Dimension name="Education Level" foreignKey="customer_id">
		<Hierarchy hasAll="true" primaryKey="customer_id">
			<Table name="customer"/>
			<Level name="Education Level" column="education" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>
	<Dimension name="Gender" foreignKey="customer_id">
		<Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
			<Table name="customer"/>
			<Level name="Gender" column="gender" uniqueMembers="true"/>
		</Hierarchy><commit_msg>Change Foodmart.xml, Dimension Customers, remove brackets around [fname] and [lname] (Access)<commit_after><!--
  == $Id$
  == This software is subject to the terms of the Common Public License
  == Agreement, available at the following URL:
  == http://www.opensource.org/licenses/cpl.html.
  == (C) Copyright 2000-2002 <NAME>, Inc. and others.
  == All Rights Reserved.
  == You must accept the terms of that agreement to use this software.
  -->
<Schema>

<!-- Shared dimensions -->

	<Dimension name="Store">
		<Hierarchy hasAll="true" primaryKey="store_id">
			<Table name="store"/>
			<Level name="Store Country" column="store_country" uniqueMembers="true"/>
			<Level name="Store State" column="store_state" uniqueMembers="true"/>
			<Level name="Store City" column="store_city" uniqueMembers="false"/>
			<Level name="Store Name" column="store_name" uniqueMembers="true">
				<Property name="Store Type" column="store_type"/>
				<Property name="Store Manager" column="store_manager"/>
				<Property name="Store Sqft" column="store_sqft" type="Numeric"/>
				<Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
				<Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
				<Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
				<Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
				<Property name="Street address" column="store_street_address" type="String"/>
			</Level>
		</Hierarchy>
	</Dimension>

	<Dimension name="Store Size in SQFT">
		<Hierarchy hasAll="true" primaryKey="store_id">
			<Table name="store"/>
			<Level name="Store Sqft" column="store_sqft" type="Numeric" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>

	<Dimension name="Store Type">
		<Hierarchy hasAll="true" primaryKey="store_id">
			<Table name="store"/>
			<Level name="Store Type" column="store_type" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>

	<Dimension name="Time" foreignKey="time_id">
		<Hierarchy hasAll="false" primaryKey="time_id">
			<Table name="time_by_day"/>
			<Level name="Year" column="the_year" type="Numeric" uniqueMembers="true"/>
			<Level name="Quarter" column="quarter" uniqueMembers="false"/>
			<Level name="Month" column="month_of_year" uniqueMembers="false" type="Numeric"/>
		</Hierarchy>
	</Dimension>

	<Dimension name="Product" foreignKey="product_id">
		<Hierarchy hasAll="true" primaryKey="product_id" primaryKeyTable="product">
			<Join leftKey="product_class_id" rightKey="product_class_id">
				<Table name="product"/>
				<Table name="product_class"/>
			</Join>
<!--
			<Query>
				<SQL dialect="generic">
SELECT *
FROM "product", "product_class"
WHERE "product"."product_class_id" = "product_class"."product_class_id"
				</SQL>
			</Query>
			<Level name="Product Family" column="product_family" uniqueMembers="true"/>
			<Level name="Product Department" column="product_department" uniqueMembers="false"/>
			<Level name="Product Category" column="product_category" uniqueMembers="false"/>
			<Level name="Product Subcategory" column="product_subcategory" uniqueMembers="false"/>
			<Level name="Brand Name" column="brand_name" uniqueMembers="false"/>
			<Level name="Product Name" column="product_name" uniqueMembers="true"/>
-->
			<Level name="Product Family" table="product_class" column="product_family" uniqueMembers="true"/>
			<Level name="Product Department" table="product_class" column="product_department" uniqueMembers="false"/>
			<Level name="Product Category" table="product_class" column="product_category" uniqueMembers="false"/>
			<Level name="Product Subcategory" table="product_class" column="product_subcategory" uniqueMembers="false"/>
			<Level name="Brand Name" table="product" column="brand_name" uniqueMembers="false"/>
			<Level name="Product Name" table="product" column="product_name" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>

	<Dimension name="Warehouse">
		<Hierarchy hasAll="true" primaryKey="warehouse_id">
			<Table name="warehouse"/>
			<Level name="Country" column="warehouse_country" uniqueMembers="true"/>
			<Level name="State Province" column="warehouse_state_province" uniqueMembers="true"/>
			<Level name="City" column="warehouse_city" uniqueMembers="false"/>
			<Level name="Warehouse Name" column="warehouse_name" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>

<!-- Sales -->
<Cube name="Sales">
	<Table name="sales_fact_1997"/>
	<DimensionUsage name="Store" source="Store" foreignKey="store_id"/>
	<DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT" foreignKey="store_id"/>
	<DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
	<DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
	<DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
	<Dimension name="Promotion Media" foreignKey="promotion_id">
		<Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id">
			<Table name="promotion"/>
			<Level name="Media Type" column="media_type" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>
	<Dimension name="Promotions" foreignKey="promotion_id">
		<Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id">
			<Table name="promotion"/>
			<Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>
	<Dimension name="Customers" foreignKey="customer_id">
		<Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id">
			<Table name="customer"/>
			<Level name="Country" column="country" uniqueMembers="true"/>
			<Level name="State Province" column="state_province" uniqueMembers="true"/>
			<Level name="City" column="city" uniqueMembers="false"/>
			<Level name="Name" uniqueMembers="true">
				<ExpressionView>
					<SQL dialect="oracle">
"fname" || ' ' || "lname"
					</SQL>
					<SQL dialect="access">
fname + ' ' + lname
					</SQL>
					<SQL dialect="postgres">
"fname" || ' ' || "lname"
					</SQL>
					<SQL dialect="mysql">
CONCAT(`customer`.`fname`, " ", `customer`.`lname`)
					</SQL>
					<SQL dialect="generic">
"lname"
					</SQL>
				</ExpressionView>
				<Property name="Gender" column="gender"/>
				<Property name="Marital Status" column="marital_status"/>
				<Property name="Education" column="education"/>
				<Property name="Yearly Income" column="yearly_income"/>
			</Level>
		</Hierarchy>
	</Dimension>
	<Dimension name="Education Level" foreignKey="customer_id">
		<Hierarchy hasAll="true" primaryKey="customer_id">
			<Table name="customer"/>
			<Level name="Education Level" column="education" uniqueMembers="true"/>
		</Hierarchy>
	</Dimension>
	<Dimension name="Gender" foreignKey="customer_id">
		<Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
			<Table name="customer"/>
			<Level name="Gender" column="gender" uniqueMembers="true"/>
		</Hierarchy>
{'fraction_non_alphanumeric': 0.16667886684722935, 'fraction_numerical': 0.0017568260010248152, 'mean_word_length': 5.91746835443038, 'pattern_counts': {'":': 0, '<': 268, '<?xml version=': 0, '>': 268, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3694652', 'n_tokens_mistral': 4652, 'n_tokens_neox': 4165, 'n_words': 934}