w3c / sparql-dev

SPARQL dev Community Group
https://w3c.github.io/sparql-dev/
Other
121 stars 19 forks source link

how to visualize SPARQL queries and execution plans #203

Open VladimirAlexiev opened 2 days ago

VladimirAlexiev commented 2 days ago

(This merely promotes a good practice and asks for more ideas)

@JervenBolleman makes some amazing SPARQL visualizations. See eg https://sib-swiss.github.io/sparql-examples/examples/dbgi/001.html . This is a rather complex query, and the diagram really helps to understand it and debug it (eg you'd see immediately if some var is misspelled): image

The diagram is SVG and is made with:

Questions:


A related need is to visualize execution PLANS.

VladimirAlexiev commented 2 days ago

@afs @kasei @lisp These diagrams are so very different from SPARQL Algebra trees... But they are great to see the connectivity of graph patterns in the query, so very useful while writing the query. Can you give your wisdom on this topic?

JervenBolleman commented 2 days ago

To visualize execution plans we first need a standard to describe a query plan. This would be good to do to share development resources.

kasei commented 1 day ago

I think these are really useful to quickly visualize query patterns (as are algebra visualizations – they just visualize different things).

Regarding query plans, I've used mermaid to play around with visualizing query plans coming out of Neptune in the past, with some success. I think the challenge is that query plans from different systems can look very different (not just different operators, but also structurally different), so may be difficult to visualize in a common way while supporting plans from disparate systems.

VladimirAlexiev commented 1 day ago

@kasei

kasei commented 18 hours ago

@VladimirAlexiev –

It sounds like you want more than the algebraic structure so that it also shows variable co-occurrence? I don't have anything like that, and think that might be more confusing than useful (?).

Here's part of a Neptune explain visualized using mermaid (this happens to be an OpenCypher query, but the explain format is basically the same for SPARQL). This is a very generic data flow diagram with operators as nodes, with no real specialization for specific operators:

neptune-explain-mermaid

lisp commented 14 hours ago

an authenticated user has these available from the html result page. some agreement on a schema would be valuable. beyond the sse and algebra views, which rely on jena conventions and the sparql recommendation, respectively, the other renderings are rather literal externalizations of internal processor state. the d3-based rendering uses observable,hq's json-based graphics library.