REPRESENTATION OF COMPLEX OBJECT AND PROCESS STRUCTURES IN GRAPH DATA BASE ON THE EXAMPLE OF AGRICULTURAL TRACTOR

The paper presents an application of Graph Data Base technology in knowledge engineering task concerned with knowledge representation of complex structures. The first example is graph representation of a composition of tractor gearbox. It is an example of application of static partonomy relation. The adequate codding of that relation in Graph Data Base is easily expressed in Cypher language. There were presented some applications of Graph Data Base useful in the management of the technical object existence in different “life” phases, as design, production, maintenance and recycling. The second example concerns the Graph representation of activity structure. Such structures were built based on an agricultural tractor’s technical revision system. Created Data Base allows for processing the queries referred to the questions of what activities in what period should be performed to maintain the agricultural tractor ready to work in good technical condition. The Graph Data Base technology is the first step to create semantic systems for data storing and processing in order to extract knowledge and information useful in precise physical process management.


Introduction
The structure of complex facilities is defined by the term BOM (Bill of Material) [2].The precise specification of a technical object structure is used in all stages of its existence -from construction through production, operation and maintenance phases to recycling.Data describing the structure is an important element of the material flow logistics.There are many approaches for analytical representation BOM structures [7].Representation of structure in classical, relational databases is not very effective, because the number 1 Transport and Computer Science, University of Economics and Innovation in Lublin, Projektowa 4,Lublin,Polska, of parts of a complex object can reach thousands as well as the number of relations between them.Apart from the labour-intensive nature of implementing such a database, it is difficult to update it.Each extension or reduction of the number of elements requires changes in the entire database.The most important advantage of the graph databases is the reduction of search and upgrade operations to the detection and evaluation of paths in the graph [6,11].
In addition, the semantics of structural relationships represented explicitly by graph arcs enables data-driven machine learning and algorithmic inference.

Complex object BOM representation in graph databases GDB
Theoretical basis of graph databases is the theory of graphs, [1,16,18].The graph is a mathematical entity (abstraction) defined as a pair of sets (N, A), where N is a set of nodes and A is a set of relationships between nodes.Mathematical definition of the graph has a well-defined semantics and in terms of logic it corresponds to the predicate's logic.This makes graph language an expressive system of knowledge representation about complex structure objects and processes.
Graph nodes represent objects of the physical world and relationships determine how they constitute a complex system.These relationships may be expressed with predicates such as is_a, has_a and their extensions.This allows to represent symbolically the knowledge of what exists in the subject domain, and what properties it has.Extensions to these relationships, such as part_of and cause/effect_of are used in various logic inference schemes (induction, deduction, abduction) to describe and reason about an object's structure and processes.Specified relations are important in problems of ontological [9] knowledge representation, particularly that involves meronimic approach [13,14].From the pragmatic point of view, the language of graphs makes it possible to construct symbolic, highly modular and recursive representation of knowledge.
In a particular case, the nodes of the graph represent components (parts) of a complex object.A node may have multiple labels that are used to group nodes into sets.Labels are indexed to accelerate finding nodes in the graph.Nodes can have one or more properties (attributes) stored as key/value pairs).Nodes are connected to other nodes via relationships.Relationships are directional, connect two nodes and can have one or more properties (i.e., attributes stored as key/value pairs).Properties are named values where the name (or key) is a string.Properties can be indexed, and constrained, composite indexes can be created from multiple properties, [25].
Properties determine the role of nodes and, in the case of relationships, specify the flow between nodes.The term "flow" is a good metaphor when a process view of complex structures is needed.
In BOM structure, relationships represent predicate part_of or has_a_part.In a simple case, the graph representing the complex object is a Tree, but when a higher-order structural levels have common downstream components, it becomes a Network.
Technology of graph databases can be applied not only to the semantic representation of the complex objects structure but also to the structure of processes.Particularly useful is a representation of complex processes comprising all phases of a technical object existence [2].Technical object existence starts from its conceptualization phase, through design, production, operation and maintenance to recycling.The GDB can be used to record the facts that occur in the process.That register of events is required by standards for tracing and tracking operation, maintenance and repair services [4], emission processes [3], the state of road infrastructure [15], measurements of Loyalty [8], documentation and modelling of all transport's risks [10].Graph representation of process participants and relationships between them provides not only factual data but also meta data needed to extract from data their semantic content.
BOM as an example of GDB application can be generalized to BOP (Bill Of Process).Then, for example, the graph nodes represent activities/ operations that create different levels of process description and each node can be described with any number of properties, e.g. the purpose of an action, resources needed to perform it, criteria for correctness of its execution, etc. Relationships may be temporal interdependencies, necessary to organize and track the process over time.Each operation then has a specific start time, duration, end time, determined with accuracy to the probability distribution.Due to temporal relations, we know the temporal structure of operations in and the possibility of replacing one operation with several others, e.g. the operation of the whole assembly replacement is substituted by the exchange of specific parts, which may result with different cost and time.

