• No results found

User information about processing of the calculation in applic-

In the moment of the correct/wrong processing of data or in the case of the pro- cessing of asynchronous long request, is the user informed by alert in the form of the colorful element dev, which is places in the beginning of the page. Because we send the data to the server via AJAX, and after the successful in-

2 http://parsleyjs.org/# 3 http://www.formvalidator.net/ 4 https://jqueryvalidation.org/

Figure 5.3: Information about successful operation of editing dataset

sertion, editing or deleting of data is necessary to refresh the page, information about processing of data we saving tolocal.storage, which is called immediately after running the script. After using this information (displaying to user), we remove it. Example of successfully processing form is shown in the figure 5.3. At big operations, as, for instance, processing the analysis or importing of dataset, the user is notified also in modal after the confirmation of the form.

5.4

Chart drawing

For chart drawing we decided to use library D3.js5

. It is the Javascript library oriented to data visualization by usage of language HTML, SVG and CSS. This library is available on Github and it containts large amount of examples, simple ones like column chart, donut chart, pie chart, etc., but also difficult profes- sional charts of the real data visualization in existed projects. It is enough to choose any chart and adjust it to concrete data and needed visualization.

Figure 5.4: Chart of dataset analysis

There is a large amount of Javas- cript or jQuery libraries for drawing nice and interactive charts, for in- stance Google Chart 6

or Charts.js

7

. Furthermore,in both of these lib- raries is build responsiveness which could be very useful. The main prob- lem was, that these libraries con- tains only simple charts, not suitable for our application, when ve wanted to use hierarchical pie chart. So, be-

5 https://d3js.org/ 6 https://developers.google.com/chart/ 7 http://www.chartjs.org/docs/

cause of this issues, we decided to use library d3.js, which that type of chart offers.

For visualization of dataset analysis, we decided to use hierarchical zoomed pie chart. It means that chart has two levels. The first level displaying pro- portion of domains in the particular dataset. If user click on some domain, there will be displayed the second level which represents proportion of entities in the chosen domain. In the beginning of chart is also displayed actual path, which shows the domain and the entity, on which user stay. Example of this hierarchical pie chart is displayed in the picture 5.4.

For visualization of domains and entities in pageDomain List, we decided to use simple pie chart, which displays proportion of domains in database on the base of entity count in each domain. For this chart we could use another simpler library, but we decided to honor the same design.

These charts are not responsive, so we has to make own responsibility by usage of Javascript function windows.width().

5.5

Export

We made the decision to add new unplanned functionality into functional re- quirements because of large volume of data our application works with. This new functionality is export of domains and mainly dataset analysis to the ex- ternal files. It makes data more readable and it is possible to use that for fur- ther processing.

We decided to implement functionality that user will be able to export dataset analysis and overview of domains and entities to Excel, CSV or also to RDF format, specifically N-Triples.

Every particular exported file is saved on the server with unique name with the help of java function File.createTempFile() which adds random number sequence to the end of filename. Files are deleted from the server after a certain time. We created new special objects containing export attributes in order to make data output easier. These objects are used for nothing but data export.

Export of domains contains list of domains, entity groups and entities. Furthermore, in the excel file there is pie chart based on exported data. In N- Triples format file are domains displayed in the same way as in the case of do- main import.

In case of export of the dataset analysis detail, there is detailed list of do- mains, entities, predicates and their representation in the particular dataset in CSV and Excel format. In Excel is also a pie chart with the domain representation on the first sheet. Exported file in format N-Triples do not contain predicates, it contains triples with domain and entity representation with the usage of the predicate void:triples.

Figure 5.5: Domains export to the Excel file

In the case of export to CSV file we used classic way of writing into the file with the help of class Writer and method writeLine which writes data line by line with the specified column separator. In the case of export to excel file we decided to useXSSFWorkbookjava library which provides possibility to cre- ate Workbook and particular Sheets and finally provides writing into concrete cells. Because of the using of this library we had to use also OPCPackage library and its methodopen()we used for opening already existing workbook stored on server. So we have two templates stored on the server – one tem- plate for domain export and one template for analysis export. In templates are defined titles, graphs, text formatting, etc. In the case of export to N-Triples format we used classic way of writing data into file with the help of class PrintWriter and method println(). Example of the exported file to Excel is shown in the picture 5.5.