knowledge - retaw research centerretawprojects.com/uploads/datamining.docx · web viewfilling these...
TRANSCRIPT
AN ENHANCED RECOMMENDER SYSTEM FOR
QUERIED DATA USING LOCATION BASED KNN AND
COLLABRATIVE FILTERING METHOD
ABSTRACT Comparing one thing with based on recommended ratings is a typical part of
human decision making process. However, it is not always easy to know what to
recommend, how to recommend and what are the nearby alternatives. To address
this difficulty, represent a novel way to automatically mine the comparable entities
from filtering the recommendations that users posted online. To ensure the high
quality of filtering and most preferable recommendations are achieved by
developing the K-nearest neighbour method and collaborative filtering. These
Algorithms extract the recommendations and quality items with its details. The
experimental results show by the method achieves preference for the item which is
searched and gives the location based extraction for the preferable entity. The
proposed approach can evaluate and simulate the experiment with a java based
recommendation queries and e-rate scenario. The approach for filtering process in
extracting database from different database servers can be easily integrated and
deliver highly preferred items for relevant searching which is improved by the
Top-k method of item classifications.
1
1.1 INTRODUCTION
Recommender system is a software application agent that gets the choices,
interest and preferences of individual persons/ users and makes recommendation
accordingly. During online search proposed system provide easier method for users
to make decisions based on their recommendations. Majority of existing
approaches of recommender system focus on factors like individual persons choice
of item, group community opinions and do not consider importance like contextual
information like location of user from big data. This is achieved using the
technique named as collaborative filtering (CF) [3] which is based on past group
community opinions for user and item and correlates them to provide results to the
user questions and queries. Most of the community opinions were a group of tuple
i.e. (user, ratings, and item) of user and numeric rating for item. Content-based
recommendation recommends items to users that are similar to those they preferred
previously. The analysis of similarity is based on the items attributes. Collaborative
recommendation recommends items to users according to the item ratings of other
people who have characteristics similar to their own. The analysis of similarity is
based on the user’s tastes and preferences. Hybrid recommendation is a
combination of content-based and collaborative recommendations. ERQD* is an
enhanced recommender system for queried data which gives ratings based on the
location. It categories by required item and mapping the location for that item, this
can be evaluate by the three ways i.e. (a) spatial ratings for non spatial items, (b)
non-spatial ratings for spatial items and (c) spatial ratings for spatial items which
are depicted by the corresponding user location and items location or may be both
on the same mapping done by the tuple.
2
Filling these simple search boxes with different relevant terms may return
the same set of documents from the database. Posing all of them would not be a
good retrieval strategy as it yields the same set over and over again. Intuitively,
posing some optimal set of terms that can retrieve a diversified document set
covering the entire hidden database is more desirable than posing the entire set of
terms that retrieves and presents the same set of documents repeatedly. Thus, it
becomes necessary not only to rank the terms but also select an optimal set from
the ranked terms. Our work focuses on how to formulate appropriate query terms
for text box based simple search form interfaces that can yield maximum number
of documents from the database by posing a minimum number of such terms
sequentially on the interface. This paper illustrates the recommendation system
with better quality, accuracy as compared to existing recommendations system.
3
1.1.1 Data Mining
Data
Data are any facts, numbers, or text that can be processed by a computer.
Today, organizations are accumulating vast and growing amounts of data in
different formats and different databases. This includes:
operational or transactional data such as, sales, cost, inventory, payroll, and
accounting
nonoperational data, such as industry sales, forecast data, and macro
economic data
meta data - data about the data itself, such as logical database design or data
dictionary definitions
Information
The patterns, associations, or relationships among all this data can provide
information. For example, analysis of retail point of sale transaction data can yield
information on which products are selling and when.
Knowledge
Information can be converted into knowledge about historical patterns and
future trends. For example, summary information on retail supermarket sales can
be analyzed in light of promotional efforts to provide knowledge of consumer
buying behavior. Thus, a manufacturer or retailer could determine which items are
most susceptible to promotional efforts.
4
Data Warehouses
Dramatic advances in data capture, processing power, data transmission, and
storage capabilities are enabling organizations to integrate their various databases
into data warehouses. Data warehousing is defined as a process of centralized data
management and retrieval. Data warehousing, like data mining, is a relatively new
term although the concept itself has been around for years. Data warehousing
represents an ideal vision of maintaining a central repository of all organizational
data. Centralization of data is needed to maximize user access and analysis.
Dramatic technological advances are making this vision a reality for many
companies. And, equally dramatic advances in data analysis software are allowing
users to access this data freely. The data analysis software is what supports data
mining.
Data mining
Data mining (the analysis step of the "Knowledge Discovery in Databases"
process, or KDD, an interdisciplinary subfield of computer science, is the
computational process of discovering patterns in large data sets involving methods
at the intersection of artificial intelligence, machine learning, statistics, and
database systems. The overall goal of the data mining process is to extract
information from a data set and transform it into an understandable structure for
further use. Aside from the raw analysis step, it involves database and data
management aspects, data pre-processing, model and inference considerations,
interestingness metrics, complexity considerations, post-processing of discovered
structures, visualization, and online updating.
The actual data mining task is the automatic or semi-automatic analysis of large
quantities of data to extract previously unknown interesting patterns such as groups
5
of data records (cluster analysis), unusual records (anomaly detection) and
dependencies (association rule mining). This usually involves using database
techniques such as spatial indices. These patterns can then be seen as a kind of
summary of the input data, and may be used in further analysis or, for example, in
machine learning and predictive analytics. For example, the data mining step might
identify multiple groups in the data, which can then be used to obtain more
accurate prediction results by a decision support system. Neither the data collection
and data preparation, nor result interpretation and reporting are part of the data
mining step, but do belong to the overall KDD process as additional steps.
Figure No. 1.1 Knowledge Discovery in Database
6
1.1.2 Techniques used under data mining
1.1.2.1 Collaborative Filtering(CF)
Collaborative filtering (CF) is a technique used by some recommender
systems. Collaborative filtering has two senses, a narrow one and a more general
one. In general, collaborative filtering is the process of filtering for information or
patterns using techniques involving collaboration among multiple agents,
viewpoints, data sources, etc. Applications of collaborative filtering typically
involve very large data sets. Collaborative filtering methods have been applied to
many different kinds of data including: sensing and monitoring data, such as in
mineral exploration, environmental sensing over large areas or multiple sensors;
financial data, such as financial service institutions that integrate many financial
sources; or in electronic commerce and web applications where the focus is on user
data, etc.
In the newer, narrower sense, collaborative filtering is a method of making
automatic predictions (filtering) about the interests of a user by collecting
preferences or taste information from many users (collaborating). The underlying
assumption of the collaborative filtering approach is that if a person A has the
same opinion as a person B on an issue, A is more likely to have B's opinion on a
different issue x than to have the opinion on x of a person chosen randomly. For
example, a collaborative filtering recommendation system for television tastes
could make predictions about which television show a user should like given a
partial list of that user's tastes (likes or dislikes). Note that these predictions are
specific to the user, but use information gleaned from many users. This differs
from the simpler approach of giving an average (non-specific) score for each item
of interest, for example based on its number of votes.
7
Collaborative filtering systems have many forms, but many common systems can
be reduced to two steps:
1. Look for users who share the same rating patterns with the active user (the
user whom the prediction is for).
2. Use the ratings from those like-minded users found in step 1 to calculate a
prediction for the active user
Figure No. 1.2 Collaborative filtering recommendation
8
1.1.2.2 K – Nearest Neighborhood (k-NN)
In pattern recognition, the k-Nearest Neighbors algorithm (or k-NN for
short) is a non-parametric method used for classification and regression. In both
cases, the input consists of the k closest training examples in the feature space. The
output depends on whether k-NN is used for classification or regression:
In k-NN classification, the output is a class membership. An object is
classified by a majority vote of its neighbors, with the object being
assigned to the class most common among its k nearest neighbors (k is
a positive integer, typically small). If k = 1, then the object is simply
assigned to the class of that single nearest neighbor.
In k-NN regression, the output is the property value for the object.
This value is the average of the values of its k nearest neighbors.
k-NN is a type of instance-based learning, or lazy learning, where the function is
only approximated locally and all computation is deferred until classification. The
k-NN algorithm is among the simplest of all machine learning algorithms.
Both for classification and regression, it can be useful to weight the contributions
of the neighbors, so that the nearer neighbors contribute more to the average than
the more distant ones. For example, a common weighting scheme consists in
giving each neighbor a weight of 1/d, where d is the distance to the neighbor.
9
The neighbors are taken from a set of objects for which the class (for k-NN
classification) or the object property value (for k-NN regression) is known. This
can be thought of as the training set for the algorithm, though no explicit training
step is required.
A shortcoming of the k-NN algorithm is that it is sensitive to the local structure of
the data. The algorithm has nothing to do with and is not to be confused with k-
means, another popular machine learning technique.
Figure No. 1.3 k – NN based Location finding
A case is classified by a majority vote of its neighbors, with the case being assigned
to the class most common amongst its K nearest neighbors measured by a distance
function. If K = 1, then the case is simply assigned to the class of its nearest
neighbor.
Some distance finding functions like, Euclidean √∑i=1
k
¿¿i-yi)2 , Manhattan ∑i=1
k
¿x i-yi | .
10
It should also be noted that all two distance measures are only valid for continuous
variables. In the instance of categorical variables the Hamming distance must be
used. It also brings up the issue of standardization of the numerical variables
between 0 and 1 when there is a mixture of numerical and categorical variables in
the dataset.
1.1.3 Overview
In terms of discovering related items with preferred attributes to enhance the
property, the system is similar to the research on comparison systems, which
compare the items to user. Recommender systems mainly rely on similarities
between items and/or their statistical correlations in user log data. For example,
Amazon recommends products to its customers based on their own purchase
histories; similar customers purchase histories, and similarity between products.
However, recommending an item is not equivalent to finding a comparable item. In
the case of Amazon, the purpose of recommendation is to entice their customers to
add more items to their shopping karts by suggesting similar or related items. If in
this suggestion given by comparison, the system would like to help users with
comparable items, but using the preference on the suggestion the customer get
quality of items and also get the place value for the items. For example, it is
reasonable to recommend “iPhone”or “Micromax” if a user is interested in the
“iPhone” user clearly get the preference rating of that product and also get the
recommends from the location based other users.
1.1.4 Objective
The system is going to conduct a simulation experiment and evaluate the
proposed approach with a java based recommendation queries and e-rate scenario.
The approach for filtering process in extraction database from different database
11
servers can be easily integrated and deliver highly preferred items for relevant
searching which is to be mature by the Top-k method of item classifications.
However, the rating with its research mechanism includes 1) improving the
proposed evolution approach by making the collaborative filtering and 2) applying
the proposed approach to support the location based recommendations.
1.2 Literature Review
1.2.1 Amazon.com recommendations: Item-to-item collaborative filtering
Authors: G. Linden, B. Smith, and J. York
Amazon makes heavy use of an item-to-item collaborative filtering
approach. This essentially means that for each item X, Amazon builds a
neighborhood of related items S(X); whenever one who buy/look at an item,
Amazon then recommends one’s items from that item's neighborhood. That's why
when one sign in to Amazon and look at the front page, the recommendations are
mostly of the form “User viewed... Customers who viewed this also viewed...”
This item-to-item approach can be contrasted to, two different approach where
using to implement the filtering i.e. user-to-user collaborative filtering approach
and global factorization approach.
Advantage
Amazon and most applications have many more users than items, so it's
computationally simpler to find similar items than it is to find similar users. Faster
to update recommendations: as soon as you buy a new book, Amazon can make a
new recommendation in the item-to-item approach, whereas a factorization
approach would have to wait until the factorization has been recomputed.
Disadvantage
12
User/Customer don't get very much diversity or surprise in item-to-item
recommendations, which means it gives only a similar items it cannot giving
similar items with different users, so recommendations tend to be kind of obvious
and boring.
1.2.2 Toward the next generation of recommender systems: A survey of the
state-of-the-art and possible extensions
Authors: G. Adomavicius and A. Tuzhilin
If the system can only recommend items that get the results highly against a
user’s profile, the user is limited to being recommended items similar to those
already rated. The system provides the opinion/recommendation for further
enhancement of the fore coming recommended system. It provides the extension of
the recommender system by the hybrid approach which gives the flexible
recommendation process to searching the items. But it provides intrusive
recommendation to the user it gives the annoying to the user. The system gives the
multi-criteria for solving the searching problem in the recommender system.
Advantage
These tags not only allow users to conveniently revisit and retrieve
previously-revisited web resources, also enable the flexible, search to the user and
explore what other users are interested.
Disadvantage
The next generation approach is extremely expensive, computationally and
spatially. It provides intrusive recommendation to the user and also recommending
the user request by the way of the incorporation of the textual information. There
13
using the both approach such as collaborative and content based filtering it gives
the expensive way of filter but cannot provide the spatial data/location based data .
1.2.3 SINA: Scalable incremental processing of continuous queries in
spatiotemporal databases
Authors: M. F. Mokbel, X. Xiong, and W. G. Aref
To controlling and processing the large number of sequential queries from
the user by producing the essential rating which consist of the location temporal
marking which means the data can be controlled over the spatial movement if the
object or the user will be a stationary one that creates the cluster ring that shows
the result of the appropriate query. For example, find the nearest gas station from
the non- moving object like house. This will be done by the incremental processes
which consider the hashing and joining the sector of the temporal market of the
location. The system provides the sequential queries require sequential evaluation
and it describes the concepts on the networked area with handling the large number
of request.
Advantage
When finding the location based query by using the incremental process to
establish and scalable working on the any algorithm to handle the large/multiple
query which requested by the user and concurrently evaluate the user query if the
object is movable or stationary one.
Disadvantage
14
The location based temporal or spatial-temporal data which can be evaluate
with the limited bandwidth and object histories have required time span which can
be generated in the system must be improved to the scalable environment because
the actual storage will be fault the total searching can also collapsed.
1.2.4 Optimal aggregation algorithms for middleware
Authors: R. Fagin, A. Lotem, and M. Naor
When the database can be implement with minimal query to retrieve the
required item or the object which can constructed by grades and attributes. These
grades are giving the optimal solution to the object by detailed description of the
particular object as its own attributes. For example, the user can search the any
object or the item which can be represented as grade like shapes, then the
aggregation function describe the attributes of the shapes or describe the
probability of the different shapes. The function describes the above things by the
way of sorted and random access on the database by the free environmental
queries.
Advantage
Simplest and easier solution can achieve by the threshold algorithm which
gives the scenario of the randomly access and giving the optimal framework for the
sorted access. Hence user can get both positive and negative retrieval of
information.
Disadvantage
If the scenario can be implemented by the threshold and aggregation based
query algorithms which can be represent the analyzing and comparison of both
15
positive and negative feedback to the user hence it have more expensive and less
scalable.
1.2.5 Efficient evaluation of k-range nearest neighbour queries in road
networks
Authors: J. Bao, C.-Y. Chow, M. F. Mokbel, and W.-S. Ku
When the efficiency of the travelling objects or the users search items which
can be based on the locality of the item and user. These can be achieved by the
searching of nearest range of data in the efficient neighbor queries. These data can
be spatially retrieved and executing the envelope of the data and explained the
required items by the location based recommendation. The required system can
implemented with the various ways of description i.e. user’s uncertainty and not
willing items those can be represented with the spatial data recommendations and
effectively verifying the multiple times of redundant searching can executed and
storage will be improved.
Advantage
The query processing time span is accurate and provide the overall a
response time is also reliable which specifies the network table as simpler and
shorter. Hence it provides the efficient way of achieving the tradeoff the
performance and storage.
Disadvantage
16
The approach can giving the effective performance but it cannot be
exclusively produce the user items because the items only retrieve from the
location on the basis of limited range of values.
1.2.6 Evaluating top-k queries over web-accessible databases
Authors: N. Bruno, L. Gravano, and A. Marian
To efficient processing of top-k queries is a crucial requirement in many
interactive environments that involve massive amounts of data i.e. the database can
store the data in the form of tree structure which can represent the preferred items.
In particular, efficient top-k processing in domains such as the Web, multimedia
search, and distributed systems has shown a great impact on performance. These
crucial requirements are well impact on suggesting the recommendations for users
query. The preference of the item will be empowered by the ratings which are
given by the user. For example, it is reasonable to recommend “iPhone”or
“Micromax” if a user is interested in the “iPhone” user clearly get the preference
rating of that product and also get the recommends from the location based other
users.
Advantage
The system provides the scalable and enhancing the efficiency of the
recommendations responds by the top-k range of queries. These preferences can
17
used to produce the evaluation of the item which is searched and recommended by
the user.
Disadvantage
When the recommendations of the data can give the more efficiency but the
sequential data access is reducing the enhancement of the recommender system.
S.NO PAPER CONCEPTS ADVANTAGE DISADVANTAGE
1 Amazon.com
recommendati
ons: Item-to-
item
collaborative
filtering
Amazon builds a
neighbourhood of
related items S(X);
whenever one who
buy/look at an item,
Amazon then
recommends one’s
items from that item's
neighbourhood
The in formations
can defined
computationally
simpler to find
similar items than
it is to find
similar users.
Faster to update
recommendations
The system
diversity or surprise
in item-to-item
recommendations,
which means it
gives only a similar
items.
2 Toward the
next
generation of
recommender
systems: A
survey of the
The system provides
the opinion or
recommendation for
further enhancement
of the fore coming
recommended
Also allow users
to conveniently
revisit and
retrieve
previously-
revisited web
It provides intrusive
recommendation to
the user and also
recommending the
user request by the
way of the
18
state-of-the-art
and possible
extensions
system. It provides
the extension of the
recommender system
by the hybrid
approach which gives
the flexible
recommendation
process to searching
the items
resources, also
enable the
flexible search.
incorporation of the
textual information.
S.NO PAPER CONCEPTS ADVANTAGE DISADVANTAGE
3 SINA:
Scalable
incremental
processing of
continuous
queries in
spatiotemporal
databases
The system
incremental processes
which consider the
hashing and joining
the sector of the
temporal market of
the location. The
system provides the
sequential queries
require sequential
evaluation
scalable working
on the any
algorithm to
handle the
large/multiple
query which
requested by the
user and
concurrently
evaluate
limited bandwidth
and object histories
have required time
span which can be
generated in the
system must be
improved to the
scalable
environment
4 Optimal
aggregation
algorithms for
middleware
To retrieve the
required item or the
object which can
constructed by grades
and attributes. These
The user can get
both positive and
negative retrieval
of information.
To represent the
analyzing and
comparison of both
positive and
negative feedback
19
grades are giving the
optimal solution to
the object by detailed
description of the
particular object as its
own attributes.
to the user hence it
have more
expensive
S.NO PAPER CONCEPTS ADVANTAGE DISADVANTAGE5 Efficient
evaluation of
k-range
nearest
neighbour
queries in road
networks
The efficiency of the
travelling objects or
the users search items
which can be based
on the locality of the
item and user. These
can be achieved by
the searching of
nearest range of data
in the efficient
neighbour queries.
The approach
provides the
efficient way of
achieving the
tradeoffs the
performance and
storage
The items only
retrieve from the
location on the basis
of limited range of
values.
6 Evaluating
top-k queries
over web-
accessible
databases
The efficient
processing of top-k
queries is a crucial
requirement in many
interactive
environments that
If preferences can
used to produce
the evaluation of
the item which is
searched and
recommended by
When sequential
data access is
reducing the
enhancement of the
recommender system
20
involve massive
amounts of data i.e.
the database can store
the data in the form
of tree structure
which can represent
the preferred items
the user.
Table No.1.1 Literature Review
2.1 Problem Definition
2.1.1 Problem Statement
The existing approach FD (functional dependencies) data matching and
extraction is limited to number of patterns. Most of the existing systems only deal
with the object identification in the open datasets or the database by retrieving as
the location based search queries. In most cases, the approaches doesn’t
personalize answers to the user defined query and also the system which filtering
the preferred data items will be extracted as lower level. It may be provides
irrelevant data to the user on the search engine. Most existing data extraction rules
and algorithms are cost effective for the customers. The existing mechanism are
ought to perform the filtering of sequential queried data/items which based on the
location done using the next level of filtering process.
2.1.2 Problem Solution
In the proposed system concentrate on advanced item searching and is
providing the recommending/ratings. These recommendations are giving better
performance than the existing models because this system uses different algorithms
that declared inside the Java language. The solution differs highly from existing
systems by dealing with the location based item searching and retrieving the
21
corresponding items in the basis of the filtering. This JDBC based system is uses
the integrated approach to connecting and extracting the information as well as the
filtration and searching the location which is related to the user. This proposed
system has been designed to perform the recommendation and item searching
based on the location.
2.1.3 Project scope
This proposed system an Enhanced recommender system for queried data
(ERQD) is very efficient and reuse the user recommendation to analysis the nearby
neighbourhood items and objects which is requested by the user. The initial
updating and implementation can be done by the administrator of the system then
the recommendations are provided by the user to user by rated the appropriate
items or objects. This proposed system can enhanced by the preference to the items
and provide the search done by the location query. Those queries of the user will
retrieve and extracted by the filtering method. These are done by the different
algorithms such as collaborative filtering, top-k and k-nearest neighbor which is
based on the aggregation method.
22
2.1.4 Module List
1. Login
2. Admin
3. Spatial ratings for Non-spatial items
4. Non-spatial ratings for Spatial items
5. Spatial ratings for Spatial items
2.1.5 Module Description
2.1.5.1 Login
This module has the all configuration and authentication rights to maintains
the user information and other secured information about the system that are
currently developing using this system.
2.1.5.2 Admin
Admin is capable of performing perfect task management and facilitates
administrators to manage each and every aspect of the customers including
customer history and activity i.e. it can store the dataset for location and also for
items which is present in the location.
2.1.5.3 Spatial ratings for Non-spatial items
23
When the required approach can giving the recommendations and it based
on the spatial content i.e. (user, ulocation, rating, item) in the system. Three
requirements used 1) Locality: recommendations should be influenced by those
ratings with user locations spatially close to the querying user location 2)
Scalability: the recommendation procedure and data structure should scale up to
large number of users 3) Influence: system users should have the ability to control
the size of the spatial neighborhood that influences their recommendations.
2.1.5.4 Non-spatial ratings for Spatial items
The given approach which enhance the various recommendations and
required the user query and specified items are retrieved by the non-spatial
recommendations. The idea is to evaluate the travel locality, i.e., the observation of
the user’s locality and limit their choice of spatial venues based on travel distance.
Traditional system produces recommendations within reasonable travel distances
by using travel penalty, a technique that penalizes the recommendation rank of
items the further in travel distance they are from a querying user. When using the
non-spatial rating for spatial items will be done by the tuple as (user, rating, item,
ilocation).
2.1.5.5 Spatial ratings for spatial items
In this module consider both the partitioning environment and also getting
the locality of the user. It defines both item location and user location to retrieving
the required query given by the user/customer. When using the non-spatial rating
for spatial items will be done by the tuple as (user, ulocation, rating, item,
ilocation). However, the only difference is that the item-based collaborative
24
filtering prediction score used in the recommendation score calculation is
generated using the (localized) collaborative filtering model from the partial
pyramid cell that contains the querying user, instead of the system-wide
collaborative filtering model.
2.1.6 Requirements Specifications
2.1.6.1 Hardware Specifications
Processor : Pentium IV 2.7Ghz.
RAM : 2GB.
Hard Disk : 40GB.
Compact Disk : 650MB.
Input Device : Standard Keyboard and Mouse.
2.1.6.2 Software Specifications
Operating systems : Windows 7
Language : Java/J2EE
Development Environment : NetBeans 7.2
Language Version : JDK1.6
Database : MySql
25
2.2 Design
2.2.1 System Architecture
26
ServerDB
Query
Result
Type1: Spatial ratings for non-spatial itemsType2: Non-spatial ratings for spatial itemsType3: Spatial ratings for spatial items
Query input
Query
Query
Result
Result
UserType1
Query input
Query input
User
Admin
Rating
Type2
Result
Result
User
Result
Type3
Figure No. 2.1 System Architecture
2.2.2 Dataflow Diagram
27
2.2.2.1 Level 0
Figure No.2.2 Level 0
2.2.2.2 Level 1
Figure No. 2.3 Level 1
2.2.2.3 Level 2
28
Searching and filtering the user query
User details
Recommendation and get required
item
User details
Recommendation and get required item
Admin
Searching
Maintain and managed
User Admin Filtering
Database
Figure No. 2.4 Level 2
2.2.2.4 Level 3
Figure No. 2.5 Level 3
2.2.3 UML Diagram
1. Use Case Diagram
29
Searching
Recommendation and get required item
Maintain and managed
FilteringAdmin
Managing and searching top items
Recommendation and get required
item
Database
2. Class Diagram
3. Activity Diagram
4. Sequence Diagram
2.2.3.1 Use Case Diagram
Figure No. 2.6 Use case Diagram
30
A use case is a methodology used in system analysis to identify, clarify, and
organize system requirements. The use case is made up of a set of possible
sequences of interactions between systems and users in a particular environment
and related to a particular goal. It consists of a group of elements (for example,
classes and interfaces) that can be used together in a way that will have an effect
larger than the sum of the separate elements combined. The use case should
contain all system activities that have significance to the users. A use case can be
thought of as a collection of possible scenarios related to a particular goal, indeed,
the use case and goal are sometimes considered to be synonymous.
2.2.3.2 Class Diagram
A class diagram is an illustration of the relationships and source code
dependencies among classes in the Unified Modelling Language (UML). In this
context, a class defines the methods and variables in an object, which is a specific
entity in a program or the unit of code representing that entity. Class diagrams are
useful in all forms of object-oriented programming (OOP). In a class diagram, the
classes are arranged in groups that share common characteristics. A class diagram
resembles a flowchart in which classes are portrayed as boxes, each box having
three rectangles inside. The top rectangle contains the name of the class; the
middle rectangle contains the attributes of the class; the lower rectangle contains
the methods, also called operations, of the class. Lines, which may have arrows at
one or both ends, connect the boxes. These lines define the relationships, also
called associations, between the classes.
31
Figure No. 2.7 Class Diagram
32
2.2.3.3 Activity Diagram
In Unified Modelling Language (UML), an activity diagram is a graphical
representation of an executed set of procedural system activities and considered a
state chart diagram variation. Activity diagrams describe parallel and conditional
activities, use cases and system functions at a detailed level. An activity diagram is
used to model a large activity's sequential work flow by focusing on action
sequences and respective action initiating conditions. The state of an activity
relates to the performance of each workflow step. An activity diagram is
represented by shapes that are connected by arrows. Arrows run from activity start
to completion and represent the sequential order of performed activities.
Black circles represent an initial workflow state. A circled black circle
indicates an end state. Rounded rectangles represent performed actions, which are
described by text inside each rectangle. A diamond shape is used to represent a
decision, which is a key activity diagram concept. Upon activity completion, a
transition (or set of sequential activities) must be selected from a set of alternative
transitions for all use cases. Synchronization bars indicating the start or completion
of concurrent activities are used to represent parallel sub flows.
33
Figure No. 2.8 Activity Diagram
34
2.2.3.4 Sequence Diagram
A sequence diagram, in the context of UML, represents object collaboration
and is used to define event sequences between objects for a certain outcome. A
sequence diagram is an essential component used in processes related to analysis,
design and documentation. A sequence diagram is also known as a timing diagram,
event diagram and event scenario.
35
Figure No. 2.9 Sequence Diagram
2.3 Implementation
2.3.1 Technical Background
2.3.1.1 Java
Java is a small, simple, safe, object oriented, interpreted or dynamically
optimized, byte coded, architectural, garbage collected, multithreaded
programming language with a strongly typed exception-handling for writing
distributed and dynamically extensible programs. Java is an object oriented
programming language. Java is a high-level, third generation language like C,
FORTRAN, Small talk, Pearl and many others. You can use java to write computer
applications that crunch numbers, process words, play games, store data or do any
of the thousands of other things computer software can do.
Special programs called applets that can be downloaded from the internet
and played safely within a web browser. Java a supports this application and the
follow features make it one of the best programming languages.
It is simple and object oriented
It helps to create user friendly interfaces.
It is very dynamic.
It supports multithreading.
It is platform independent
It is highly secure and robust.
It supports internet programming
Java is a programming language originally developed by Sun Microsystems
and released in 1995 as a core component of Sun's Java platform. The language
36
derives much of its syntax from C and C++ but has a simpler object model and
fewer low-level facilities. Java applications are typically compiled to byte code
which can run on any Java virtual machine (JVM) regardless of computer
architecture.
The original and reference implementation Java compilers, virtual machines,
and class libraries were developed by Sun from 1995. As of May 2007, in
compliance with the specifications of the Java Community Process, Sun made
available most of their Java technologies as free software under the GNU General
Public License. Others have also developed alternative implementations of these
Sun technologies, such as the GNU Compiler for Java and GNU Class path.
The Java language was created by James Gosling in June 1991 for use in a
set top box project. The language was initially called Oak, after an oak tree that
stood outside Gosling's office - and also went by the name Green - and ended up
later being renamed to Java, from a list of random words. Gosling's goals were to
implement a virtual machine and a language that had a familiar C/C++ style of
notation.
Primary goals
There were five primary goals in the creation of the Java language:
1. It should use the object-oriented programming methodology.
2. It should allow the same program to be executed on multiple operating
systems.
3. It should contain built-in support for using computer networks.
4. It should be designed to execute code from remote sources securely.
37
5. It should be easy to use by selecting what were considered the good parts of
other object-oriented languages.
The Java platform is the name for a bundle of related programs, or platform,
from Sun which allow for developing and running programs written in the Java
programming language. The platform is not specific to any one processor or
operating system, but rather an execution engine (called a virtual machine) and a
compiler with a set of standard libraries which are implemented for various
hardware and operating systems so that Java programs can run identically on all of
them.
Different "editions" of the platform are available, including:
Java ME (Micro Edition): Specifies several different sets of libraries (known
as profiles) for devices which are sufficiently limited that supplying the full
set of Java libraries would take up unacceptably large amounts of storage.
Java SE (Standard Edition): For general purpose use on desktop PCs, servers
and similar devices.
Java EE (Enterprise Edition): Java SE plus various APIs useful for multi-tier
client-server enterprise applications.
The Java Platform consists of several programs, each of which provides a
distinct portion of its overall capabilities. For example, the Java compiler which
converts Java source code into Java byte code (an intermediate language for the
Java Virtual Machine (JVM)), is provided as part of the Java Development Kit
(JDK). The sophisticated Java Runtime Environment (JRE), complementing the
JVM with a just-in-time (JIT) compiler, converts intermediate byte code into
native machine code on the fly. Also supplied are extensive libraries (pre-compiled
38
into Java byte code) containing reusable code, as well as numerous ways for Java
applications to be deployed, including being embedded in a web page as an applet.
There are several other components, some available only in certain editions.
The essential components in the platform are the Java language compiler,
the libraries, and the runtime environment in which Java intermediate bytecode
"executes" according to the rules laid out in the virtual machine specification.
Java Virtual Machine
The heart of the Java Platform is the concept of a "virtual machine" that
executes Java byte code programs. This byte code is the same no matter what
hardware or operating system the program is running under. There is a JIT
compiler within the Java Virtual Machine, or JVM. The JIT compiler translates the
Java bytecode into native processor instructions at run-time and caches the native
code in memory during execution.
The use of bytecode as an intermediate language permits Java programs to
run on any platform that has a virtual machine available. The use of a JIT compiler
39
Figure No. 2.10 Java Language Descriptions
means that Java applications, after a short delay during loading and once they have
"warmed up" by being all or mostly JIT-compiled, tend to run about as fast as
native programs. Since JRE version 1.2, Sun's JVM implementation has included a
just-in-time compiler instead of an interpreter.
Although Java programs are Platform Independent, the code of the Java
Virtual Machine (JVM) that execute these programs are not. Every Operating
System has its own JVM.
Class libraries
In most modern operating systems, a large body of reusable code is provided
to simplify the programmer's job. This code is typically provided as a set of
dynamically loadable libraries that applications can call at runtime. Because the
Java Platform is not dependent on any specific operating system, applications
cannot rely on any of the existing libraries. Instead, the Java Platform provides a
comprehensive set of standard class libraries, containing much of the same
reusable functions commonly found in modern operating systems.
The Java class libraries serve three purposes within the Java Platform. Like
other standard code libraries, they provide the programmer a well-known set of
functions to perform common tasks, such as maintaining lists of items or
performing complex string parsing. In addition, the class libraries provide an
abstract interface to tasks that would normally depend heavily on the hardware and
operating system. Tasks such as network access and file access are often heavily
dependent on the native capabilities of the platform. The Java java.net and java.io
libraries implement the required native code internally, then provide a standard
40
interface for the Java applications to perform those tasks. Finally, when some
underlying platform does not support all of the features a Java application expects,
the class libraries can either emulate those features using whatever is available, or
at least provide a consistent way to check for the presence of a specific feature.
Platform independence
One characteristic, platform independence, means that programs written in
the Java language must run similarly on any supported hardware/operating-system
platform. One should be able to write a program once, compile it once, and run it
anywhere.
This is achieved by most Java compilers by compiling the Java language
code halfway (to Java bytecode) – simplified machine instructions specific to the
Java platform. The code is then run on a virtual machine (VM), a program written
in native code on the host hardware that interprets and executes generic Java
bytecode. (In some JVM versions, bytecode can also be compiled to native code,
either before or during program execution, resulting in faster execution.) Further,
standardized libraries are provided to allow access to features of the host machines
(such as graphics, threading and networking) in unified ways. Note that, although
there is an explicit compiling stage, at some point, the Java bytecode is interpreted
or converted to native machine code by the JIT compiler.
The first implementations of the language used an interpreted virtual
machine to achieve portability. These implementations produced programs that ran
more slowly than programs compiled to native executables, for instance written in
C or C++, so the language suffered a reputation for poor performance. More recent
41
JVM implementations produce programs that run significantly faster than before,
using multiple techniques.
This technique, known as just-in-time compilation (JIT), translates the Java
bytecode into native code at the time that the program is run, which results in a
program that executes faster than interpreted code but also incurs compilation
overhead during execution. More sophisticated VMs use dynamic recompilation, in
which the VM can analyze the behaviour of the running program and selectively
recompile and optimize critical parts of the program. Dynamic recompilation can
achieve optimizations superior to static compilation because the dynamic compiler
can base optimizations on knowledge about the runtime environment and the set of
loaded classes, and can identify the hot spots (parts of the program, often inner
loops, that take up the most execution time). JIT compilation and dynamic
recompilation allow Java programs to take advantage of the speed of native code
without losing portability.
Another technique, commonly known as static compilation, is to compile
directly into native code like a more traditional compiler. Static Java compilers,
such as GCJ, translate the Java language code to native object code, removing the
intermediate bytecode stage. This achieves good performance compared to
interpretation, but at the expense of portability; the output of these compilers can
only be run on a single architecture. Some see avoiding the VM in this manner as
defeating the point of developing in Java; however it can be useful to provide both
a generic bytecode version, as well as an optimised native code version of an
application.
Automatic memory management
42
One of the ideas behind Java's automatic memory management model is that
programmers be spared the burden of having to perform manual memory
management. In some languages the programmer allocates memory for the creation
of objects stored on the heap and the responsibility of later deal locating that
memory also resides with the programmer. If the programmer forgets to reallocate
memory or writes code that fails to do so, a memory leak occurs and the program
can consume an arbitrarily large amount of memory. Additionally, if the program
attempts to reallocate the region of memory more than once, the result is undefined
and the program may become unstable and may crash. Finally, in non garbage
collected environments, there is a certain degree of overhead and complexity of
user-code to track and finalize allocations. Often developers may box themselves
into certain designs to provide reasonable assurances that memory leaks will not
occur.
In Java, this potential problem is avoided by automatic garbage collection.
The programmer determines when objects are created, and the Java runtime is
responsible for managing the object's lifecycle. The program or other objects can
reference an object by holding a reference to it (which, from a low-level point of
view, is its address on the heap). When no references to an object remain, the Java
garbage collector automatically deletes the unreachable object, freeing memory
and preventing a memory leak. Memory leaks may still occur if a programmer's
code holds a reference to an object that is no longer needed—in other words, they
can still occur but at higher conceptual levels. The use of garbage collection in a
language can also affect programming paradigms. If, for example, the developer
assumes that the cost of memory allocation/recollection is low, they may choose to
more freely construct objects instead of pre-initializing, holding and reusing them.
With the small cost of potential performance penalties (inner-loop construction of
43
large/complex objects), this facilitates thread-isolation (no need to synchronize as
different threads work on different object instances) and data-hiding. Comparing
Java and C++, it is possible in C++ to implement similar functionality (for
example, a memory management model for specific classes can be designed in C+
+ to improve speed and lower memory fragmentation considerably), with the
possible cost of adding comparable runtime overhead to that of Java's garbage
collector, and of added development time and application complexity if one favors
manual implementation over using an existing third-party library. In Java, garbage
collection is built-in and virtually invisible to the developer. That is, developers
may have no notion of when garbage collection will take place as it may not
necessarily correlate with any actions being explicitly performed by the code they
write. Depending on intended application, this can be beneficial or
disadvantageous: the programme is freed from performing low-level tasks, but at
the same time loses the option of writing lower level code. Additionally, the
garbage collection capability demands some attention to tuning the JVM, as large
heaps will cause apparently random stalls in performance. Java does not support
pointer arithmetic as is supported in, for example, C++. This is because the
garbage collector may relocate referenced objects, invalidating such pointers.
Another reason that Java forbids this is that type safety and security can no longer
be guaranteed if arbitrary manipulation of pointers is allowed.
Performance
Java's performance has improved substantially since the early versions, and
performance of JIT compilers relative to native compilers has in some tests been
shown to be quite similar. The performance of the compilers does not necessarily
indicate the performance of the compiled code; only careful testing can reveal the
true performance issues in any system.
44
Java Runtime Environment
The Java Runtime Environment, or JRE, is the software required to run any
application deployed on the Java Platform. End-users commonly use a JRE in
software packages and Web browser plug-in. Sun also distributes a superset of the
JRE called the Java 2 SDK (more commonly known as the JDK), which includes
development tools such as the Java compiler, Javadoc, Jar and debugger.
One of the unique advantages of the concept of a runtime engine is that
errors (exceptions) should not 'crash' the system. Moreover, in runtime engine
environments such as Java there exist tools that attach to the runtime engine and
every time that an exception of interest occurs they record debugging information
that existed in memory at the time the exception was thrown (stack and heap
values). These Automated Exception Handling tools provide 'root-cause'
information for exceptions in Java programs that run in production, testing or
development environments.
JDBC:(Java Database Connectivity)
Java provides various interfaces for connecting to the database and
executing SQL statements. Using the JDBC interfaces can execute normal
statements, dynamic SQL statements and store procedures that take both IN and
OUT parameters. It enables application to connect any database using the various
drivers and new set of java API objects and Methods.
1. RDBMS/DBMS product using which the database is created.
2. The location of database.
3. The name of database.
45
Database connectivity:
Figure No. 2.11 Database Connectivity
JDBC Interface
Interface DescriptionConnection The interface that connects java
application to database.
Driver The interface used to execute dynamic
SQL statement and stored procedures.
Result Set An interface that provides information
on a result set returned from database.
Statement An interface for executing normal SQL
statement and stored procedures
Table No. 2.1 JDBC Interface
46
Application
Queries for data
Response to queries
MS-Access DB
SQL-DB
2.3.1.2 MySQL
MySQL is a relational database management system (RDBMS) that runs as
a server providing multi-user access to a number of databases. It is named after
developer Michael Widenius' daughter, My. The SQL phrase stands for Structured
Query Language. The MySQL development project has made its source code
available under the terms of the GNU General Public License, as well as under a
variety of proprietary agreements. MySQL was owned and sponsored by a single
for-profit firm, the Swedish company MySQL AB, now owned by Oracle
Corporation.Free-software-open source projects that require a full-featured
database management system often use MySQL. For commercial use, several paid
editions are available, and offer additional functionality. Applications which use
MySQL databases include: TYPO3, Joomla, WordPress, phpBB, Drupal and other
software built on the LAMP software stack.
Features
MySQL offered MySQL 5.1 in two different variants: the open source MySQL
Community Server and the commercial Enterprise Server. MySQL 5.5 is offered
under the same licences. They have a common code base and include the following
features:
A broad subset of ANSI SQL 99, as well as extensions
Cross-platform support
Stored procedures
Triggers
Cursors
Updatable Views
True Varchar support
47
Information schema
Strict mode[further explanation needed]
X/Open XA distributed transaction processing (DTP) support; two phase
commit as part of this, using Oracle's InnoDB engine
Independent storage engines (MyISAM for read speed, InnoDB for
transactions and referential integrity, MySQL Archive for storing historical
data in little space)
Transactions with the InnoDB, and Cluster storage engines; savepoints with
InnoDB
SSL support
Query caching
Sub-SELECTs (i.e. nested SELECTs)
Replication support (i.e. Master-Master Replication & Master-Slave
Replication) with one master per slave, many slaves per master, no
automatic support for multiple masters per slave.
Full-text indexing and searching using MyISAM engine
Embedded database library
Partial Unicode support (UTF-8 and UCS-2 encoded strings are limited to
the BMP)
ACID compliance when using transaction capable storage engines (InnoDB
and Cluster)[28]
Partititoned tables with pruning of partitions in optimiser
Shared-nothing clustering through MySQL Cluster
Hot backup (via mysqlhotcopy) under certain conditions
2.4 Testing
48
The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. It provides a way
to check the functionality of components, sub assemblies, assemblies and/or a
finished product It is the process of exercising software with the intent of ensuring
that the Software system meets its requirements and user expectations and does not
fail in an unacceptable manner. There are various types of test. Each test type
addresses a specific testing requirement.
Type of Testing
Unit testing
Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid
outputs. All decision branches and internal code flow should be validated. It is the
testing of individual software units of the application .it is done after the
completion of an individual unit before integration. This is a structural testing, that
relies on knowledge of its construction and is invasive. Unit tests perform basic
tests at component level and test a specific business process, application, and/or
system configuration. Unit tests ensure that each unique path of a business process
performs accurately to the documented specifications and contains clearly defined
inputs and expected results.
Integration testing
Integration tests are designed to test integrated software components to
determine if they actually run as one program. Testing is event driven and is more
concerned with the basic outcome of screens or fields. Integration tests
demonstrate that although the components were individually satisfaction, as shown
by successfully unit testing, the combination of components is correct and
49
consistent. Integration testing is specifically aimed at exposing the problems that
arise from the combination of components.
Functional test
Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system
documentation, and user manuals.
Functional testing is centred on the following items:
Valid Input : identified classes of valid input must be accepted.
Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
Systems/Procedures: interfacing systems or procedures must be invoked.
Organization and preparation of functional tests is focused on requirements, key
functions, or special test cases. In addition, systematic coverage pertaining to
identify Business process flows; data fields, predefined processes, and successive
processes must be considered for testing. Before functional testing is complete,
additional tests are identified and the effective value of current tests is determined.
System Test
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration oriented system integration test.
System testing is based on process descriptions and flows, emphasizing pre-driven
process links and integration points.
50
White Box Testing
White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at least
its purpose. It is purpose. It is used to test areas that cannot be reached from a black
box level.
Black Box Testing
Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as
most other kinds of tests, must be written from a definitive source document, such
as specification or requirements document, such as specification or requirements
document. It is a testing in which the software under test is treated, as a black
box .you cannot “see” into it. The test provides inputs and responds to outputs
without considering how the software works.
Unit Testing:
Unit testing is usually conducted as part of a combined code and unit test
phase of the software lifecycle, although it is not uncommon for coding and unit
testing to be conducted as two distinct phases.
Test strategy and approach
Field testing will be performed manually and functional tests will be written
in detail.
Test objectives
All field entries must work properly.
Pages must be activated from the identified link.
The entry screen, messages and responses must not be delayed.
Features to be tested
51
Verify that the entries are of the correct format
No duplicate entries should be allowed
All links should take the user to the correct page.
Integration Testing
Software integration testing is the incremental integration testing of two or
more integrated software components on a single platform to produce failures
caused by interface defects. The task of the integration test is to check that
components or software applications, e.g. components in a software system or –
one step up – software applications at the company level – interact without error.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
Acceptance Testing
User Acceptance Testing is a critical phase of any project and requires
significant participation by the end user. It also ensures that the system meets the
functional requirements.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
52
2.5 Result
2.5.1 Snapshots
Figure No.2.12 Query page of user one
Figure No.2.13 Submit Query
53
Figure No.2.14 Save user Query
Figure No.2.15 User two with Submit Query
54
Figure No.2.16 User Three with Submit Query
Figure No.2.17 User Four with Submit Query
55
Figure No.2.18 Initial Ranking By Admin
56
Figure No.2.19 Provide accurate Result for Users
57
Figure No.2.20 Specify Region
Figure No.2.21 User one Nearby areas
58
Figure No.2.22 User get the result for queried items
59
3.1 Conclusion
The proposed technique ERQD has a novel weakly supervised method to
identify the nearby locations and required items which is to be extract with
recommendations simultaneously. It relies on the key insight that a good
recommended patterns should extract and a recommendation items should occur in
filtering process. The experimental results show that our method is effective in
both rating and preferred item identification. It significantly improves recall in
both tasks while maintains high precision. It shows the examples show that these
recommendations for an item results what users are really interested in searching.
Our recommendation system results can be used for a decision making of the user
requirement. For example, the user wants to search nearby restaurant which also
providing the suggestion to what items in the restaurant is most preferred by the
other user and shows the corresponding details.
60
3.2 Future Enhancement
In future this technique ERQD will be planned to evaluate in wide range of
distributed database servers in particular to compare the size of the modules
extracted by the algorithm to the results provided by existing system. If it will be
implement as mobile application with enhancement. It shows the improve
extraction pattern and filtering can also improved. How to identify unreserved data
items using recommender system and how to find the non stored location/more
accurate locations.
61
SOURCE CODE
Server Design
package com.company.Design;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import javax.swing.DefaultListModel;
JRadioButton jrbSimple = new JRadioButton("Simple Probing Method");
JRadioButton jrbGroup = new JRadioButton("Group Probing Method");
JRadioButton jrbBB = new JRadioButton("BB++ Method");
JButton jButtonRtree = new JButton("R-tree Process");
JButton jButtonProcess = new JButton("Process");
JButton jButtonBranch = new JButton("Branch Neighbor's");
JButton jButtonTop = new JButton("Top Result");
SystemProperties systemProperties = new SystemProperties();
String[] values = systemProperties.ServerValues();
62
ServerLogic serverLogic;
ReceiverApp receiverApp;
jLabelOutput = new JLabel("Result :");jLabelOutput.setBounds(550,130, 400, 80);
mainpanel.add(jLabelOutput);jLabelOutput.setVisible(true);
jScrollPaneOutput.setBounds(550,200,400,80);mainpanel.add(jScrollPaneOutput);
jScrollPaneOutput.setVisible(false);mainform.add(mainpanel);
mainform.setSize(1000, 600); mainform.setVisible(true);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension size = mainform.getSize();screenSize.height = screenSize.height / 2;
screenSize.width = screenSize.width / 2;size.height = size.height / 2;
size.width = size.width / 2;int y = screenSize.height - size.height;
int x = screenSize.width - size.width; mainform.setLocation(x, y); }
public static void main(String[] args) {ServerDesign serverDesign = new
ServerDesign();serverDesign.Design();}
App Design
package com.company.Design;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.net.Inet4Address;
import java.net.UnknownHostException;
import java.util.List;
import java.util.Random;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
63
import javax.swing.JTextField;
import com.company.logic.Multicst;
import com.company.logic.Receiver;
import com.company.logic.ServerLogic;
import com.mycompany.DAO.Rankingbuilders;
import com.mycompany.DAO.RankingbuildersDAO;
import com.mycompany.DAO.Rankingfinder;
import com.mycompany.DAO.RankingfinderDAO;
import com.myeclipse.jpa.ApplicationDAO;
import com.mycompany.DAO.Application;
if (category.equalsIgnoreCase("Rankingbuilders")) {List<Rankingbuilders>
listRanking = rankingbuildersDAO.findRankingNode(nodeName);
if (listRanking.size() != 0) {rankingbuilders = listRanking.get(0);
parameters = "Amenities - " + rankingbuilders.getAmenities() +" ";;
rankingAttributesVector.add("amenities - "+ rankingbuilders.getAmenities());
parameters += "Apartement - " + rankingbuilders.getApartement() +" ";;
rankingAttributesVector.add("apartement - "+ rankingbuilders.getApartement());
parameters += "Builders - " + rankingbuilders.getBuilders() +" ";;
rankingAttributesVector.add("builders - "+ rankingbuilders.getBuilders());
parameters += "Commonareas - "+ rankingbuilders.getCommonAreas() +" ";;
rankingAttributesVector.add("commonareas - " +
rankingbuilders.getCommonAreas());
parameters += "Lift - " + rankingbuilders.getLift() +" ";;
rankingAttributesVector.add("lift - "+ rankingbuilders.getLift());
parameters += "Location - " + rankingbuilders.getLocation() +" ";;
rankingAttributesVector.add("location - "+ rankingbuilders.getLocation());
64
parameters += "Distance - " + distance +" ";;ankingAttributesVector.add("distance
- " + distance);
rankingAttributesVector.add("rating - " + rating);}} else if
(category.equalsIgnoreCase("Rankingfinder")) {
List<Rankingfinder> listRanking =
rankingfinderDAO.findRankingNode(nodeName);
if (listRanking.size() != 0) {rankingfinder = listRanking.get(0);
parameters = "Age - " + rankingfinder.getAge() +" ";
rankingAttributesVector.add("age - "+ rankingfinder.getAge());
parameters += "Companyname - " + rankingfinder.getCompanyname() +" ";
rankingAttributesVector.add("companyname - "+
rankingfinder.getCompanyname());
parameters += "Category - " + rankingfinder.getCategory() +" ";
rankingAttributesVector.add("category - "+ rankingfinder.getCategory());
parameters += "Ctc - "+ rankingfinder.getCtc() +"\n";
rankingAttributesVector.add("ctc - "+ rankingfinder.getCtc());
parameters += "Experience - " + rankingfinder.getExperience() +" ";
rankingAttributesVector.add("experience - "+ rankingfinder.getExperience());
parameters += "Stream - " + rankingfinder.getStream() +" ";
rankingAttributesVector.add("stream - "+ rankingfinder.getStream());
parameters += "Distance - " + distance +" ";
rankingAttributesVector.add("distance - " + distance);}}
try {
serverLogic = new ServerLogic(port,
Inet4Address.getLocalHost().getHostName(), this);
} catch (UnknownHostException e1) {// TODO Auto-generated catch block
e1.printStackTrace();}
65
setTitle(nodeName);setLayout(null); /* JLabel */
JLabel jLabelCategory = new JLabel("Category :", JLabel.RIGHT);
jLabelCategory.setBounds(30, 50, 100, 30);
add(jLabelCategory);JLabel jLabelAttributes = new JLabel("Attributes :",
JLabel.RIGHT);
Client Form
package com.company.Design;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.net.Inet4Address;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.TreeMap;
import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
66
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.table.DefaultTableModel;
import org.jvnet.substance.SubstanceLookAndFeel;
import com.company.logic.ServerLogic;
import com.company.support.SocketConnection;
import com.company.support.SystemProperties;
import com.mycompany.DAO.Applicationtables;
import com.mycompany.DAO.ApplicationtablesDAO;
import com.mycompany.DAO.Rankingbuilders;
import com.mycompany.DAO.Rankingfinder;
import com.mycompany.serial.ClientRequest;
jButtonSubmit = new JButton("Submit");
jButtonSubmit.setBounds(160,220,100,30);mainpanel.add(jButtonSubmit);
jButtonSubmit.addActionListener(this);reset = new JButton("Reset");
reset.setBounds(50, 220, 100, 30);mainpanel.add(reset);
reset.addActionListener(this);// jComboBoxApplication
jComboBoxApplication.setBounds(170, 50, 130, 30);
mainpanel.add(jComboBoxApplication);
jComboBoxApplication.addActionListener(this);// JTextField
/* * jTextFieldCategory = new JTextField(); * jTextFieldCategory.setBounds(170,
90, 100, 30); * add(jTextFieldCategory); */// TextFieldCategory.setEditable(false);
67
jComboBoxBuilders = new JComboBox(); jComboBoxBuilders.setBounds(170,
90, 100, 30);mainpanel.add(jComboBoxBuilders); /* * jTextFieldAttributes = new
JTextField(); * jTextFieldAttributes.setBounds(170, 130, 100, 30); *
add(jTextFieldAttributes); // * jTextFieldAttributes.setEditable(false); */
jTextFieldTopResult = new JTextField();
jTextFieldTopResult.setBounds(170,130,100,30);
mainpanel.add(jTextFieldTopResult); // jTextFieldTopResult.setEditable(false);
jCheckBoxLocation = new JCheckBox("UserLocation",false);
jCheckBoxLocation.setBounds(170,170,100,30);
mainpanel.add(jCheckBoxLocation);
/* * jLabelOutput = new JLabel("Result :"); jLabelOutput.setBounds(350
* 70, 200, 200); mainpanel.add(jLabelOutput); */
modelOutput.addColumn("InderMediate Node");
modelOutput.addColumn("Range Score");
modelOutput.addColumn("Node Attributes");
jScrollPaneOutput.setBounds(350, 70, 400, 200);
mainpanel.add(jScrollPaneOutput);mainform.add(mainpanel);mainform.setSize(80
0, 600 + y);mainform.setVisible(true);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension size = mainform.getSize();screenSize.height = screenSize.height / 2;
screenSize.width = screenSize.width / 2;size.height = size.height / 2;
size.width = size.width / 2;int y = screenSize.height - size.height;
int x = screenSize.width - size.width;mainform.setLocation(x, y);
}
public JPanel CreateRadioButtonGroups(String elements[]) {
try {// panel = new JPanel();
jCheckboxAttr = new JCheckBox[elements.length];
68
System.out.println(jCheckboxAttr.length);
for (int i = 0, n = elements.length; i < n; i++) {
JCheckBox jCheckBox = new JCheckBox(elements[i], false);jCheckboxAttr[i] =
jCheckBox;
Admin Design
package com.company.Design;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import com.company.support.SystemProperties;
import com.mycompany.DAO.ApplicationNode;
69
import com.mycompany.DAO.ApplicationNodeDAO;
import com.mycompany.DAO.Applicationtables;
import com.mycompany.DAO.ApplicationtablesDAO;
import com.mycompany.DAO.Application;
public class AdminDesign extends JFrame implements
ActionListener,WindowListener {
private JTextField jTextFieldName;
private JTextField jTextFieldCategory;
private JTextField jTextFieldAttributes;
private JTextField jTextFieldRegion;
private JComboBox comboxRatings;
private SystemProperties systemProperties = new SystemProperties();
private JButton jButtonSubmit;
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("RankingPU");
EntityManager em = emf.createEntityManager();
EntityTransaction entr = em.getTransaction();entr.begin();em.persist(application);
entr.commit();JOptionPane.showMessageDialog(null, "Successfully Saved !!!");
} else {
JOptionPane.showMessageDialog(null, "Enter all the fields");}
} else if (e.getSource() == jComboBoxApplication) {
FetchNodeName(jComboBoxApplication.getSelectedItem().toString());}}
public void FetchNodeName(String name) {
int size = 0; Random random = new Random();
List<ApplicationNode> applicationList;
ApplicationNodeDAO applicationNodeDAO = new ApplicationNodeDAO();
if (name.equalsIgnoreCase("rankingbuilders"))
70
applicationList = applicationNodeDAO.findAll("builders", "yes");
else
applicationList = applicationNodeDAO.findAll("finder", "yes");
size = applicationList.size();if (size != 0) {
int fetchRandomNode = random.nextInt(size);
ApplicationNode applicationNode = applicationList.get(fetchRandomNode);
jTextFieldName.setText(applicationNode.getNodename());
EntityManagerFactory emf = Persistence
.createEntityManagerFactory("RankingPU");
EntityManager em = emf.createEntityManager();
EntityTransaction entr = em.getTransaction();primaryId = applicationNode.getId();
ApplicationNode app = em.find(ApplicationNode.class,applicationNode.getId());
entr.begin(); em.remove(app);entr.commit(); entr.begin(); app.setAvailable("no");
em.persist(app);entr.commit();// applicationNodeDAO.Update(applicationNode);
} else {
JOptionPane.showMessageDialog(null, "No more Node's in DB");}}
public void windowActivated(WindowEvent arg0) {
// TODO Auto-generated method stub
}
public void windowClosed(WindowEvent arg0) { // TODO Auto-generated
method stub
System.out.println("Hello");}
EntityManager em = emf.createEntityManager();
EntityTransaction entr = em.getTransaction();
ApplicationNode app = em.find(ApplicationNode.class, primaryId);
if (app != null) {
entr.begin(); em.remove(app);entr.commit(); entr.begin(); app.setAvailable("yes");
71
em.persist(app);entr.commit();
}}}
REFERENCES
[1] Adomavicius .G and Tuzhilin .A, “Toward the next generation of
recommender systems: A survey of the state-of-the-art and possible extensions,”
IEEE Trans. Knowl. Data Eng., vol. 17, no. 6, pp. 734–749, Jun. 2005.
[2] R. Fagin, A. Lotem, and M. Naor, “Optimal aggregation algorithms for
middleware,” in Proc. ACM Symp. PODS, New York, NY, USA, 2001.
[3] G. Linden .G, B. Smith, and J. York, “Amazon.com recommendations: Item-to-
item collaborative filtering,” IEEE Internet Comput., vol. 7, no. 1, pp. 76–80,
Jan./Feb. 2003.
[4] J. Bao, C.-Y. Chow, M. F. Mokbel, and W.-S. Ku, “Efficient evaluation of k-
range nearest neighbor queries in road networks,” in Proc. Int. Conf. MDM,
Kansas City, MO, USA, 2010.
[5] Bruno .N, Gravano .L, and Marian .A, “Evaluating top-k queries over web-
accessible databases,” in Proc. ICDE, San Jose, CA, USA,2002.
[6]M.-H. Park, J.-H. Hong, and S.-B. Cho, “Location-based recommendation
system using Bayesian user’s preference model in mobile devices,” in Proc. Int.
Conf. UIC, Hong Kong, China, 2007.
[7] M. F. Mokbel, X. Xiong, and W. G. Aref, “SINA: Scalable incremental
processing of continuous queries in spatiotemporal databases,” in Proc. SIGMOD,
Paris, France, 2004.
[8] P. Venetis, H. Gonzalez, C. S. Jensen, and A. Y. Halevy, “Hyperlocal,
directions-based ranking of places,” PVLDB, vol. 4, no. 5, pp. 290–301, 2011.
[9] M.H. Park, J.-H. Hong, and S.-B. Cho, “Location-based recommendation
72
system using Bayesian user’s preference model in mobile devices,” in Proc. Int.
Conf. UIC, Hong Kong, China, 2007.
[10] Y. Takeuchi and M. Sugimoto, “An outdoor recommendation system
based on user location history,” in Proc. Int. Conf. UIC, Berlin, Germany, 2006.
[11] V. W. Zheng, Y. Zheng, X. Xie, and Q. Yang, “Collaborative location and
activity recommendations with GPS history data,” in Proc. Int. Conf. WWW, New
York, NY, USA, 2010.
[12] M. Ye, P. Yin, and W.-C. Lee, “Location recommendation for location-based
social networks,” in Proc. ACM GIS, New York, NY, USA , 2010.
[13] G. R. Hjaltason and H. Samet, “Distance browsing in spatial databases,” ACM
TODS, vol. 24, no. 2, pp. 265–318, 1999.
[14] K. Mouratidis, M. L. Yiu, D. Papadias, and N. Mamoulis, “Continuous nearest
neighbor monitoring in road networks,” in Proc. Int. Conf. VLDB, Seoul, Korea,
2006.
[15] D. Papadias, Y. Tao, K. Mouratidis, and C. K. Hui, “Aggregate nearest
neighbor queries in spatial databases,” ACM TODS, vol. 30, no. 2, pp. 529–576,
2005.
[16] S. Börzsönyi, D. Kossmann, and K. Stocker, “The skyline operator,” in Proc.
ICDE, Heidelberg, Germany, 2001.
[17] M. Sharifzadeh and C. Shahabi, “The spatial skyline queries,” in Proc. Int.
Conf. VLDB, Seoul, Korea, 2006.
[18] R. A. Finkel and J. L. Bentley, “Quad trees: A data structure for retrieval on
composite keys,” Acta Inf., vol. 4, no. 1, pp. 1–9, 1974.
[19] A. Guttman, “R-trees: A dynamic index structure for spatial searching,” in
Proc. SIGMOD, New York, NY, USA, 1984.
73
[20] K. Mouratidis, S. Bakiras, and D. Papadias, “Continuous monitoring of spatial
queries in wireless broadcast environments,” IEEE Trans. Mobile Comput., vol. 8,
no. 10, pp. 1297–1311, Oct. 2009.
74