Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to visualize SPARQL queries and execution plans #203

Open
VladimirAlexiev opened this issue Sep 26, 2024 · 7 comments
Open

how to visualize SPARQL queries and execution plans #203

VladimirAlexiev opened this issue Sep 26, 2024 · 7 comments

Comments

@VladimirAlexiev
Copy link
Contributor

VladimirAlexiev commented Sep 26, 2024

(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.

  • But there the order of execution (trying patterns) matters: how can this be shown?
  • Can the top-to-bottom ordering of patterns in a plan be shown as left-to-right ordering of some links?
@VladimirAlexiev
Copy link
Contributor Author

@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
Copy link
Collaborator

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
Copy link
Collaborator

kasei commented Sep 26, 2024

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
Copy link
Contributor Author

VladimirAlexiev commented Sep 27, 2024

@kasei

  • Can you show an algebra visualization? for me that should be something like a tree, but with lateral links connecting variable occurrences
  • Vendor differences aside: can you describe or show an example of a diagram like Jerven's, but showing the order of execution?

@kasei
Copy link
Collaborator

kasei commented Sep 27, 2024

@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
Copy link
Contributor

lisp commented Sep 28, 2024

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.

@JervenBolleman
Copy link
Collaborator

The qlever analytics tree is very nice too.
Screen Shot 2024-09-29 at 15 05 33

But for the moment these are all custom to each engine, because there is no current standard for sharing an execution plan. Which makes generic tooling to difficult to develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants