An ontological basis for the quantum theory