In SPARQL 1.1, there is a month () function ( http://www.w3.org/TR/sparql11-query/#func-month ) that extracts a month from ISO dates.
you can group by month using the GROUP BY keyword, for example:
SELECT ?mon SUM(?val) WHERE { ?x :date ?date ; :value ?val . } GROUP BY (month(?date) AS ?mon)
The only small problem is that for SPARQL systems you do not need to process xsd: date data types, just xsd: dateTime, but many of them will handle them correctly.
source share