Declarative Programming for Knowledge Management