无忧论文网 · 始于1999 · 学术论文辅导与论文发表推荐服务

留学生作业:对一篇计算机编程类作业的描述及要求

栏目
公文
具体类型
其他公文
语言
中文
用途
范文参考
更新

摘要

这是一篇留学生课程作业,主要对作业的项目描述及要求,作业的提交进行了详细的描述。

公文正文

1. Aims
目标

You are required to perform a series of data cleaning, loading, and querying operations on a real-world dataset. This will give you a clear picture of a typical data warehousing process and an intuitive idea of the data quality problems in real-world data.
你需要完成一系列的数据清理,加载,,在一个真实世界的数据集和查询操作。这会给你一个典型的数据仓库过程中画面清晰和直观的想法在现实世界中的数据的数据质量问题。


2. Project Description
项目描述

2.1 Install Kettle
安装Kettle

• Download and install kettle v4.1.0.
• Choose "No repository" when starting kettle.(Run spoon.bat in Windows or ./spoon.sh in Linux.)
You may find a local copy of the following softwares here.

2.2 Data and Other Files
数据和其他文件

All the files provided in this project can be found here.
The original data file is named archdata.csv. The data file was modified from TBAE(downloaded on 10 March 2011). It contains information about architects registered in Texas, USA. See more information.[5]
Create a folder named proj1 under kettle's main directory, and place the data files there. This ensures that you can access the input file by the following relative path: proj1/archdata.csv.
Note that you should always use relative paths in your transformation and all the outputs should be placed under proj1/.

2.3 Your First Task: Cleaning the data
你的第一个任务:清理数据

You need to clean the original data file before loading it into the database. Specifically, you need to:
• Remove records with duplicate RegNo values. You can retain any of the duplicate records.
• Standardize the string values. Firstly, convert all the string values (i.e., Name, Address1, Address2, Address3, City, State) into upper cases. Secondly, trim the white space before and after all the strings.
• Concatenate string Address2 and Address3 using a space as separator. Replace Address2 with the new string.
• Clean the records with addresses outside US or invalid zip codes
1 When state value is OT, we can indentify this address is outside US.
1 The basic zip code includes five numerical digits and an extended zip code includes five digits of the zip code, a hyphen and four more digits. Therefore, zip values like NW3 2JE or NULL values are not accepted.
1 Output the above records to a CSV file named ot.csv
• Standardize the zip codes. For extended zip codes made up of XXXXX-YYYY, we only retain the XXXXX part.
• Clean the records with inconsistent city and zip code.
1 Import the zip code database at proj1/zipcode.xls in the format of MS Excel.
1 For each record in archdata, verify the value of zip, city and state with the standard records in the zip code database. In other words, the zip code in archdata must appear in the zip code database and the corresponding state and city should be identical with those in the database.
1 Output the inconsistent records to a CSV file named err.csv
• The cleaned data should be output to a CSV file named clean.csv. For all output CSV files, you need to use , (comma) to separate different fields and you need to enforce closing each field with ". You should also use the format yyyy-MM-dd to format dates. The output file should follow the schema as {RegNo,Name,Address1,Address2,City,State,Zip,Certified,Expiration}.

2.4 Install MySQL and Create the Database Schema
安装MySQL并建立数据库模式

Although you can use other full-fledged RDBMSs (e.g., Oracle, PostgreSQL), it is recommended to use MySQL so that you do not need to modify files provided for this project. You should create a database named archdata, and a user named archdata with password archdata. This can be done by the following commands:
    $ mysqladmin -uroot -p create archdata
    $ mysql -uroot -p
    mysql> grant all privileges on *.* to 'archdata'@'localhost' identified by 'archdata';
    mysql> quit

You can then login to MySQL and execute the source archdata_star.sql. This creates the star schema for the archdata cube. You are NOT allowed to modify the schema.
   mysql> source archdata_star.sql

2.5 Setup Mondrian

Download and install Mondrian (Note: not the embedded version). Follow a brief tutorial for MYSQL + Mondrian setup or the installation guide[4] to set Mondrian up so that it works with the JSP server (e.g., tomcat or resin). Basically, you need to explode mondrian.war to webapp/mondrian. You need to copy the appropriate jdbc driver (e.g. mysql-connector-java-bin.jar) to apache-tomcat/lib or mondrian/WEB-INF/lib.
2.6 Your Second Task: Loading the Data
You need to import the clean data (i.e., clean.csv) into mysql.
You may use kettle to construct a transformation to populate the database from the CSV file; otherwise you may write a program to perform the loading.
2.7 Your Second Task: Writing an MDX Query
You need to
• copy archdata.html to mondrian.
• create a cube definition file named archdata.xml. The cube is named archdata and has one measure RegCount, which counts the number of registrations. The cube has three dimensions:
o Location, with three levels: State, City, Zip.
o CerTime, with three levels: Year, Month, Day.
o ExpTime, with three levels: Year, Month, Day.
• You can refer to the chapter How to Design a Mondrian Schema in the Mondrain documentation. The file needs to be placed at mondrian/WEB-INF/queries.
• copy archdata.jsp file to mondrian/WEB-INF/queries, and edit the file to edit the MDX query (enclosed in the jp:mondrianQuery tag).
You need to write an MDX query that for each state list the number of registrations certificated in each year from 2006 to 2011, and sort the states in decreasing order of the total number of registrations in 2006-2011.
o Copy the archdata.jsp file to webapps/mondrian/WEB-INF/queries/ and modify both the connection settings and the MDX query.
o Write down the output of the query in a text file named proj1.txt.

3. Submission
提交

We accept electronic submissions only. If you have any problems on submission, please mail to appointed mailbox before the deadline.
If, for some reason, you think you will be unable to submit a piece of work at the appropriate time, contact the lecturer-in-charge or the course administrator immediately. Note that without special reasons, it will not be possible to grant extensions to submissions. You should simply submit whatever you have done by the time the deadline arrives and you will be marked based on this, possibly adjusted if you contacted the administrators at least three days before the deadline to explain your situation.
我们只接受电子投稿。如果您有任何问题提交,请在截止日期前邮件到指定邮箱。
如果出于某种原因,你认为你将无法在适当的时候提交一个作品,立即联系负责讲师或课程管理员。请注意,无特殊原因,它不会授予提交的扩展。您应该简单地提交不管你做的最后期限到来的时候,你会被标记在此基础上,如果你的管理员联系,在截止日期前至少三天来解释你的情况可能调整。

You should submit the following files:
• the three files: clean.csv, ot.csv and err.csv
• the kettle transformation file (named proj1.ktr) to perform the cleaning
• the cube schema configuration file archdata.xml
• a jsp file archdata.jsp containing the MDX query.
• a text file proj1.txt containing the query result.
You should use the following command to submit the files:
    give cs9318 proj1 clean.csv ot.csv err.csv proj1.ktr archdata.xml archdata.jsp proj1.txt