All Downloads are FREE. Search and download functionalities are using the official Maven repository.

query.numday.rq Maven / Gradle / Ivy

Go to download

Corese is a Semantic Web Factory (triple store and SPARQL endpoint) implementing RDF, RDFS, SPARQL 1.1 Query and Update, Shacl. STTL. LDScript.

The newest version!
prefix cal: 
select *  where {

bind (xt:firstOfMonth(?y, ?m, ?d) as ?ans)


function xt:firstOfMonth(?y, ?m, ?d) {
    let (
        ?first = cal:date(?y, ?m, 1),
        ?day = xt:day(?first),
        ?fst = cal:num(?day),
        ?snd = cal:num(?d)){

        if (?fst = ?snd, ?first,
        if (?fst < ?snd, cal:date(?y, ?m, 1 + (?snd - ?fst)),
        cal:date(?y, ?m, 1 + 7 - (?fst - ?snd))))
    }
}


}
values (?y ?m ?d) {
(2015 10 "Friday")
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy