Toward Automatic Generation of SPARQL result set Visualizations

25
8 th International Joint Conference on e-Business and Telecommunications Seville, Spain 18-21 July 2011 ICE-B 2011 - International Conference on e-Business Toward Automatic Generation of SPARQL Result Set Visualizations A Use Case in Service Monitoring Leida Marcello EBTIC (Etisalat BT Innovation Centre), Khalifa University - Abu Dhabi, U.A.E. http://www.ebtic.org [email protected]

Transcript of Toward Automatic Generation of SPARQL result set Visualizations

Page 1: Toward Automatic Generation of SPARQL result set Visualizations

8th International Joint Conference on e-Business and TelecommunicationsSeville, Spain

18-21 July 2011

ICE-B 2011 - International Conference on e-Business

Toward Automatic Generation of SPARQL Result Set Visualizations

A Use Case in Service Monitoring

Leida MarcelloEBTIC (Etisalat BT Innovation Centre),Khalifa University - Abu Dhabi, U.A.E.

http://[email protected]

Page 2: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Introduction• Semantic Web is

experiencing an interesting phase.

• The vision has finally shift from the definition of languages and tools supporting the vision, to a phase where data is made available from sparse sources.

• Leading to and led by projects such Linked Open Data.

Page 3: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Value for Enterprises?Potential of Semantic Web understood by the academic/reseach community but

difficulties to stream down the benefits to Enterprises.However Enterprises’ interest on Semantic Web technologies is growing:Use of Linked Data sets seems at the moment more appealing than the use of

Semantic Web technologies as support for AI (OWL, SWRL).Accessing virtually infinite source of information and link it with internal one.

Page 4: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Federated queries

Enabling interesting scenarios even without AI support:“Query WiMAX customer complains, together with related location and weather

situation of the day of the complain; this may lead to discovering that some devices do not perform well in some particular conditions.”

Page 5: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Need to display information in an efficient way:

• no need to understand the ontological model by the final user;• need to represent data as meaningful visualisations,

understandable by managers and business analysts; • allow dynamic exploration of internal data integrated with Linked

Data;• analyze possibilities offered by semantic information to enhance

and automate the data visualisation process.

Furthermore actual BI dashboards are generated by manually mapping queries with the visualization. Changing the query will require changes in the mapping time and resource consuming.

Creating Value

Page 6: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Ontology Visualization: the GraphTwo main approaches to the visualization of

ontological data:1. Visualization of the Graph:

• exploit the subject, predicate, object pattern to create network-like views of ontologies;

• first approaches to support research community.

Page 7: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Ontology Visualization: the GraphPros:Generic process that automatically suits all the ontologies.Graph and network visualization algorithms can be usedCons:Not interesting from a reporting point of view.

Page 8: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Ontology Visualization: query Results2. Visualisation of query results:

Page 9: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Convert SPARQLQuery results

Ontology Visualization : query ResultsQuery results mapped to the visualisation library through a process

defined manually;

Construct SPARQL Query

Identify RDF data

Page 10: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Ontology Visualization : query Results

Pros:Very expressive and effective views;Display only what is relevant;Easy to understand;No need to know anything about ontologies.Cons:Need of a specific process, defined manually, to translate query results to a format

that can be digested by the visualisation library;Imply knowledge of the data source to display;Visualization is created as result of a query, but it cannot be refined or lead

dynamically to other visualizations.

Page 11: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

