Logic Programming as a Service (LPaaS): Intelligence for the IoT