Application of Graph transformations to declarative knowledge bases