From static to dynamic visualisationsFresnel (http://www.w3.org/2005/04/fresnel-info/) proposes a solution for

browsing ontologies:Lenses: what to display;Formats: how to display it.

Possible to define more than one format for each lens.Browsers apply the Fresnel document to the ontology in order to obtain the

CSS.Extremely Powerful!

Page 12: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Limits of available approaches• Oriented toward browsing ontologies and not on

displaying query results.• Fresnel allows selectors: but FSL and SPARQL used

within Fresnel must always return exactly one node set, meaning that only one variable is allowed in the SELECT clause. This reflects also to other approaches based on Fresnel (e.g. Pazienza et al. Semi-Automatic Generation of GUIs for RDF Browsing)

• SPARQL Web Pages form TopQuadrant (with the UISPIN Charts Extension) is the closest approach but still relies on declarative mapping between the query and the visualization library.

Page 13: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Missing StepConsider an ontology representing customers, products and orders and a SPARQL query that returns the revenue of the orders for every country a customer is located. The result of the query are values from attributes belonging to different concepts, not directly in relation.

PREFIX ebtic:<http://www.ebtic.org/OTMDemo#>SELECT ?country ?revenue WHERE { ?location ebtic:Country ?country.

?customer ebtic:location ?location. ?order ebtic:orderedBy ?customer. ?order ebtic:TotalPrice ?revenue.}

How do I display this?

Can I exploit semantic information to automatically display such information in the correct way? More information is required!!

Page 14: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Proposed Approach: overview of the system

• The user will generate a SPARQL query by interacting with the GUI or explicitly submitting it to the system.•The Query is executed by the SPARQL query engine and the result set is retrieved. •The query and its results set is analysed by the Semantic Binder and semantically annotated with information regarding the types involved in the Result Set.• A rule based inference process supported by external ontologies is used to select the set of most suitable charts that are able to visualize the query results.• The results set returned by the query is merged with the chart template in order to generate the final instance of the chart to display.

Page 15: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Proposed Approach: Labels OntologyThe proposed architecture

is supported by a set of ontologies that are used to model semantically the SPARQL query.

The Label ontology is used to annotate the query results set by modelling the semantic of every variable in the SPARQL query.

This is a basically a hierarchy of datatypes.

Page 16: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Proposed Approach: Chart OntologyThe Chart Ontology imports the Label Ontology.This ontology defines the concept of ResultSet and VisualizationMethod.Which are the basic concepts used to model the query and the method used to

visualize the results.The variables in the results set are instances of the Label Ontology.

Page 17: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

The Chart Ontology is at the core of the inference process.Here the various rules (SWRL) and equivalent concepts (defined using OWL-

DL) are defined.These rules and logic concepts are used in the inference process in order to

automatically infer the set of suitable visualization for a given result set.The concept of ResultSet is extended by equivalent concepts:

An inference process will re-classify the instances of the ResultsSet with the equivalent concepts. Once this is done the system will apply the rules:

Proposed Approach: Chart OntologyEquivalent Concepts and Rules definition

Labelelementsimeelements.TsultSetTemporalRe .2

)?,(?)(?)(? crithvisualizeWcTimeLinersultSetTemporalRe

ith(?r,?c)visualizeW(?e)Percentager,?e)elements(?c)PieChart(??r)ResultSet(

Page 18: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Proposed Approach: instances of VisualizationMethod

Instances of the ontologies are generated from two independent processes: one process that is defined offline and relate to prepare the system to be used with a specific Chart API and another one that is executed runtime once the queries are submitted to the system.

• The first of this processes will create the instances of the Chart Ontology. These are defined as instances of the sub concepts of VisualizationMethod concept with also specific attributes depending on the API used to create the Charts (e.g. Yahoo UI Charts, Google Visualization API,…).

• In case of our implementation we used Google Visualization API. Each instance of the specific VisualizatioMethod in this case will contain an attribute visualizationCode containing the template of the code used to create the JavaScript code to display the chart.

Page 19: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Proposed Approach: instances of ResultSet

Instances of the ResultSet concept are created by the Semantic Binder process. This process analyses the SPARQL query and the returned results set and creates instances of the ResultSet concept representing the query and instances of the Label concept representing the variables of the query.

• The binding between the variable and a concept in the Label ontology hierarchy can be done performed in may ways: by a manual process, an automatic or a semi-automatic process.

• In our implementation we analyse the results set using a set of techniques: e.g. regular expressions associated to a certain Label (e.g. Dates, Numbers) or lookup lists in case of fixed value sets (e.g. Country).

Page 20: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Proposed Approach: chart creation process

• The inference process will re-classify the instances of ResultSet and apply the rules in order to link instances of ResultSet and VisualizeMethod with the visualizeWith relation. It is important that the inferred information is made persistent in the Chart Ontology.

• The system will extract the suitable template code for the visualization methods, given a specific result set, by executing a SPARQL query on the Chart Ontology with instances:

PREFIX chart:<http://www.ebtic.org/bpm/visualizationOntology.owl#>PREFIX instance:<http://www.ebtic.org/bpm/serviceMonitoring.owl#>SELECT ?visualizationCodeWHERE { ?resultSet chart:visualizeWith ?visualizationMethod.

?visualizationMethod chart:visualizationCode ?visualizationCode.FILTER (?resultSet = instance:ResultSetQuery1)}

