=Paper= {{Paper |id=None |storemode=property |title=Fuzzy XML with Implementation |pdfUrl=https://ceur-ws.org/Vol-920/p58-panic.pdf |volume=Vol-920 |dblpUrl=https://dblp.org/rec/conf/bci/PanicRS12 }} ==Fuzzy XML with Implementation== https://ceur-ws.org/Vol-920/p58-panic.pdf
                                      Fuzzy XML with Implementation

                                            ∗
                      Goran Panić                                   Miloš Racković                            Srdjan Škrbić
              Ðure Jakšića 87 23323 Id̄oš                          Faculty of Science                         Faculty of Science
                        Serbia                                  Trg Dositeja Obradovića 4                 Trg Dositeja Obradovića 4
               goran.pn@gmail.com                                    21000 Novi Sad                             21000 Novi Sad
                                                                          Serbia                                     Serbia
                                                              rackovic@dmi.uns.ac.rs                    srdjan.skrbic@dmi.uns.ac.rs


ABSTRACT                                                                               top of standard XML would result in XML containing in-
Standard XML format does not allow for imprecise or incom-                             sufficiently defined and imprecise information.
plete values. This is one of the requests imposed on this for-                            Several papers dated to previous decade can be found,
mat by many real-word usages. Using fuzzy logic in order to                            discussing the use of fuzzy logic in defining XML indefinite-
introduce indefiniteness in XML has been researched in sev-                            ness. However, the published papers focus mostly on set-
eral different papers in the last decade. While these papers                           ting up theories and defining syntax. There are only a small
were mostly focused on setting up theories and the syntax,                             number of papers that deal with the implementation pro-
this paper has practical usage as its main goal. Application                           cess and practical usage. Some simplistic implementations
called ’Fuzzy XML editor’ was created and described in this                            were presented, limited to a restricted set of instructions
research. This editor is intended to work with fuzzy XML                               which often do not meet the needed functionality for any
and to support XSD and DTD schemas.                                                    sort of practical use. Without practical usage, it is hard
                                                                                       to get a clear view of actual possibilities of different theo-
                                                                                       ries. Also, the performance and complexity of implementing
Categories and Subject Descriptors                                                     seemingly good syntax solutions do not always have to be
H.4.m [Information Systems Applications]: Miscella-                                    satisfactory. In order to overcome these problems, this pa-
neous; D.2.8 [Software Engineering]: Metrics—Complex-                                  per focuses on practical solutions in real-world environment.
ity measures, Performance measures                                                     This is achieved by implementing to a level of usable ap-
                                                                                       plications. For numerical computation, MATLAB (Matrix
                                                                                       laboratory) software was used (for the sake of simplicity and
General Terms                                                                          good performance). MSSQL (Microsoft SQL Server) is used
Theory                                                                                 as underlying database with XQuery queries. Fuzzy priori-
                                                                                       ties and thresholds will be used and implemented in XQuery
Keywords                                                                               queries for the first time. However, prioritized fuzzy XQuery
                                                                                       is out of scope and will be left for a subsequent paper.
Applications, information sciences, fuzzy databases, infor-                               Second chapter provides an overview of existing papers,
mation retrieval                                                                       in the field of fuzzy logic usage with XML. Chapter 3 ex-
                                                                                       plains XML indefiniteness, presenting extended XSD (XML
1.    INTRODUCTION                                                                     Schema Definition) and DTD (Document Type Definition)
   XML (Extensible Markup Language) has revolutionized                                 schemas for indefinite XML. The features of application specif-
fields of data storage and transfer in the last decade. There                          ically developed for this paper are presented in details in
are many positive sides to XML which made it de facto a                                Chapter 4.
standard for many different uses. Values stored in XML
elements and attributes are absolutely in accordance with                              2. RELATED WORK
their definition. Also, the whole structure of XML file is                                Related research presented in this paper was conducted
predefined and non-changeable. However, in reality, most                               in the last five years at the University of Novi Sad. The
information comes in the form of imprecise or incomplete                               main topic was implementation of system capable of using
values (e.g. fast car, tall building). Storing imprecise in-                           priority fuzzy logic with relational databases. In addition,
formation is not one of the things standard XML supports.                              complete fuzzy relational database application solution was
Fuzzy sets and fuzzy logic are theories used in many dif-                              designed and implemented [1, 2, 3].
ferent fields where the use and processing of imprecise and                               The use of fuzzy logic in indefinite XML is an area where
incomplete information were needed. Adding fuzzy logic on                              multiple papers have been presented in the last decade. Most
                                                                                       influential research topics are: defining indefiniteness in XML
∗Corresponding author, tel. +381 64 289 8959
                                                                                       values and defining indefiniteness in XML structure.
                                                                                          For defining indefiniteness in XML structure usually XPath
BCI’12, September 16–20, 2012, Novi Sad, Serbia.                                       and XQuery languages were extended by the authors. Pre-
Copyright c 2012 by the paper’s authors. Copying permitted only for private and
                                                                                       sented solutions find elements in XML documents whose po-
academic purposes. This volume is published and copyrighted by its editors.
Local Proceedings also appeared in ISBN 978-86-7031-200-5, Faculty of Sciences,
                                                                                       sitions are not exactly stated. Examples of such solutions
University of Novi Sad.                                                                are given in: [4, 5, 6, 7, 8, 9].


                                                                                  58
   Most significant form of XML indefiniteness is the indef-            from given intervals. The level of membership is taken from
initeness in XML values. For structural definitions of fuzzy            the interval [0,1]. Text used to define the value has a stan-
XML documents, XML schemas are usually used. However,                   dardized format so that parser is able to transform it into the
in some works schema graphs were used for the same pur-                 corresponding mathematical function. For example, func-
pose. Such examples are presented in: [10, 11, 12, 13, 14,              tions are defined as this: A* x + B. Membership will be
15, 16].                                                                set to zero if there are intervals with undefined membership
   XML documents are often stored into databases that sup-              function.
port XML. Papers related to this subject discuss extending                 The easiest way to define the previously described fuzzy
database models by introducing fuzzy types or extending the             type is to use some of the existing XML schemas. XSD
SQL and XQuery syntax by using fuzzy elements. See more                 schema which defines the described fuzzy type is presented
on this topic in following papers: [17, 18, 19, 20, 21, 22, 23,         below. The element containing function describes part of
24, 25].                                                                the membership function limited by minValue and maxValue
   In this paper implementation of indefiniteness in XML                constraints. The functions element classifies function parts
values is researched. This assume definition of XML model               into a complex membership function. The fuzzy element is a
that allows storing of fuzzy values. The main focus is on the           fuzzy set which is defined by a set of membership functions.
implementation of practical fuzzy XML applications.                     Fuzzy XSD schema is presented in listing 1

3.   FUZZY XML SYNTAX                                                          Listing 1: XSD schema for fuzzy element
   Best solutions presented in related works were combined          1 
For instance, [6] describes the most general solution to the        2   
problem of storage of fuzzy XML documents. To defined               3        
                                                                    4              
constructs in XML element values. The indefiniteness in             5        
                                                                    6   
the XML structure was out of scope for this paper and is            7
left for the future work.                                           8     
   Membership function is most important when it comes to           9       
fuzzy set usage. It is not an easy task to define membership       10             
function, while its storage and processing leverage the level      11       
of complexity of the implementation. There are two ways            12       < x s : a t t r i b u t e name=”name ” t y p e=” x s : s t r i n g ”/>
of building such solution. The first is that fuzzy set should      13     
                                                                   14
include certain number of simple and well-known function           15   
types (e.g. increasing, decreasing, triangular, trapezoidal).      16       
In choosing groups of fuzzy sets to implement, one needs           17            
                                                                   18                < x s : e x t e n s i o n b a s e=” x s : s t r i n g ”>
to pay special attention to the choice of sets. The purpose        19                   < x s : a t t r i b u t e name=”minValue” t y p e=”
is to cover as many real systems as possible. Still, regard-                                     x s : s t r i n g ” />
less of how many fuzzy sets are introduced, they are still         20                   < x s : a t t r i b u t e name=”maxValue ” t y p e=”
                                                                                                 x s : s t r i n g ” />
restricted. So, cases whose functions are not described are        21                
still unreachable to such solutions.                               22            
   The second option is to define syntax which can model           23       
                                                                   24   
the fuzzy set. In this paper, this option was selected due to      25 
its versatility. XML is metalanguage, intended to offer ex-
pandability, so there was no need to specifically change XML              So, by referencing Fuzzy.xsd schema in a XML document
language syntax to support fuzzy logic. Still, in order to de-          and using Fuzzy type for element type, indefinite fuzzy XML
sign XML structure flexible enough to enable defining wide              can be written. An example of this is given in listing 2.
variety of fuzzy sets, there are certain conditions. These are
presented below.
                                                                                    Listing 2: Using Fuzzy XSD schema
   For example, there is an XML element, ,             1 
which is undefined and is of a fuzzy type. The element can          2  elements which rep-                    ” x m l n s : x s=” h t t p : //www . w3 . o r g / 2 0 0 1 /XMLSchema”>
                                                                    3   < x s : i n c l u d e sc h e m a L o c a t i o n =”Fuzzy . xsd ”/>
resent fuzzy sets. All fuzzy sets are uniquely named using          4   
the name attribute, such as . Fuzzy              5        
sets are further defined by  - membership func-           6            
                                                                    7                
tions which can vary in number. Membership functions                8                
attributes. As presented here: 
maxValue=”10”>; this cannot overlap within a single fuzzy          10                
plus infinity, minValue: minus infinity. The value of the          11            
 element defines the membership function for             12        
                                                                   13   
certain area defined by the minValue and maxValue at-              14 
tributes. In this value x is a variable that collects values


                                                                  59
      Same can be achieved by using other types of XML schema
    documents. Using DTD schema for the same task is pre-
    sented in listing 3.

           Listing 3: DTD schema for fuzzy element
1 
2 < !ELEMENT measurement ( t e m p e r a t u r e )>
3 < !ELEMENT t e m p e r a t u r e ( f u z z y +)>
4 < !ELEMENT f u z z y ( f u n c t i o n +)>
5 < ! ATTLIST f u z z y name CDATA #REQUIRED>
6 < !ELEMENT f u n c t i o n (#PCDATA)>
7 < ! ATTLIST f u n c t i o n
8     minValue CDATA #REQUIRED
9     maxValue CDATA #REQUIRED>

      Full example of fuzzy XML documents defined in accor-
    dance to presented syntax, storing air temperature measure-
    ments are given in listing 4.
                                                                                        Figure 1: Fuzzy XML editor.

                  Listing 4: Fuzzy XML example
1  
 2   New s t a t i o n                                        the DTD and XSD models are in charge of working with
 3   41                                fuzzy XML schemas. The XQuery model implements work-
 4   2012−02−03 10 : 3 0
 5   
                                                                           ing with fuzzy XQuery, and includes the support for priori-
 6                                             ties and thresholds. However, fuzzy XQuery is out of scope
 7         1             of this paper. Each of the components can implement the
 8         −1/(Max
                    −Min ) ∗x + Max/ (Max−Min )
                                                                           part for working with the fuzzy syntax apart from working
 9                                                            with the standard language syntax.
10                                                  The View-Model layer makes it possible to communi-
11         1 / (Max         cate with the layer below and consists of several modules.
                    −Min ) ∗x − Min / (Max−Min )
12         1            The Command group classifies modules for working with
13                                                            commands that implement interfaces for model approach.
14                                                The Syntax Validation component enables validation of doc-
15 
                                                                           ument syntax. The Fuzzy group enables working with mem-
       The value of fuzzy elements can include real text, the so           bership functions and fuzzy linguistic variables. The Fuzzy
    called linguistic definitions. They start with a # sign. These         group relies on the Matlab module which is an interface to
    variables are predefined fuzzy sets. Example of such defini-           external application - MATLAB. Calculations of the mem-
    tion can be found in listing 5.                                        bership level are done using MATLAB libraries.
                                                                              The View layer is the last layer. It implements the user
                                                                           interface, so that the user can perform functionalities defined
            Listing 5: Linguistic definition example                       in the Command group. The Main Window component is
1   #Maybe
                                                                           the main application window which includes the user con-
                                                                           trols from the Controls group and enables calling of the other
    4.    FUZZY XML EDITOR                                                 independent dialogue windows from the Dialogs group.
                                                                              Executable version and other data of the application can
       Application ’Fuzzy XML editor’ is implemented to demon-
                                                                           be found at http://www.is.pmf.uns.ac.rs/fuzzydb.
    strate practical aspect of working with fuzzy XML syntax.
    This application enables creation and working with fuzzy
    XML, XSD and DTD documents, and has been developed
    specifically for the needs of this paper. Main application             5. CONCLUSION
    window is presented on figure 1.                                          This paper successfully unites the process of defining syn-
       .NET framework and WPF technology were used in imple-               tax and implementing it. An application solution that en-
    mentation of this application. Fuzzy XML tool components               ables usage of the fuzzy logic constructs with XML data
    and their mutual relations are presented in figure 2.                  has been provided. Users are given a possibility to define
       The application consists of several logical modules orga-           the arbitrary membership functions, and their computation
    nized according to the MVVM (Model View View-Model)                    is achieved in real time with the usage of the MATLAB
    pattern and its principles.                                            software. The practical side of this implementation and its
       The Data layer is the lowest level, dealing with the data           satisfactory performance has been demonstrated.
    storage. The storage options are: text files (file system                 The presented application solution will be a basis for fur-
    component) and database (database component). Microsoft                ther development of XML indefiniteness. In future work,
    SQL server 2008 R2 support was implemented in order to                 definition and implementation of the fuzzy XQuery inter-
    work with the database. Its potential for working with XML             preter that allows the usage of priorities is planned. Also,
    is extended by fuzzy elements.                                         the emphasis of future work is on improving the imple-
       The Model layer contains several components, where each             mented functionalities and the syntax, further improvement
    has a task to communicate with certain object types. The               of the performance and finally, introduction of indefiniteness
    XML model supports working with fuzzy XML objects, while               in the XML structure.


                                                                      60
                                                                   [7] Z.M. Ma, J. Liu, and L. Yan. Fuzzy data modeling and
                                                                       algebraic operations in XML. Int. J. Intell, Syst.
                                                                       25(9):925–947, September 2010.
                                                                   [8] E.J.F. Thomson, and G.Radhamani. Fuzzy logic based
                                                                       XQuery operations for native XML database systems.
                                                                       Int. J. Database Theor. App. 2(3):13–20, September
                                                                       2009.
                                                                   [9] A. Lo, K. Kianmehr, M. Kaya, and R. Alhajj. Wrapping
                                                                       VRXQuery with self-Adaptive fuzzy capabilities, in:
                                                                       Web Intelligence, IEEE/WIC/ACM Inter. Conf.
                                                                       Fremont, CA, pages 750–756. November 2007.
                                                                   [10] B. Oliboni, and G. Pozzani. Representing Fuzzy
                                                                       information by using XML schema, in: Database and
                                                                       Expert Systems Application. DEXA Proc. 19th Inter.
                                                                       Conf. Database Expert Syst. App., Turin, Italy, pages
                                                                       683–687. September 2008.
                                                                   [11] W. Hailong, Z.M. Ma, Y. Li, and C. Jingwei. A unified
                                                                       formalism for fuzzy data types representation, in:
                                                                       FSKD ’08. Fifth Inter. Conf., Shandong, China, pages
                                                                       167–171. October 2008.
                                                                   [12] H. Enrique, P. Eduardo, J.M. Jose, A. Sergio, and A.
                                                                       Karina. A fuzzy linguistic model to evaluate the quality
                                                                       of Web sites that store XML documents. Int. J.
                                                                       Approx. Reason. 46(1):226–253, January 2007.
                                                                   [13] T. Chris, K. Wafa, and V. Toan. Universal fuzzy
                                                                       system representation with XML. Comp. Stand. Inter.
                                                                       28(2):218–230, December 2005.
                                                                   [14] C. Combi, B. Oliboni, and R. Rossato. Evaluating
                                                                       fuzzy association rules on XML documents, in:
 Figure 2: Application component block diagram.                        Computational Intelligence, Theory and Applications,
                                                                       Advances in Soft Computing 33, Springer, Heidelberg,
                                                                       pages 435–448. 2005.
6.   ACKNOWLEDGMENT                                                [15] E. Damiani, B. Oliboni, and L. Tanca. Fuzzy
  Research was partially supported by the Ministry of Sci-             techiques for XML data smushing, in: Proc. Inter.
ence and Technological Development of Republic of Serbia,              Conf. 7th Fuzzy Days Computational Intell., Theor.
through project no. OI-174023 ’Intelligent techniques and              App., Dortmund, Germany, pages 637–652. 2001.
their integration into wide-spectrum decision support’.            [16] E. Damiani, L. Tanca, and F.A. Fontana. Fuzzy XML
                                                                       queries via context-based choice of aggregations.
7.   REFERENCES                                                        Kybernetika. 36(6):635–655, 2000.
[1] S. Škrbić, M. Racković, and A. Takači. The PFSQL           [17] J. Seto, S. Clement, D. Duong, K. Kianmehr, and R.
    query execution process. Novi Sad J. Math,                         Alhajj. Fuzzy query model for XML documents. Lect.
    41(2):161–179, 2011.                                               Notes Comput. Sc. 5788, pages 333–340. 2009.
[2] A. Takači, and S. Škrbić. Data Model of FRDB with           [18] J. Ying, and S. Shidlagatta. A framework of fuzzy
    different data types and PFSQL, in: J. Galindo (Ed.).              triggers for XML database systems, in: Proc. Inform.
    Handbook of research on fuzzy information processing               Reuse Integrat. IEEE International Conference, Las
    in databases, Information Science Reference, Hershey,              Vegas, USA, pages 296–299. August 2009.
    PA, pages 407–434. 2008.                                       [19] A. Chan, N. Situ, K. Wong, K. Kianmehr, and R.
[3] S. Škrbić, M. Racković, and A. Takači. Towards the             Alhajj. Fuzzy querying of nested XML, in: Proc.
    methodology for development of fuzzy relational                    Inform. Reuse Integrat. IEEE Inter. Conf. Las Vegas,
    database applications. Comput. Sci. Inf. Syst.                     USA, pages 238–243. July 2008.
    8(1):27–40, January 2011.                                      [20] R.D. Rodrigues, A.J.O. Cruz, and R.T. Cavalcante. A
[4] A. Campi, E. Damiani, S. Guinea, S. Marrara, G. Pasi,              proposal for a fuzzy database architecture incorporating
    and P. Spoletini. A fuzzy extension for the XPath                  XML. Fuzzy Set. Syst. 160(2):269–279, January 2009.
    query language, J. Intell. Inf. Syst. 33:285–305,              [21] G. Abhishek, and A. Reda. Incorporating fuzziness in
    December 2009.                                                     XML and mapping fuzzy relational data into fuzzy
[5] E. Damiani, S. Marrara, and G. Pasi. FuzzyXPath:                   XML, in: Proc. ACM Symp. Appl. Comput. New York,
    Using fuzzy logic an IR features to approximately query            USA, pages 456–460. 2006.
    XML documents, in: Proc. 12th Int. Fuzzy Syst.                 [22] C.D. Barranco, J.R. Campaña, J.M. Medina, Towards
    Assoc., Cancun, Mexico, pages 199–208. 2007.                       a XML fuzzy structured query language, in: Proc.
[6] L. Yan, Z.M. Ma, and J. Liu. Fuzzy data modeling                   EUSFLAT Conf., Barcelona, Spain, pages 1188–1193.
    based on XML schema, in: Proc. ACM Symp. Appl.                     2005.
    Comput. New York, USA, pages 1563–1567. 2009.


                                                              61
[23] Z.M. Ma. Fuzzy database modeling with XML.
    Springer, New York, February 2005.
[24] Z.M. Ma, L. Yan, and F. Zhang. Modeling fuzzy
    information in UML class diagrams and object-oriented
    database models. Fuzzy Set. Syst. 186(1):26–46,
    January 2012.
[25] M. Koyuncu. Intelligent fuzzy queries for multimedia
    databases. Int. J. Intell. Syst. 26(10):930–951, Jul 2011.




                                                                 62