# Outlier Recognition via Linguistic Aggregation of Graph Databases
## 4 Preprocessing Graph Databases to Use Linguistically Aggregated Information  
Now, we briefly explain how filtering graph database is done. The aim is to select/filter objects of given types (e.g., clients, transactions, transfers) and represent them as a one-dimensional set (e.g., sequence, collection, list). It is important to notice that objects in a resulting sequence need not to be counterparts of every single vertex of a given type, e.g., a resulting object is not necessarily related to one \"complaint\" vertex, but rather to a set of data combined from several vertices/edges/properties describing a particular fact, here: a complaint. Next, selected objects are inputs for the method of outlier detection via linguistically quantified statements (described in Section 3). We assume that graph database \(\mathcal{D}\) is represented by directed labeled graph \(G\) in which \(V\) (or \(V(G)\)) is the set of vertices of \(G\), \(E\) (or \(E(G)\)) is the set of edges of \(G\), and \(L\) (or \(L(G)\)) is the set of labels of \(G\). It is t is important that both vertices and edges can have labels assigned, so \(G\) can be _vertex-labeled_ or _edge-labeled_, respectively. In this case, \(L(G)\) can be divided into two subsets \(VL(G)\) (vertices' labels) and \(EL(G)\) (edges' labels). A label of a vertex determines its type, and a label of an edge determines relation between two vertices. Finally, \(P(V,E)\) is a set of properties that can be possessed by vertices or edges, e.g., amount of transfer, date of complaint, etc. (in fact, properties are counterparts of attributes in relational data models). The graph database of Customer Relationship Management (CRM) system taken into account in the experiment, handles complaints submitted by clients of a bank [20]. The vertices of graph \(G\) represent data on customers' complaints submitted to CRM. \(G\) is the both edge- and vertex-labeled graph consisting of 355,371 unique vertices, \(V(G)\), and 2,111,884 edges, \(E(G)\). The vertices represent granules of information on complaints and are labeled with \(VL(G)=\{\text{complaint, issue, product, subissue, ZIP code, response, company, submitted, tags}\}\). The edges represent relations between data stored in vertices of different labels (types), and are labeled with \(EL(G)=\{\text{with, about, via, to, against, in category}\}\). Additionally, we have the set of properties possessed by vertices in the base: \(P(V,E)=\{\text{day},\text{disputed},\text{id},\text{month},\text{name},\text{timely}, \text{year}\}\). The sample structure of graph \(G\) is illustrated in Figure 1.  
The keypoint of transforming selected nodes to a sequence is to construct and execute the query. Notice, it is not a simple serialization or graph searching, since objects in the resulting sequence may be described by properties of several different vertices and/or edges. The structure of a single object in the resulting sequence is determined by a specific query \(R\) in the general form of:  
\[R(VL_{R},EL_{R},P_{R}), \tag{22}\]  
where \(VL_{R}\subseteq VL(G)\) is the subset of vertices' labels, \(EL_{R}\subseteq EL(G)\) is the subset of edges' labels, and \(P_{R}\subseteq P(V,E)\) is the subset of vertices'/labels' properties.