GDB Design with NEO4J
A convenient tool for building graph database is Neo4J, [5,12,17,21,22,26].In this system, all operations on the GDB from creation through searching and updating are performed using queries coded in the CYPHER language, [24].
The correct sentence in that graphs language has a form: (node)-[relationship]->(node).
We use the word sentence here, because this structure is exactly the sentence structure: (subject) -[predicate] -(object), used in many natural languages.The graph is the equivalent of sentences in which relations represent predicates of sentences and the nodes of the graph are predicate arguments.In order to put a graph segment: (node) -[relation] -> (node) in the database, it should be preceded by the word CREATE or MERGE.We suggest using the MERGE command, because it does not duplicate the sentences previously introduced in contrast to CREATE.The definition of a node has the following scheme: (variable: label {property1, property2,..., propertyN }) where property is a couple {Variable: value}.The value of a variable can be a number or a string, and must be enclosed in quotation marks, for example {Color: 'red'}.A record of a relationship has a similar pattern: [:relationship_name {property1, property2,..., propertyN }] where properties, as of nodes, they are pairs of {Variable: value} eg.{Distance: '10 km', Flow: '100 car/hour '}.The sentence in the CYPHER language takes the form: MERGE (variable1: label1 {List of node1 properties) MERGE (variable2: label2 {List of node2 properties}) MERGE [:relationship_name { List of relationship propeties}]; CYPHER language is so expressive as SQL.Specification of CYPHER language is shown in [23,14].

Example of building GDB
As an example, the BOM of the URSUS 3514, models 102, 304, 315 the unit gearbox was selected.The data from the spare parts catalogue [20] were used.The gearboxes in each model differ from each other and for that we construct a graph whose input node is represented by the 3514 tractor and three of its models: 102, 304 and 315.The query Q1 (described precisely in supplement to the paper) creates the subsequent structural levels of the tractor URSUS 3514, produced in three models: 102, 304, 315 built from hundreds components and parts, from which only gearbox will be the subject of next consideration created in query Q2 (see in supplement).
Query Q3 displays graphically (Fig. 1.) the result of queries Q1 and Q2.Thanks to Neo4J interactives of each graph it is possible to see immediately all properties of the clicked node or relations in between.
Each gearbox consists of many parts, most of them are common in all models of tractors.Some parts appear repeatedly in each model.Cypher query Q4 (see in supplement) adds to GDB parts of gearbox model 102 and corresponding graph as a result of query Q5 (see in supplement) is shown in Fig. 2.  Graph in Fig. 3. is too big to display readable names of gearbox parts and components.
When the graph is displayed on the screen in Neo4J, then after clicking on chosen node, thanks to graph reactiveness, all descriptions of each node like node name and other properties can be found out.Such possibility is shown in Fig. 4., It is possible to create more questions if we enter additional attributes (properties) to the nodes and relations; for example: parts price, parts weight, material that the part is made of, spare parts producer's name, climatic condition in which the parts are properly working, substitute of given parts, the year of tractor's or parts production; then the questions could be: 1. What is the material's price of gearbox assembled to given model or price of chosen components and parts (it is an important topic for logistic specialists who are working on price optimization of final product)?2. What is the weight of a given model's gearbox or its components?3. What type of materials are implemented in the gearbox of given model (important question in recycling activity)?4. What is the name of the certain spare part's producer? 5. Does the pointed part suitable to work in tropic climate condition (important topic for the designers, technologist and foreign traders planning the export of final product to different destinations all over the world)?6.What substitutes of original parts are allowed to use in certain circumstances of a tractor working (this question can concern the foreign markets)?7. What spare part is suitable to be installed in the gearbox of the tractor's model made in certain years?
Expanding BOM approach to the whole tractor, the questions presented above will relate to all components, subcomponents, parts and operating liquids.
In analogy to the construction of the graph that represents a BOM, it is possible to create graphical representations of Processes.This is illustrated on the example of technical inspections of the Ursus MF255 tractor, according to data specifying in the repair instructions [19].According to this manual, there are 5 types of technical revisions P-1 ... P-5.
Technical revision includes 8 inspection objects (engine, fuel system and air filter, ..., cabin) and in each of them there are 3 to 6 activities such as check and fill, clean, replace (Table 1.).Graph database representing technical revisions was created as well in Neo4j system.Some example queries Q7, Q8, Q9 (description see in supplement) are shown below.
Resulting answer drawings are self-explanatory.The relation in Fig. 6 represent actions of technical revisions operations listed in Table 1.For example: relation 49 means "check the oil level in engine's oil sump and fill it up if necessary".That information is available due to the graph interactive or a query.
The same explanation is valid also to the relations represented on Fig. 7., on which the index points the actions from Table 1.Designed GDB can be used for documentation (tracing) revision's history of tractors and then tracking it with appropriate queries.It seems that tracing and tracking process is very important application of GDB

Summary
The semantic character of GDB allows to formulate questions regarding internal regularities inherent in specific structures of complex objects.Detection of such regularities using machine learning and inference algorithms provides knowledge enabling effective evolution of existing structures.Having GDB of the entire evolutionary sequence of objects connected to the functional structure, it would be possible to automatically generate future design solutions depending on external scenarios considering the anticipated changes, for example the type of energy sources and operational infrastructure.
Another application of GDB is the possibility of constructive technological development of assemblies and subassemblies of a complex object, considering technical and technological progress based, for example, on replacing the force interaction between elements of the structure with the information effect in order to achieve the desired functionality with a lower energy and cost.
Graph databases can be used in many industries, improving the work of designers, technologists, logisticians, service staff, traders or marketing specialists.Once established and systematically updated, GDB would collect not only the construction and operation data, but also their change in time."CABIN" "check and fill up the window spray liquid" "CABIN" "check and tighten the cabin fastening screws" "CABIN" "clean the cabin filter" "CLUTCH and BRAKES" "check the brakes and adjust" "CLUTCH and BRAKES" "check the clutch pedal idle and adjust" "CLUTCH and BRAKES" "check the work of pneumatic installation and brake valves" "COOLING SYSTEM" "check the cooling liquid level in radiator and fill it up" "COOLING SYSTEM" "clean the radiator ribs" "COOLING SYSTEM" "drain, clean and fill up the cooling system" "ELECTRIC SYSTEM" "check the alternator" "ELECTRIC SYSTEM" "check the electrolyte level in battery and fill it up with distilled water" "ELECTRIC SYSTEM" "check the fan's belt tension and adjust properly" "ELECTRIC SYSTEM" "clean the upper battery surface and grease the clamps with technical Vaseline" "ENGINE" "change the engine oil" "ENGINE" "change the oil in oil sump" "ENGINE" "check and adjust the clearance of engine valves" "ENGINE" "check the oil level in engine's oil sump and fill it up if necessary" "ENGINE" "clean the engine ventilation host" "FUEL SYSTEM and AIR FILTER" "change the cartridge of fuel filter" "FUEL SYSTEM and AIR FILTER" "check the condition of glass fuel filter settler and drain the water" "FUEL SYSTEM and AIR FILTER" "check the liquid level in settler and oil level in air filter" "FUEL SYSTEM and AIR FILTER" "clean the cartridge and change the oil in wet air filter" "FUEL SYSTEM and AIR FILTER" "drain and clean the fuel tank" "FUEL SYSTEM and AIR FILTER" "verify the condition of injectors" "POWERTRAIN SYSTEM AND HYDRAULIC SYSTEM" "change the oil in powertrain system and planetary gears" "POWERTRAIN SYSTEM AND HYDRAULIC SYSTEM" "check and adjust the differential lock pedal" "POWERTRAIN SYSTEM AND HYDRAULIC SYSTEM" "check oil level in gearbox and fill it up" "POWERTRAIN SYSTEM AND HYDRAULIC SYSTEM" "check the oil level in powertrain system" "POWERTRAIN SYSTEM AND HYDRAULIC SYSTEM" "clean the transmission oil filter" "STEERING SYSTEM" "check the bearing pressure of the front wheel hubs and adjust" "STEERING SYSTEM" "check the geometry of the front wheels and adjust" e.Name p.ID c.Name "POWERTRAIN SYSTEM AND HYDRAULIC SYSTEM" "P-2" "check oil level in gearbox and fill it up" "FUEL SYSTEM and AIR FILTER" "P-2" "check the condition of glass fuel filter settler and drain the water" "FUEL SYSTEM and AIR FILTER" "P-2" "check the liquid level in settler and oil level in air filter" "ELECTRIC SYSTEM" "P-2" "check the electrolyte level in battery and fill it up with distilled water" "ELECTRIC SYSTEM" "P-2" "check the fan's belt tension and adjust properly" "COOLING SYSTEM" "P-2" "check the cooling liquid level in radiator and fill it up" "CLUTCH and BRAKES" "P-2" "check the clutch pedal idle and adjust" "ENGINE" "P-2" "check the oil level in engine's oil sump and fill it up if necessary" "CABIN" "P-2" "check and fill up the window spray liquid" "CABIN" "P-2" "clean the cabin filter"

Fig. 1 .
Fig. 1.Result of query Q3 (displaced as a screen-print from Noe4J, showing graph interactives, red colour represents note of URSUS tractor 3514, green colour -models of tractor, pink colour -three types of gearbox, blue colour represents relation has a part and red colour has a model; properties of the clicked note 7007 977 M91 is listed as: subassembly <id> Symbol: 7007 977 M91 name: Eight speed gearbox).

Fig. 2 .
Fig. 2. Graph of gearbox parts, model 102 as a result of query Q5

Fig. 4 .
Fig. 4. Graph representing additional explanation of Fig. 3., (by clicking the node with running number 115, the identification code: 1869 712 M91(from BOM) is appeared as well as the part name: PTO clutch shaft).

Table 1 .
Technical Revisions of Ursus MF255