  In this paper we study the elementary theory of graph products of groups and
show that under natural conditions on the vertex groups we can recover (the
core of) the underlying graph and the associated vertex groups. More precisely,
we require the vertex groups to satisfy a non-generic almost positive sentence,
a condition which generalizes a range of natural ``non-freeness conditions"
such as the satisfaction of a group law, having nontrivial center or being
boundedly simple.
  As a corollary, we determine an invariant of the elementary theory of a
right-angled Artin group, the core of the defining graph, which we conjecture
to determine the elementary class of the RAAG. We further combine our results
with the results of Sela on free products of groups to describe all finitely
generated groups elementarily equivalent to certain RAAGs. We also deduce
rigidity results on the elementary classification of graph products of groups
for specific types of vertex groups, such as finite, nilpotent or classical
linear groups.
