XQuery Studio
XQuery on Wikipedia
W3C XQuery Requirements
W3C XQuery Recommendation
Querying XML Data with XQuery
What is XQuery?
Oracle - XQuery Flowers
Oracle - XQuery: A New Way to Search
Querying, Constructing, and Transforming XML with Oracle XQuery
XQuery Presentation by CafeConLeche
W3 Schools XQuery Tutorial
Consider providing a paragraph or two about your opinions on XQuery usefulness and syntax.
Your Answer:
XQuery is a useful and effective way to gather relevant information from an XML database. The syntax is intuitive, especially the format used to reference nodes. The syntax reflects one of the intrinsic properties of XML: hierarchy. Compared to SQL, one can see that the FLWOR (For, Let, Where, Order by, Return) syntax is well equipped for drilling into a document, but is poorly equipped for handling entity relationships. Since relational databases are built around relational algebra, it makes sense that SQL implementations have syntax for joining and aggregating data.
Part of the usefulness of XML-the fact that it can be edited by humans, and read by machines-is also its downfall. Because every part of the XML document must be editable by humans without special tools, there is no way to efficiently search in a document. Because there's no mechanism to tell the computer at which byte of the document the desired node might be, the computer needs to store the entire XML document in memory when performing a query. This is acceptable for small amounts of data; but as we could see from the OWorld server, it's not very scalable. We ran eXist on a server with more memory than the OWorld server and only 80% of the class xml data, and could crash the server with one memory-intensive query. We did not find anything in the configuration files that suggested an alternative configuration to overcome the performance shortfall.
XML and XQuery seem to have an easier learning curve than relational databases and SQL. XML is extremely flexible and intuitive, so it definitely is appropriate to use. Because modeling entity relationships isn't native to XML and because of the performance limitations inherent to XML applications, those applications that require speedy processing of many data would be adversely affected by XML use. XML is a great format for subsets of all the data, partly because of the ease and intuitive nature of XQuery.
XQuery is useful for performing queries on embedded data in documents, applicable to database system such as catalogs and company records. By applying conditional expressions and comparisons, queries can also be customized to return context-sensitive searches. These advantages are highly beneficial for conducting searches in large relational databases. XQuery syntax takes the form of XML node (element, attributes, and variables) names, which integrates nicely with the growing popularity of XML, making XQuery a useful tool to use. It reads in XML fragments and returns a sequence in the same format, highly suitable as a data-oriented querying tool. It also generalizes existing SQL syntax with FLWOR (for-let-when-order-return) expressions, which can then be incorporated with HTML to generate customizable outputs in web browsers.
xQuery is a lot simpler language to learn than SQL. Conceptually the two technologies do the same thing: help you retrieve data. However xQuery seems like a video game where you dig for treasure with a map, navigating the various nodes to harvest what you need and then leave. xQuery is an easier concept to absorb for people getting introduced to both SQL and xQuery. However, SQL is more developed and it is easier to combine data from different tables using joins. xQuery is still a relatively young technology and probably will develop abilities to relate data better as time goes on. The same issues in SQL of having to understand the relationships between the data still exist in xQuery, and like in the construction of SQL great care should be taken in the design of XML documents and their DTDs.
Turn in a list of locations each member in the group will be using for the Project 3 Web site. Each location should be justified by a short text explanation as to why that location was chosen. This list will help me write a script to get such data into the SQL database we'll use in Project 3.
Your Answer:
Location | Latitude | Longitude | Explanation |
---|---|---|---|
Mt. Rainier | 46.85 N | 121.75 W | water bottling site |
Possession Point Ferry | 47.53.82' N | 122.23.59' W | good dive site |
Edmonds Underwater Park | 47 48' 49.42'' N | 122 23' 01.46" W | good dive site |
Alki Seacrest Cove 2 | 47 35' 20.92" N | 122 22' 46.32" W | good dive site |
Golden Gardens/ Shilshole | 47 41' 25.98" N | 122 24' 22.6" W | good dive site |
Ft. Lewis Golf Course | 47.079 N | 122.726W | balloon landing location |
Snohomish Airport | 47.905223 N | 122.105725W | balloon landing location |
Warren G. Magnuson Park | 47.6843 N | 122.299W | solar racing spot |
Yukon Harbor | 47.53134283040665 N | 122.5308609008789 W | good dive site |
Quarter-Master Harbor | 47.381149222795024 N | 122.46803283691406 W | good dive site |
Shilshole Bay | 47.67024262174783 N | 122.42408752441406 W | good dive site |
Sunset Beach | 47.346269 N | 122.556993 W | good dive site |
Fox Island East wall | 47.2315432 N | 122.58819962 W | good dive site |
Harpers Ferry | 47.5221536 N | 122.518802 W | good dive site |
Alki Beach | 47.35 N | -122.214 W | frequented by divers |
San Juan Island N. | 48.652N | -123.045W | large mammals frequent |
San Juan Island S. | 48.494N | -122.958W | large mammals frequent |
Snohomish River | 47.978N | -122.185W | river boat restoration |
Everett | 47.979N | -122.201W | city guide |
Seattle | 47.606N | -122.331W | city guide |
Tacoma | 47.253N | -122.443W | city guide |
Alki Beach Park | 47.625N | -122.263W | good kite flying park |
Marymoor Park | 47.662N | -122.127W | good kite flying park |
Gas Works Park | 47.647N | -122.336W | good kite flying park |
Magnuson Park | 47.682N | -122.263W | good kite flying park |
Blaine Elementary | 47 38'11.28" N | 122 24'32.23" W | school used in site concept |
UW Marine Science Bldg | 47 38'58.10" N | 122 18'45.62" W | good field trip location |
Alki Beach | 47.58454202652335 N | -122.4087334045425 W | good surf location |
Westport | 46.88690348355735 N | -124.1138897635217 W | good surf location |
Hole-In-The-Wall | 48.38165632230724 N | -124.7230996518806 W | good surf location |
Surf Site | 47.70868725472133 N | -122.3971208773579 W | good surf location |
Steven's Pass | 47 50'46.09"N | -121 40'09.03''W | ski location |
Crystal Mountain | 47 12'28.58"N | -121 59'16.58''W | ski location |
Mt. Baker | 48 45'23.93"N | -122 27'42.90''W | ski location |
Mohamed's House | 47.66412 N | -122.29348 W | snow interest |
Snohomish River | 47 54'33.48N | 122 05'37.5W | river flow |
Snohomish Basin | 47 54'34.92N | 122 05'33.9W | soil state near river |
Alki Beach | 47 35'22.13N | 122 23'37.46W | good dive site |
Hood Canal | 47 49'09.70N | 122 51'19.99W | good dive site |
Edmonds Underwater Park | 47 49'00.32N | 122 22'50.64W | good dive site |
Mukilteo | 47 52'49.63N | 122 20'05.24W | good dive site |
The Wynoochee River | 47 37'48.70" N | -123 61'40.44" W | popular fly fishing |
Snohomish river near Monroe | 47 49'52" N | 122 02'50" W | pollution dumping history |
Paradise, Mt Ranier | 46 45' 31.27" | N 122 02'03.74" | mountain weather interest |
Skagit River | 48 33' 26.51" N | 121 24'45.44" W | popular for recreational activities |
Lake Ballinger park | 47.778N | -122.327W | golf course location |
Mid-ocean Location | 48 23'31" N | 123 60'50" W | ideal for monitoring |
Montlake Cut | 47.65 | -122.316 | closest water to UW core |
Skykomish River | 47.814 | -121.578 | interesting flow level |
Puget Sound | 47.66 | -122.40 | popular boating location |
Bellevue | 47.609 | -122.146 | location for sewage outlet |
UW Campus | 47.657 | -122.312 | weather for students |
I-5 Seattle | 47.679295 | -122.3249420 | localized weather report |
Green Lake | 47.68 | -122.326 | park setting |
Turn in one or more XSLT documents that I can use to convert an XQuery response set into an HTML page and view it in a Web browser.
Your Answer:
xml | xlst | html |
data.xml | data.xsl | data.html |
data.xml | soil.xsl | soil.html |
data.xml | weather.xsl | weather.html |
Consider writing a paragraph that explains how you could generate HTML output directly by using XQuery.
Your Answer:
XQuery returns valid XML and using the FLWOR methods we can choose to return the XML however we want. For example we can use our FLWOR methods to iterate over a result XQuery set and using the "return" method return the XML item wrapped in whatever HTML tags. Example: <html> <body> <ul> { for $x in doc("books.xml")/bookstore/book/title order by $x return <li>{$x}</li> } </ul> </body> </html> *Taken from the W3Schools website: http://www.w3schools.com/xquery/xquery_flwor_html.asp
Explore visualization techniques among your group that you would use to visualize data on your project 3 Web site.
Your Answer:
Map visualization
A simple way to create a visualization is to draw symbols for data categories on a geographical map of the area the data pertains to. An interactive map would allow a person to pick the variables they wanted to see on the right side and the following image would appear. The most that can be shown clearly is three variables at one time, more than that and the map gets messy. Data for this figure is totally fictional.
Bar Chart
Here is a stacked bar graph showing the relative contributions of 6 different locations to the total precipitation for a month. We used Matlab to generate the image. The location names would be labeled in the real thing. Data for this image was actually yearly data for 6 different years obtained at http://www.wrcc.dri.edu/cgi-bin/cliMONtpre.pl?waseat.
Line Chart
This figure plots lines from three variables on the same axis. It is set up as a prediction for the next 12 hours. We used Matlab to generate the image.
Profile plot
We found two simple ways to create graphics of profiles as long as you can get the data into an array/spreadsheet format. For the first method, we used Microsoft Excel and used the "Chart" function to make a data plot.
Cross section graphs
Using MatLab, we also found that you can use a variable vs. depth and visualize the ocean with using a color bar and have the colors represent different aspects of the using the "pcolor" function on MatLab. For example, we have various properties vs. depth shown here: