More work on prolog datamodel