I am currently studying the theory of foliations and groupoids from a differentiable viewpoint, in particular Haefliger spaces. [See Segal, Classifying spaces related to foliations, and Moerdijk, Classifying toposes and foliations.]
I read that there are related notions of groupoids and foliations in algebraic geometry, particulary in the context of schemes. Is there a basic reference where to study this theory? Assume as background a basic course on schemes and several courses in "classical" algebraic geometry.
Thank you very much.