Modeling the Imprecision of Flexible Queries Using a ...

1 downloads 0 Views 224KB Size Report
The finale request is then : SELECT emp#, mu(Salaire,Budget). FROM emp E, Dept D WHERE. E.Dep# = D.Dep# AND Salaire>=15000 AND Budget between ...
Modeling the Imprecision of Flexible Queries Using a Fuzzy SQL Language LARBI Abdelmadjid1,2.,MALKI Mimoun2, BOUKHALFA Kamel3 , LAYACHI H.1,4 1Laboratoire

ENERGARID, Université de Béchar, AMDlarbi, [email protected] EEDIS, Université UDL Sidi Bel Abbes, [email protected] 3 Laboratoire des Systèmes Informatiques (LSI) USTHB Alger, [email protected] 4École de technologie supérieure, Montréal (Québec) Canada 2Laboratoire

Abstract. People mainly use concepts linked by logical rules. These concepts have a high semantic content and they are representing by words, more or less vague. Fuzzy logic propose to formalize the use of vague terms in order to be processing automatically. Indeed, problems arise when the user is not expressed directly as a Boolean condition (all or nothing), but instead is gradual, due to the existence of preferences in these search criteria [1]. These problems can be solved by a query called yet flexible using fuzzy querying language. In addition to defining a flexible querying language as SQLf, there is question of studying the mechanisms for assessing these queries. The optimal evaluation of queries expressed in a declarative manner (as in SQL) remains an open problem due to its combinatorial nature, and negotiation systems are restricted to use heuristics having common sense, which, in general, lead to solutions acceptable. However, two strategies are possible [2]:  Translation of a fuzzy query in a Boolean query (bypass), given a satisfaction level (threshold quality) to be achieved.  The fuzzy query compilation. This second strategy is to obtain an automatic evaluation procedure including heuristics. This paper part under the first strategy , it aim to implement an interface based on the derivation of fuzzy queries into Boolean queries using a syntax-directed translator schema (SDTS) which allows us to better interpret a fuzzy query. In order to implement this proposal, we will apply it to the case of project management. Keywords: Databases, SDTS, Translator, fuzzy SQL, fuzzy queries, fuzzy logic, project management

1 Introduction The logic is a theory of reasoning and determining whether an inference is valid or not. Classical formal logic is a theory of valid inference that does not take into account the semantic content of the argument. It is also bivalent assertoric and extensional. In 1965, Zadeh [3] formulated the theory of fuzzy sets in order to address some of the gaps trivalent logic. Fuzzy logic is born from the observation that most of the phenomena cannot be represented using Boolean variables that can take only two values (zero or one). In what follows we present the concept of the database flexible querying, the state of art of this concept, translation Scheme Directed by Syntax, fuzzy SQL translation algorithm then we present our solution applied to the intelligent management of the project and finally a conclusion.

2

2. Flexible Querying of Databases

2.1. Modeling a Vague Term In his report, Bartel [4] focuses on the fuzzy term modeling. A vague term is an adjective natural language. To model a vague term, he used a trapezoidal function (see Figure 1). It remains the user's vague term to define the parameters characterizing this function. A trapezoidal function being defined by the tuple ((A, 0), (B, 1), (C, 1), (D, 0)), the values of A, B, C, D have to be completed.

Fig. 1. Trapezoidal function definition vague terms.

2.2. Linguistic Modifiers Linguistic modifier can change the shape of a fuzzy set, or create a new one. There are many types, and there are many calculation methods. Some modifiers such as “very”, “extremely”, “a little” rather slightly intensify or dilute the membership function. Others, such as “absolutely” and “generally” change the overall degree of fuzzy[5]. Example of The modifier "very": One of the oldest modifiers and² most commonly used, is "very" used in queries as a fuzzy set adjective. For example, SELECT Name FROM Company WHERE Annual turnover IS "very" High

2.3. Fuzzy SQL Query [2] Several studies as OMRON, FQUERY, ISKREOT, FSQL, SQLf, SOFTSQL and others have applied Fuzzy Sets Theory for the database to resolve this problem. SQLf [6] is the most comprehensive because it has more long SQL statements and it is the only way to update the SQL: 1999 [7].

3

