The document describes an intelligent weather service that provides weather reports in a natural language format with emoticons. The service allows users to view weather reports on mobile devices or laptops based on their location. The reported weather is described intelligently - if the temperature is between 10 and 30 degrees Celsius, a happy smiley emoticon is displayed along with text like "today's weather is quite cool and sunny". The document also outlines the use cases and UML diagrams for the weather service.
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Intelligent Weather Service
1. Work StudyPractical Software
Engineering
Weather Service
This documents provides the idea about the intelligent
weather service. Where use can see weather report in
his/her mobile or on laptop. Weather report describe the
current condition intelligent way like If weather in
between 10 degree celcius to 30 degree celcius than its
shows message like todays weather is quite cool and
sunny and also display happy smiley :) But if weather
otherway around 30 to 45 degree celcius than will show
sad :( smiley. This document also describe the use cases
Uday Sharma of the weather service and UML diagrams.
Master Software Engineering
HochshuleHof
mr.mickeysharma@gmail.com
1/26/2012
3. Work StudyPractical Software Engineering 2012
1. Customer requirements
The customer requirement is to develop a weather service which can fetch the real time
weather information from the “www.weather.com”. Besides, this application will give natural
language string with intelligence e.g. “Today’s weather is …….”
- Login Screen
- User input screen
- Output screen
2. Specifications
2.1 Target Determination
Using this "Weather Service" system customer will get real time weather information
in the form of Natural language with a special kind of intelligence (Emoticons). This
service is the independent service so PC user as well as Mobile user also can get the
benefit of this service. First step: User has to be a member of this service. Second
Step: User has to be do log in and Third step: Service needs input from the customer
like “City Name” or “Geocode of the City” on the basis of the input Service will extract
REST data from the www.weather.com in the form of XML. This service read this XML
and will generate RDF triple and store it into the RDF store, using SPARQL this service
fetch data from the RDF store and Generate Natural Language String with Inference.
Generated sting contain phrase and emoticons according to the user preference.
2.2 Product Use
This application has developed to add intelligence in weather report.
- Eligible customer can access weather service (commercial way).
Weather Service Uday Sharma @2012 Page - 2 -
4. Work StudyPractical Software Engineering 2012
- Weather service generates intelligent output according to user input.
This service user can access via URL. And user has to give them authentication
detail. Authorized user has to provide input (City name) to weather service.
2.3 Product Feature
The functions are classified according to their relevance in two groups. Here are the
features "1 Importance "of the primary functions to be implemented, functions of
the" second Importance "to be realized, however, are secondary set of functions and
therefore in lower processing priority.
1. Importance:
/ LF10/Authentication
/ LF11/Input for Weather service
/ LF12/Fetch REST data
/ LF13/Generate RDF triple
/ LF14/Store triple in RDF store
/ LF15/Fetch data using SPARQL
/ LF16/Generate Natural string
/ LF17/Adding intelligence in Natural String
/ LF18/Display weather condition with Image and string.
2. Importance:
/ LF80/ to developed intelligent system
/ Manage LF81/Generate weather according to user like
2.4 Product data
/ LD10 / user data
/ LD20 / Weather Service data
Weather Service Uday Sharma @2012 Page - 3 -
5. Work StudyPractical Software Engineering 2012
/ LD21 / REST to RDF triple store
/ LD22 / CityName
2.5 Product Performance
Service is returning the weather report according to the user input in quick
time.
This service can be accessed from any application for instance, from desktop
based application, from web application or from mobile application.
For mobile application as per the user request it can return an avatar (a
character which can speak the weather information).
On top of that, the avatar can change expressions and gestures depending on
the weather (Good or Bad Weather)
The speed of the words per minutes the avatar speaks can be controlled from
the user input.
2.6 Desired quality
Functionality: very well
Reliability: very well
Usability: normal
Efficiency: normal
Changeability: normal
Portability: irrelevant
Weather Service Uday Sharma @2012 Page - 4 -
6. Work StudyPractical Software Engineering 2012
3. Estimation of project effort
3.1 Time Estimation
For Time estimation we have used Pivotaltracker which allows me to make time estimate for
project more agile way. Pivotal tracker will accessible by both client and Project manager or
Project manager and Developer. Advantage of this tool is End user can see the current status
of the development.
Weather Service Uday Sharma @2012 Page - 5 -
7. Work StudyPractical Software Engineering 2012
3.1 Progress report
Above diagram is suggesting total duration of the project as well as total module in the
project.
4. Booch object Diagram
Above diagram is showing the Authentication procedure.
Weather Service Uday Sharma @2012 Page - 6 -
8. Work StudyPractical Software Engineering 2012
5. Use-Cases
The following diagrams illustrate the description of typical activities in the system.
They contain the actors involved, and the basic applications of the project and thus
provide an outside view of the system again.
5.1 Use-case diagrams
Weather Service :
Weather Service Uday Sharma @2012 Page - 7 -
9. Work StudyPractical Software Engineering 2012
Above diagram showing case model of the Weather service. Actor of this application open
URL and get login into the system once the user gets logged in User provide a City name and
will submit to the Weather service. Weather service senses the user input and will search for
weather in www.weather.com and will capture REST data and will convert it into the RDF
triple store and will fetch data from the RDF triple store using SPARQL and generate Natural
language string with intelligent smiles.
5.2 Login and User Input Case diagram:
Actor provide them username and password, service authenticate them and as for City name
as a input.
5.3 Generating Natural language:
Weather Service Uday Sharma @2012 Page - 8 -
10. Work StudyPractical Software Engineering 2012
Base on Actor Input weather Service fetch XML data from the www.weather.com and parse
XML format and store it into the RDF triple store. To generate natural language weather
service fetches the data from the database using SPARQL and generating string like e.g.
“Today’s weather 20 degree Celsius High and 5 degree Celsius low”.
5.4 Description of use cases
The following use case description provides more in-depth explanation of the above
applications in Weather Service. This is placed on the relationships among the use
cases, on condition, and triggers, as well as post-condition and results of the use cases
focus.
Login into the Weather System:
Use Case User # 1 Authentication
Actors User
Purpose To check weather of the city
Entry Cond User is logged in and User need to provide City name or GEO code to the
weather system.
Overview The users type the URL http://www.xyz.com and provide login detail
Weather system authenticate to user and will ask for GEO code of the
city.
Includes Authentication screen
User input screen (City name or GEO code
Special Req Tomcat, Mysql
Category Very high priority
Cross Ref on / LF11 / from the contract documents
Actor Action System Response
1. Provide user name and password 2. Authentication process check for
authorize User if correct than go to the
next screen otherwise User has to be
provide correct username and password
3. If authorize user than go to next screen
4. Provide input as GEO code of the city 5. Check weather GEO code of the city
correct or not
Weather report:
Use Case Check # 2 today’s weather
Weather Service Uday Sharma @2012 Page - 9 -
11. Work StudyPractical Software Engineering 2012
Actors User
Purpose Check today’s weather and generate string
Entry Cond City name of GEO code of the city
Overview The user provide GEO code of the City name to the Weather System and
weather service fetch XML from the www.weather.com on the bases of
GEO code of the city. Once system gets REST data from the weather.com
Weather service parse the XML and store it in to the Mysql database in
the format of RDF triple store. Using SPARQL query weather system fetch
the information and Generate the weather report string with intelligence
included in string.
Exit Cond Weather report display and user will close the browser
Extends Make Astrology, Sport News etc. application on bases of these
application
Special Req Jena API
Cross Ref on / LF12/ - /LF 18 / from the product feature
Actor Action System Response
1. User provides GEO code of the city to 2. Weather system senses the GEO code and
the System. start looking for XML from the
www.weather.com
3. Parse XML tags and store it into the RDF
triple store using Jena API
4. Fetch data from the RDF store using
SPARQL and make string
5. Add intelligence into the string depend on
the weather Jena reasoner add smiles
into the String e.g “ “
6. Generate final string and display in the
webpage and also show the weather
image according to weather condition.
Weather Service Uday Sharma @2012 Page - 10 -
12. Work StudyPractical Software Engineering 2012
6. Class Diagram
A class diagram in the Unified Modeling Language (UML) is a type of static structure diagram
that describes the structure of a system by showing the system's classes, their attributes,
operations (or methods), and the relationships among the classes.
In our class case we used a number of classes to develop the whole system. The most
important class is named Weather_20_XMLParser.Other classes are working around this
class. As the picture shows this particular class is interacting with the class called
WeatherGateway which has some methods those communicates with the external website to
fetch the weather information. Other classes like WeatherError provides error message back
to the user when an error occurs. Another important is TestWeatherGateway which saves the
final processed weather information in the RDF store.
Weather Service Uday Sharma @2012 Page - 11 -
13. Work StudyPractical Software Engineering 2012
7. Sequence diagrams
A sequence diagram in a Unified Modeling Language (UML) is a kind of interaction diagram
that shows how processes operate with one another and in what order. It is a construct of a
Message Sequence Chart. A sequence diagram shows object interactions arranged in time
sequence. It depicts the objects and classes involved in the scenario and the sequence of
messages exchanged between the objects needed to carry out the functionality of the
scenario. Sequence diagrams typically are associated with use case realizations in the Logical
View of the system under development.
In this diagram, first process is 1: userid and pass in the login screen after that the next one is
1.1: move to homepage. Second step is to provide parameters to get weather information
which is 2: provide valid parameters. After completion of this the next step is to pass the
weather text at 2.1 to the external server to generate video. At 2.2 data returned back to the
user. And the last step is to returning the video to the user.
Weather Service Uday Sharma @2012 Page - 12 -
14. Work StudyPractical Software Engineering 2012
8. Activity diagrams
Activity diagrams are graphical representations of workflows of stepwise activities and
actions with support for choice, iteration and concurrency.
Here in our case in the starting point the consumer of the service has to be a register service
to get the accessibility of this service. At first user has to provide the credentials for the login
screen to verify that the user is an authenticated used. If the credentials are wrongs which
has been provided then the user has to provide the credentials again to get the access.
In the next step user will go the home page of the service and then has to provide the
credentials to get the weather information. If user provides invalid parameters then system
will show an error message.
But when the user passes valid information then three tasks happens. In first place fetching
all the information according to the parameters is occurs. After that using the information a
third party server generates a video on weather information. In addition, when the final
weather information gets processed then a reasoned is used called Jena Reasoner which adds
to smiles into the text depending on whether the weather is good or bad. At last this wholes
process ends and come back to home screen for next query.
Weather Service Uday Sharma @2012 Page - 13 -
15. Work StudyPractical Software Engineering 2012
9. Component Diagram
In the Unified Modeling Language, a component diagram depicts how components are wired
together to form larger components and or software systems. They are used to illustrate the
structure of arbitrarily complex systems.
In this diagram different component of the application has been depicted. There are three
important competent those are working with the main class Weather_20_Parser class.
WeatherGateway, Jena Reasoner and Vedio Server (To generate weather report in video
format).These three components along with the Weather_20_Parser class works together to
accomplish this whole task.
10. Distribution diagram
A deployment diagram in the Unified Modeling Language models the physical deployment of
artifacts on nodes.[1] To describe a web site, for example, a deployment diagram would show
what hardware components ("nodes") exist (e.g., a web server, an application server, and a
database server), what software components ("artifacts") run on each node (e.g., web
application, database), and how the different pieces are connected (e.g. JDBC, REST, RMI).
Weather Service Uday Sharma @2012 Page - 14 -
16. Work StudyPractical Software Engineering 2012
11. Package diagram
In this diagram all components and servers and database storage system has been displayed.
This service needed all those components and servers and others to run the whole system. In
the left side of the diagram all the other platform has been displayed from where this service
can be called and used to show the weather information the intended user.
This diagram shows the dependency of the different packages used in this system. Package
src.weather_service.weatherprovider imports two other packages and those are listeners
and src.weather_service.weatherprovider.locationdatamodel. Package src.weather_service
accesses src.weather_service.weatherprovider to get data and store in to the data storage.
src.weather_service.weatherprovider also accesses src.res.weatherxml to read the xml files
to get an access of the jena resoner file
Weather Service Uday Sharma @2012 Page - 15 -
17. Work StudyPractical Software Engineering 2012
12. Object Diagram
An object diagram in the Unified Modeling Language (UML) is a diagram that shows a
complete or partial view of the structure of a modeled system at a specific time. In this
diagram all interactions between objects are depicted. First of all an object of the main class
Weather_20_XMLParser is depicted as http://xoap.weather.com/weather/ :
Weather_20_XMLParser.Which has a relation with the next class. Here the former one is
setting the gateway for the later one. And later one is depicted as www.weather.com:
WeatherGateway. The next is a relationship with the WeatherError class which has depicted
as INVALID_LOCATION_PROVIDED_ERROR : WeatherError in the diagram. An instance of
the class TestWeatherGateway shown in the picture as partnerID = "1272202183", licenseKey
= "234b5ade63edb834”: TestWeatherGateway.
Weather Service Uday Sharma @2012 Page - 16 -
18. Work StudyPractical Software Engineering 2012
13. CRCCard diagram
Class-Responsibility Collaborator (CRC) card visualize classes in card-like presentation. Each
CRC card contains information like the description of class, its attributes and responsibility. A
CRC card diagram is a holder of these cards.
Below diagram showing the Super classe TestweatherGateway and Weathererror this two
are inherited by all the sub classes and using attribute Weather service generate weather
report.
Weather Service Uday Sharma @2012 Page - 17 -
21. Work StudyPractical Software Engineering 2012
16. Test Case
16.1 Junit Test code
@Test
public void testTestLocalService() {
System.out.println("testLocalService");
String locationID = "GMXX0087.xml";
String weatherServer = "http://localhost:8888/";
TestWeatherGateway instance = new TestWeatherGateway();
instance.testLocalService(locationID, weatherServer);
// TODO review the generated test code and remove the default call to fail.
}
16.2 Junit Test output
Weather Service Uday Sharma @2012 Page - 20 -
22. Work StudyPractical Software Engineering 2012
17. References
Fetching weather information from the weather.com
http://www.weather.com/
For proof of concept used pivotal tracker
http://www.pivotaltracker.com/
For UML diagram used Star UML and VISIO
http://office.microsoft.com/en-
us/support/results.aspx?ctags=CH010064890
http://staruml.sourceforge.net/en/
Weather Service Uday Sharma @2012 Page - 21 -