Format SPARQL Query Results into HTML Report

SPARQL is one of the powerful query language for querying semantic data. It is recognized by the W3C as a query language for RDF. As an efficient query language for RDF, it has defined several query result formats such as CSV, TSV and XML etc. These formats are not attractive, understandable and readable. The results need to be converted in an appropriate format so that user can easily understand. The above formats require additional transformations or tool support to represent the query result in user readable format. The main aim of this paper is to propose a method to build HTML report dynamically for SPARQL query results. This enables SPARQL query result display, in HTML report format easily, in an attractive understandable format without the support of any additional or external tools or transformation.


I. INTRODUCTION
The goal of semantic web [1] is to extend the current web standards and technology so that machine understands the web content.The knowledge representation technology used in the semantic web is ontology.An ontology is a common, shared and formal description of important concepts in specific domain [2].Researchers have developed several ontology languages such as RDF, RDFS, and OWL etc.There are several query languages based on the ontology data format [3].For example XPath and XQuery query languages for XML format, RDQL [4] and SPARQL [5] for RDF format and OWL-QL for OWL format of ontologies.Among the ontology query languages, SPARQL is one of the most efficient query languages for the Semantic Web [6] and it is recommend by W3C.
The SPARQL query language for RDF has several query result forms such as CSV, TSV [7] and XML etc.These formats are not clear to the user to realize and analyze query results.There is a need to represent SPARQL query result in an attractive format so that user can easily understand the SPARQL query results.The above SPARQL query result formats require additional conversions or tool support to represent query results in user readable format.This paper proposed a method to represent SPARQL query results in more attractive and user graspable format.
The rest of the paper is organized as follows.Section II describes survey on SPARQL query result formats.Section III defines the problem statement and over view of the proposed system architecture.Section IV describes the implementation details of the proposed system.Section V shows results of the proposed method.Finally section VI concludes.

II. RELATED RESEARCH WORK
Most RDF stores use one of the common RDF query languages like RDQL [4] or SPARQL [5].Among them SPARQL is efficient query language for semantic web and it has W3C recommendation.Basically the SPARQL language for RDF defines several query result forms such as CSV, TSV [7], and XML etc.The SPARQL binds the variables of query results into XML notation.The conversion process of SPARQL query results into XML format is described by RDF data access working group (DAWG).DAWG has described four implementations.Among them two implementations produce SPARQL result in XML format and other two implementations, consumes the query results that are in XML format.The producer implementations are Joseki [8] and AllegroGraph [9].The producer implementations produce SPARQL query results in XML format.The two consumers are python [10] and XSL Transform (XSLT).Python parses the format into an internal graph to check for correctness.XSLT consumes SPARQL query results XML format and generates an HTML document [11].SPARQL 1.1 query results CSV (comma separated values) and TSV (tab separated values) formats provide simple and easy to process formats for the transmission of tabular data.These formats are supported as input to many tools like spreadsheets.SPARQL 1.1 query results in JSON format [12] is designed to represent the query results in an array object.The results of a SELECT query are serilialized as an array, where each array element is one "row" of the query results.BIRT [13], an open source Eclipse-based reporting system that can be used to generate charts and other reports from input data.BIRT takes input from relational databases or spreadsheets.TopBraid Composer [14] integrates with BIRT to generate reports for SPARQL query results [15].TopBraid Composer's Maestro Edition provides an interface between any OWL/RDF data source and BIRT.
The SPARQL query result formats CSV, TSV, JSON and XML require additional transformations or tool support to represent query result in an appropriate format.BIRT is not developed specifically for SPARQL query results.To use BIRT SPARQL query result needs to be converted into any BIRT specific input format.Our approach enables the user to build HTML document dynamically for variable binding SPARQL query results and browse the constructed HTML document automatically to view the report.www.ijacsa.thesai.orgFrom the literature study, the conclusion is that, there is no direct method to represent SPARQL query result in user understandable format.All the existing formats require additional conversions or tool support to represent query results in user understandable format.The problem is to design and implement a method to represent results of a SPARQL SELECT query that is executed on semantic data which is stored in the oracle database 11g semantic store using Jena adapter [16].
The method should enable the user to build HTML document dynamically for variable binding SPARQL query results and browse the constructed HTML document automatically to view the query result.
The architecture describes generation of HTML page for variable binding SPARQL query results.Fig1 shows the system architecture.The user interface allows user to write SPARQL SELECT query.The query is executed on semantic data stored in the oracle database using the oracle Jena adapter.The HTML file construction section lists the variables involved in the query and extracts the variable binding values.A HTML Document is constructed with the variables and query results.Finally the constructed HTML document is displayed to view the report using any web browser like internet explorer, etc. www.ijacsa.thesai.orgFig. 3.
Execution process of SPARQL query and construction of HTML IV.IMPLEMENTATION The proposed architecture is implemented using Java NetBeans IDE and Jena API.A simple user interface is designed for writing SPARQL query using Java NetBeans IDE.Fig2 shows the interface for writing SPARQL query.Implementation of the proposed method has two phases.First phase consist query execution process using the Oracle Jena adapter and the second phase describes generation of HTML document for SPARQL query results.The entire process is described in fig3

Phase2: HTML document construction for SPARQL query results
Constructing HTML document from the variable binding SPARQL query result has the following steps.
To show the difference, a sample SPARQL SELECT query is taken to print all the principal investigators involved in various research projects.Fig6 shows output of the above SPARQL query using proposed method.The resulting format is effective understandable and readable.

VI. CONCLUSION
This paper presents a method to represent results of SPARQL query executed on semantic data stored in the oracle 11g database.This method uses the Oracle Jena adapter to execute SPARQL query.The proposed method is implemented using Java code and HTML elements to render the query results in presentable format.Compared to other approaches, this approach does not require intermediate www.ijacsa.thesai.orgtransformations to present query results in readable format and user need not to take much effort to view the result.The proposed method is examined with R&D project OWL ontology loaded in the oracle 11g database.As shown in the results, the proposed method constructs an HTML report dynamically for SPARQL query results and displays automatically using a web browser to view the result.

Fig. 4 .Fig. 5 .Fig. 6 .
Fig.4.Code to generate HTML document for SPARQL query result The query is executed and fig5 shows actual format of SPARQL query result.The format has unnecessary data and query results are combined with variables.It is not effective, difficult to read and understand.