Dealing with dates in cwm
cwm is the main Semantic Web toolkit I use to manipulate RDF; while it has some speed issues – really, it shouldn’t have them in the next release -, it allows to use N3 Rules which are tricky to write, but are so much more powerful than declarative programing that at least you feel good once you have written them.
A recurrent pattern I have encountered regards dealing with date differences, e.g. comparing the date of publication of a document with the current date; here is what I’m using (e.g. in detect-missing.n3):