Category variable name
month
Chart type
LineChart
Query
Sales by month
Series variable name
revenue
Title
Monthly sales trend
Category variable name
country
Chart type
BarChart
Query
Revenue by country
Series variable name
revenue
Title
Revenue by country

Revenue by country

Text
PREFIX schema: <https://schema.org/>

SELECT ?country (SUM(?sale) AS ?revenue)
WHERE {
    GRAPH ?orderGraph {
        ?order schema:orderedItem ?orderItem ;
               schema:orderDelivery ?delivery .
        ?orderItem schema:orderQuantity ?quantity ;
                   schema:price ?price .
        ?delivery schema:deliveryAddress ?address .
        ?address schema:addressCountry ?country .
        BIND(?quantity * ?price AS ?sale)
    }
}
GROUP BY ?country
ORDER BY DESC(?revenue)
LIMIT 10
Title
Revenue by country

Sales by month

Text
PREFIX schema: <https://schema.org/>

SELECT ?month (SUM(?sale) AS ?revenue)
WHERE {
    GRAPH ?orderGraph {
        ?order a schema:Order ;
               schema:orderDate ?orderDate ;
               schema:orderedItem ?orderItem .
        ?orderItem schema:orderQuantity ?quantity ;
                   schema:price ?price .
        BIND(?quantity * ?price AS ?sale)
        BIND(SUBSTR(STR(?orderDate), 1, 7) AS ?month)
    }
}
GROUP BY ?month
ORDER BY ?month
Title
Sales by month