Fig. 2. General architecture of fuzzy SQL queries evaluation (bypass). Example: Let the request to find the employees numbers who satisfy the condition to be well paid and work in a department with medium budget and with a degree least or equal to 0.8. The evaluation of this query is based on the calculation of the 0.8-cross section of the condition: salary = "well paid" and budget = "medium". Applied to the result of the equijoin of relations emp and dept. Assuming that fuzzy predicates are those specified in Figure 2, the Boolean condition derived (equivalent) is "salary> = 15000 and Budget ϵ[3.2, 3.8]", because: (salary = "well paid" and budget = "medium") (x)>=0.8  Min ((salary = "well paid") (x) (budget = "medium") (x))>=0.8  (salary = "well paid") (x)>=0.8 and (budget = "medium") (x)>=0.8

Fig. 3. The predicates salary = "well paid" and budget = "medium". The finale request is then : SELECT emp#, mu(Salaire,Budget) FROM emp E, Dept D WHERE E.Dep# = D.Dep# AND Salaire>=15000 AND Budget between 3.2 and 3.8 Where mu is a function that calculates the final degree of each tuple of the result (in this case, the function calculates the minimum levels on the conditions well-paid (salary) and the medium (budget)).

2.4. Limitations of the Approach [6]: This approach is well suited to the case of fuzzy query with projection, select or join type as: 1) It is possible for these queries to derive a Boolean condition,

4

2) The calculation of the final degree associated with a tuple is based only on the attribute values of the n-uple.

3. Database Flexible Querying Background: a. Tahani, was one of the first to advocate the use of fuzzy sets for querying conventional databases. His idea consisted of allowing the expression of imprecise conditions inside queries seen as fuzzy sets. Tahani suggested the extension of the SEQUEL[8] base block (At that time, it was the most widely known relational database language in order to support the imprecise comparison between an attribute value and a constant or between two attribute values (joins)). These elementary predicates can be combined using the connectors AND and OR working as intersection and union of fuzzy sets (min/max).[9] b. In Bosc & al. [10][11][12], the objective is to introduce some fuzziness in the base block of SQL. This can be achieved at two principal levels: In the predicates and in the way they are combined (connectors). c. In Jarzabeck & al. [12], a program query language, called PQL that facilitates the design of flexible SPAs (Static Program Analyzers). PQL is a conceptual level, source language-independent notation to specify program queries and program views.

Fig. 4. An architecture of a statistic program analyzer (SPA). d.In Bartel & al. [4], the iSQLF software is based on the sqlf language developed by the research team Badins. This language is actually a superset of SQL. Indeed, the language extends SQL block, sqlf enabling conditions in the WHERE clause be fuzzy and these requests will be made on a fuzzy conventional DBMS. In Aude & al. [13], a prototype of iSQLf software has been built with a Web interface. The aim of the project was to completely rebuild the application using more recent technologies as Java and servlets.

5

Fig. 5. Application General scheme (2007) e.

Gonzalez & al. [8] have proposed an upgrading sqlf according SQL2003 standard, proposing these new fuzzy features : fuzzy table storage, fuzzy multiset data type and fuzzy merge statement.

f. In Tamani & al. [14], the personalization of flexible querying of information systems dedicated to multimodal transportation networks is addressed in this paper. Tamami & al. have proposed an approach which consists in the development of a fuzzy semantic layer in order to extend the functionalities of information systems to reasoning. This layer is made of reasoning functions which combine domain application data with ontology axioms.

Fig. 6. The embedded concepts and data

Smith & al. [15] have presented the implementation of a fuzzy query system integrated with a manager relational database. This system relies on language SQLf to execute queries involving fuzzy predicates connected by conjunctions, disjunctions, quantifiers fuzzy gradual by other operators. [1]

g.

4. SDTS : SYNTAX-DIRECTED TRANSLATION SCHEMES We will define a SDTS which we have propose as component of our Fuzzy SQL solution. A SDTS is a grammar that generates a language, and has production rule for each element of translation attached. Whenever a production called for a bypass, also known as the translation generated by the element attached. More formally, a SDTS is a 5-tuple T = (N, Σ, ∆, R, S) • N : finite set of non terminal symbols • Σ : finite set of input alphabet • ∆ : finite set of output alphabet • S : axiom of the grammar (not terminal)

6

• R : production finite set of type A → α, β with α Î (NU Σ) * and β Î (NU ∆) *. Non-terminal β is a permutation of α.

