Logic programming as a service in multi-agent systems for the Internet of Things