Page 21: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Proposed Approach: implementationOur approach is not bounded to any specific enabling technology:

• For proof of concept prototype in the domain of service monitoring we used Ruby.

• OWLIM is used to store and query the supporting ontologies (Label, Chart and Instances) together with the rules and OWL equivalent concepts.

• Since originally Service Monitoring data is in a relational database we used D2R to provide a SPARQL endpoint to the database.

Our system at the moment offer to the user a choice between two graphs which are each one mapped to a SPARQL query on the D2R server.

The Query is analised by our system supported by the OWLIM inference process and SPARQL engine used to extract the code template.

Code template is processed by Ruby and the results of the query on the D2R server are integrated with the template and the final HTML is returned to the user.

Page 22: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Use case: services monitoringPREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>PREFIX db:<http://localhost:2020/resource/>PREFIX owl:<http://www.w3.org/2002/07/owl#>PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>PREFIX map:<file:/D:/d2r-server-0.7/mapping.n3#>PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX vocab:<http://localhost:2020/vocab/resource/>SELECT ?serviceEndPoint ?messageType(COUNT(?messageType) AS ?countMessageType)WHERE {?monitor vocab:result_serviceEndpoint ?serviceEndPoint.?monitor vocab:result_messageType ?messageType.}GROUP BY ?serviceEndPoint ?messageTypeORDER BY ?serviceEndPoint ?messageType

Page 23: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Use case: services monitoringPREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>PREFIX db:<http://localhost:2020/resource/>PREFIX owl:<http://www.w3.org/2002/07/owl#>PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>PREFIX map:<file:/D:/d2r-server-0.7/ServMonMapping.n3#>PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX vocab:<http://localhost:2020/vocab/resource/>SELECT ?serviceEndPoint ?avgeResponseTime ?timestampWHERE {?monitor vocab:result_timestamp ?timestamp.?monitor vocab:result_serviceEndpoint ?serviceEndPoint.?monitor vocab:result_averageResponseTime ?avgeResponseTime.}ORDER BY ?serviceEndPoint ?timestamp ?avgeResponseTime

Page 24: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Conclusions & Future Work

We presented a promising approach for the automatic generation of charts from SPARQL queries.

System exploits inference processes to generate appropriate charts.

Major benefit is the automatic on-the-fly generation of charts.

Future work will consider extending the proof of concept implementation presented in this paper to a generic framework.

Capture user interaction with the chart in order to automatically generate new SPARQL queries that will consequently lead to new views of the data; interesting in the case where the data to analyze can be linked to an external data such as Linked Data Project.

Our approach is particularly relevant in with Linked Data, where the queries that can be submitted can not be predicted at design time because of the high dimensionality and the highly connected nature of the data. This, in turn, may lead to the visualization of data that initially was not considered, which is a situation that current BI systems can not handle.

Page 25: Toward Automatic Generation of SPARQL result set Visualizations

18-21 July 2011, ICETE ’11 – ICE-B 2011 Leida Marcello, Toward Automatic Generation of SPARQL Result Set Visualizations.

Thank you for your attention!