The project goal was to develop a visual query system that will allow users to leverage their understanding of the data contained in the database while requiring minimal understanding of strcutured query languages. The basic goals of the project then are:
Figure 1: Overview of the web application
When a user select the “Load model” button as shown in the interface, the onClick() method of the button is called and brings up the choose file dialog, allowing a user to selected a JSON file. It should be noted that the assumption is that the user will choose a JSON file of the correct structure. Once the file is loaded, this triggers the loadModel(input) with the input JSON file being passed as an argument. The drawERGraph(graph, inputFile) is then also called and is used to draw the graph on the canvas.
Figure 2: Attribute selection
Once the model is loaded, the user can now begin to construct a query. Note, the user is informed that once loaded they will need to rearrange the elements of the model first and this may incur accidental presses however these can be undone. The top heading of the user interface has now updated to indicate to the user that they need to select attributes which they wish to query.
The querying process is split up into two parts:
(1) Select attributes to view
(2) Selecting the constraints on the results obtained
Figure 3: Clause selection and query string
Once the both processes are complete, we can actually begin checking whether the selected attributes and clauses form a valid SQLP query. The data extracted and passed to an encapsulation of a grammar which checks whether the given values can be used to form one of the supported queries. The output of this program is either a syntactically and logically correct SQLP Query or a detailed error message.
Figure 4: Final query
Once the both processes are complete, we can actually begin checking whether the selected attributes and clauses form a valid SQLP query. The data extracted and passed to an encapsulation of a grammar which checks whether the given values can be used to form one of the supported queries. The output of this program is either a syntactically and logically correct SQLP Query or a detailed error message.