Abstract. Let K n,j be the space of long j-knots in R n . In this paper we introduce a graph complex D * and a linear map I : D * → Ω * DR (K n,j ) via configuration space integral, and prove that (1) when both n > j ≥ 3 are odd, I is a cochain map if restricted to graphs with at most one loop component, (2) when n − j ≥ 2 is even, I is a cochain map if restricted to tree graphs, and (3) when n − j ≥ 3 is odd, I added a correction term produces a (2n − 3j − 3)-cocycle of K n,j which gives a new formulation of the Haefliger invariant when n = 6k, j = 4k − 1 for some k.