query.agenda.rq Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of corese-core Show documentation
Show all versions of corese-core Show documentation
Corese is a Semantic Web Factory (triple store and SPARQL endpoint) implementing RDF, RDFS, SPARQL 1.1
Query and Update.
#
# Generate the calendar of the year
# Olivier Corby - Wimmics, Inria, I3S - 2015
#
prefix cal:
template {
"\n" cal:month(?m) "\n"
"Mo Tu We Th Fr Sa Su \n"
group {
if (?n = 1, us:space(cal:num(?day) - 1), "")
if (?n < 10, " ", "") ?n " "
if (?day = "Sunday", "\n", "")
; separator = ""
}
; separator = "\n"
}
where {
bind (unnest(xt:iota(12)) as ?m)
bind (unnest(xt:iota(cal:days(?y, ?m))) as ?n)
bind (xsd:date(concat(?y, "-", ?m, "-", ?n)) as ?date)
bind (xt:day(?date) as ?day)
}
group by ?m
order by ?m
values ?y { 2015 }
function us:space(?n) {
if (?n = 0, "", concat(" " , us:space(?n - 1)))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy