RDF query and inference in a distributed environment