Fig. 7. Architecture of our interface - Analysis Levels of a Fuzzy SQL query. The user translator allows us through the grammar productions used to do nothing for the common clauses between SQL and SQL Fuzzy and make the necessary changes for the other cases. These changes relate to the usages of the threshold and caliber to transform (or) qualitative value(s) on quantitative(s) value (s). 5.1 Fuzzy SQL Grammar Used in Our Solution The user program can use Fuzzy SQL the data manipulation language (DML) for querying and updating the database (DB). Thus, the first step when a user formulates his query is whether this request is lexically correct and that the words belong to the lexicon of Fuzzy SQL translator. If there are any errors, an error message will be displayed. After this step, we proceed to a parser to verify that the user has complied with the rules of writing a query in Fuzzy SQL. These rules are only slightly different from the rules of the SQL standard. If there are errors, we analyze the query entered by the user (SELECT, INSERT, DELETE, or UPDATE) clause by clause to determine where the error are located. Then, it displays an error message. To translate the Fuzzy SQL query entered by the user, we used a Backus Naur Form grammar (BNF). A part of the grammar used is as follows:

Figure 8 : Part of the used Grammar

7

5. Fuzzy SQL translation algorithm The algorithm used in Fuzzy SQL to translate a Fuzzy SQL query into a SQL query standard is as follows:

Fig. 9. Lexical error The software provides a simple interactive fuzzy SQL interface, which allows editing of SQL queries and fuzzy SQL. Indeed, it extends the basic concepts of the standard SQL by adding new fuzzy concepts defined in fuzzy SQL. Fuzzy SQL like any requester must parse the query before executing it. For the lexical, syntactic and semantic analysis, if an error occurs, it will be processed and displayed.

Fig.10. Lexical error

Fig. 11. Fuzzy SQL Editor

6. Conclusion and perspective : This paper shows that it is realistic to define a query language supporting imprecise terms as an extension of a regular relational query language using a SDTS. In the

8

context of SQL, this is essential for users who are familiar with SQL will find a language augmented with a good continuation of the original. We wanted Fuzzy SQL to be expressive, a simple source language. This solution does not touch the case of fuzzy complex queries where there are nested structure or another. We‘ve tested all cases of errors (lexical, syntax and semantic errors). The result was encouraging. We are also developing a graphical interface that allows users to construct queries without having knowledge neither of fuzzy query languages nor on fuzzy logic. This work is a preliminary study aimed at defining a system supporting fuzzy data and gradual Inclusion queries using a SDTS. As a perspective, we extend this work to cover complex flexible queries and we propose to use this solution by using an expert system for solving the problem of estimation risk in intelligent management of a project or using a terminology ontology.

References [1]: Bosc P., Pivert O. “Fuzzy databases”, Eds. Handbook of Fuzzy Computation, Chapter 4.1,Oxford Uiversity Press, 1998 [2] Claudia González, Marlene Goncalves and Leonid Tineo, “A New Upgrade to sqlf : Towards a Standard in Fuzzy Databases”, 2009 [3] L.A. Zadeh, “Fuzzy Sets,” Journal of Information and Control, 8, 1965. [4] BARTEL Samuel, « Interrogation floue de Bases de données : extension de iSQLf » , 2006 [5] Earl D. Cox,. ”The Fuzzy Systems Handbook”, A Practitioner’s Guide to Building Using and Maintaining Fuzzy Systems, Cambridge, MA. 1994 [6] Bosc P., Pivert O. “SQLf: a relational database language for fuzzy querying”. IEEE Transactions on Fuzzy Systems, vol(3) p.1–17, 1995. [7]M. Goncalves &al. “SQLf Flexible Querying Language Extension by means of the norm SQL2”, The 10th IEEE International Conference on Fuzzy Systems, 2001. [8] D. Chamberlin et al., “SEQUEL2: A unified approach to data definition, manipulation and control,” IBM J. Of Res. And Dev., vol. 20, pp. 56G575, 1976 [9]Tahani V., “A conceptual framework for fuzzy query processing; a step toward very intelligent database systems”, Inf. Processing and Management.13, 1977 [10][P. Bosc, m. Galibourg, and g. Hamon, “fuzzy querying with sql : extensions and implementation aspects,” fuzzy sets and syst., vol. 28, pp. 333-349, 1988. [11]Bosc P., Pivert O., Fuzzy queries and relational databases, 1994 [12] [S. Jarzabek , “Design of Flexible Static Program Analyzers with PQL”, IEEE Computer Society 1998 [13] B. Aude et G. Florian "Redesign prototype fuzzy query ISQLF”, March 2007 [14] N. Tamani, "An Extension of a Fuzzy Ontology for Flexible Querying", 2011 [15] Gregory Smits, "Postgre SQLf: A Fuzzy Query System", December 2012

Suggest Documents