mannheim web 2.0 systems development. plan being an early-adopter web 2.0 technologies mashups...

24
Mannheim Web 2.0 Systems Development

Post on 21-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Mannheim

Web 2.0 Systems Development

Plan

• Being an early-adopter

• Web 2.0 technologies

• Mashups

• Google Earth and kml

• XQuery and eXist

Being an Early Adopter

• Learning new technologies when:– No official textbooks – No definitive documentation– You need to get ahead of the game

• Use– Examples– Discussion groups– Application Programmer interfaces– Reading page sources– Digging and delving– Experimenting with small examples, smaller changes to larger

examples– Keep a lab book (or a blog) of results and lessons learnt

Web 2.0

• Key ideas– Sharing information (blogs, wikis, RSS,

ICQ/IM, social book-marking)– Information reuse (mashups, tagging

• A couple of Key Technologies– Hosted applications (Basecamp, Campfire,

Stikipad)– Mapping– XML

Individual TaskStart a blog

• http://www.blogger.com/start

• The blog will be submitted for evaluation

• Exercise results should be entered into the blog, with discussion

• Later you can edit the spreadsheet of all blogs with your name and blog address

Wiki

• http://cems.stikipad.com/web2• This wiki has been developed to provide

an overview of Web 2.0 stuff for this class and another running next year.

• Task (during the day)– Add a new page to the wiki and link it in to the

appropriate place. Document this and reference the new page in your blog

Mashups

• Combining information from multiple sources – Application gets data from a source

• Page-scraping (parsing HTML)• Application Programmer Interface (API)

– SOAP / REST /JavaScript functions

• RSS (Real Simple Syndication)

• E.g.– housing

TASK (in Pairs)

• Browse through ProgrammeableWeb and select a mash-up of interest.– http://www.programmableweb.com/

• Questions to answer and document in your blog:– What sources of information are being used?– How is the data obtained technically?– How are the sources combined– How useful is this mashup?– What questions does it raise?

Google Earth

• Google Earth is a client-side application (needs a download) so not used in this list of Mashups

• Location-based browsing will be a big thing

Google Earth Demo

• StudentsOnline

• Google Earth operations– Creating Folders– Creating Placemarks– Editing Location and Description– Editing Icons– Saving as kml

• Partner Organisations map

Google Earth Task (pairs)

• Decide on a trip (last holiday), place (home town), news event for the pair to document using GE, or the CEMS partner map

• Create an overlay

• 20 minutes only – can finish in your own time!

• Save as kml

Understanding kml

• Experimental:– Use a text editor (Notepad, PFE32) to load the text

file, change a description, save and reload (after deleting the original)

– Use Word 2003 to load the file – what doesit tell you about the file?

• Online documentation– the Google Earth specification

• Draw a tree diagram to explain the general structure

Understanding Latitude and Longitude

Lines of equal latitude

Lines of equal longitude

(0, 0) of the West coast of Africa

0 longitude is the Greenwich Meridian

0 latitude is the Equator+,++, -

Bristol

51 ° 27 ‘19.08 “ N2 ° 35’ 30.76” W

1 minute of latitude = 1 Nautical Mile = 1.150779 miles

60 seconds in 1 minute60 minutes in 1 degree360 degrees in a full circle

1 minute of longitude goes to zero at the poles

50

0-1-2

GE Reference system is WGS84

Geocoding

• To determine the latitude and longitude of an address or postcode

• US zipcodes geocoded

• UK Postcodes – commercially available in bulk– Individual geocoding in Google Earth, Google

Map

• ? Other countries.

Advanced Google Earth

• Icons– Style can be designed

• For each Placemark• For a set of placemarks by creating a style with an

id• Small icons can be selected from the big pallette

png’s – each is 32* 32 pixels, arranged in 8 rows of 8, numbered 0- 7 from the bottom-left.

• Specific icons can be selected with the appropriate x, y, h, w parameters

XML

• Well-formed– Tags nested, attributes quoted, single root

• ‘Self-describing’– So you can guess at the meaning of each item of data

• Terms– Root– Element– Attribute– Child and Parent– Typed values and CDATA

• Draw a diagram (however you like) to show the general structure of a kml file

• Review the structures

Using an XML database

• kml is just text, so any scripting programme can generate it (PHP, ASP JSP etc)

• kml is XML so any XML tools can process it

• an XML database– Stores XML documents (and other things)– Provides an XQuery interpreter to query the

documents and to generate new documents.

Exist database

• Exist: http://exist-db.org/• Working System: Students Online • My links: http://www.cems.uwe.ac.uk/~cjwallac/NXD/index.htm• Student server

http://studentexistdb.cems.uwe.ac.uk:8080/exist/index.xml• Sandbox interface for executing simple queries• Admin interface for browsing collections• JavaStart interface for adding resources, XML files and XQuery files

to the database

XPath

• A language for selecting nodes in a tree structure - Trees

XQuery

• Michael Kays’s 10 minute tutorial

• Exist is similar – can’t set the context node in the Sandbox, but only one file like this so queries should still work (ignore any leading .)

• Go on the FLOWR tutorial

XQueries in EXist

• You can store XQueries in Exist– Save to a text file– Using the webstart client, ad them to your

user area– Execute them by using the admin interface to

locate the script and running it.

Added functions

• XQuery Functions– See w3schools

• http://www.w3schools.com/xpath/xpath_functions.asp

– String functions…

• Exist functions– See eXist functions

• http://demo.exist-db.org/xquery/functions.xq

– Input HTTP request parameters…

Example

• Trip spreadsheet

• Trip2kml.xql

Final task

• Your task in pairs is to choose a news story for Google news

• Find using Google or a geocoder the location of places relevant to the story

• The class will agree a common format for geocoded news stories

• Adapt the XML spreadsheet to hold the data you need about the story

• Adapt the trip2kml XQuery to convert your story into a kml file

• Collect all the stories into one collection• Create a query to find all the news stories about places

within N miles of a given location