cs327e-wcdb's People
cs327e-wcdb's Issues
Requirement 4
Write and push acceptance tests
Requirement 5
Create, validate with instance and push XML schema
Produce Unit Tests
Submit and Verify
SQL Queries with Results
Commit 5 times
Requirement 1
Set up git repo
pydoc Documentation
xpaths for keyref selectors need to be updated with example
MySQL I/O files
Include assert in python code (we missed points for this last time)
Requirement 2
Create issues for each requirement
Push/Pull XML Schema/Instance
Presentation
WCDB2.py
First - I started translating the XML to a MySQL schema - you can see what I worked on here: https://github.com/conrad-vanl/cs327e-wcdb/blob/master/SCHEMA.md - please note Types don't correspond to actual MySQL data types as I was tired
WCDB2.py is getting pretty long, but I'm trying to keep everything well organized. The start of the document sets up the global variables and settings, such as MySQL connection info and the DB schemas (if anyone wanted to help in creating the schemas here that'd be awesome!). From there, everything is broken up into small classes. I've tried to add comments at the beginning of each class to describe what it does. Instead of explaining how everything works, I think I'll just show you:
> import WCDB2
> factory = WCDB2.Factory()
# now the database tables have been created and we're ready to import/export XML (i/o not yet completed, but would look like this: factory.import_xml_from_file(filename), factory.export_xml())
# Note: running factory isn't required if you just want to play around with MySQL queries:
> WCDB2.DEFAULT_CONNECTION.query("show tables")
# ^ if this doesn't return any tables, you probably just need to create them: WCDB2.DEFAULT_CONNECTION.setup_database()
# Moving on: I don't have the XML import/export function to MySQL completed yet, but you can still create records by hand:
> crisis = WCDB2.Crisis(crisis_id="Japan_Earthquake", name="2011 Great East Japan Earthquake and Tsunami", startDateTime="2038-01-19 03:14:59")
> crisis.persist() # persists/saves/stores the crisis to the database
> WCDB2.Crisis.select() # finds/selects * Crises from database
# [{'crisis_id': 'Japan_Earthquake', 'name': '2011 Great East Japan Earthquake and Tsunami', 'endDateTime': None, 'ecnomicImpact': None, 'crisisKind_id': '', 'startDatetime': '2038-01-19 03:14:59'}]
If anyone has time, it'd be a great help to knock out the rest of the schemas at the top. Like I said, I kind of mapped everything out on the repo in SCHEMA.md, but the Types in those tables don't always correspond to MySQL. http://dev.mysql.com/doc/refman/5.0/en/data-types.html
I also might need help creating the serialization methods that converts from XML to a model / from a model to XML. Maybe not. We'll see.
Lastly: design wise with the schema, here's what I've done:
- Table names are plural of the relation (Crises table, crisis records)
- only foreign keys contain the relation name in them (crisis_id, crisisKind_id, etc...and name isn't crisisName or cName or anything like that, just name)
- based on the XML, any complex type that can occur more then once needs it's own table, otherwise, camelize the path to the element and make it an attribute (thus crazy contactInfoPostalAddressStreetAddress)
Did I mention all this can be up for debate?
Submit and Verify
Requirement 8
Submit
Requirement 3
Write and push unit tests
Commit 5 times
UML pdf diagram
UML pdf diagram
Acceptance Tests
Finalize XML Data File Example
File needs to be doubled checked before posting to Piazza.
The location attribute of person is not present on the example file - are we doing a similar coordinate style location seen in crises or should this be country, province(state/region), city?
It would be good to start looking at other common elements that will need id's, such as location, occupation, DOB?, etc.
And we need to finalize the way id keys for orgs/ppl/crises are constructed.
Requirement 7
Document interfaces with pydoc
Requirement 6
Optimize
Python Code with Assertions
Google Forms
Produce Acceptance Tests
Unit Tests
pydoc Documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.