Experimental Explain Plan

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (13)

View Page History
h1. Wine queries

All of the following examples refer to our simple wine dataset (``wine.ttl``). ({{wine.ttl}}). The file is quite small, but here is some basic explanation about the data:

- There are different types of wine (Red, White, Rose).


.. _explain-plan-first-query-with-aggregation:
h2. First query with aggregation

First query with aggregation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A typical aggregation query contains a group with some aggregation function. Here, we have added an {{experimental-explain}} graph:

A typical aggregation query contains a group with some aggregation function. Here, we have added an ``explain`` graph:
{noformat}
.. code-block:: sparql
# Retrieve the number of wines produced in each year along with the year
PREFIX onto: <http://www.ontotext.com/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX : <http://www.ontotext.com/example/wine#>
SELECT (count(?wine) as ?wines) ?year
from onto:explain
WHERE {
?wine rdf:type :Wine .
optional {
?wine :hasYear ?year
# Retrieve the number of wines produced in each year along with the year
PREFIX onto: <http://www.ontotext.com/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX : <http://www.ontotext.com/example/wine#>
SELECT (count(?wine) as ?wines) ?year
from onto:explain
WHERE {
?wine rdf:type :Wine .
optional { ?wine :hasYear ?year }
}
group by ?year
ORDER BY DESC(?wines)
}
group by ?year
ORDER BY DESC(?wines)
{noformat}

When you execute the query on GraphDB, you get the following as an output (instead of the real results):