An essentially algebraic theoery, according to Adamek and Rosicky (second definition on nlab), consists of a many-sorted signature $\Sigma$ (consisting of function symbols on sorts $S$), a set $E$ of equations, a subset of total function symbols $\Sigma_t \subseteq \Sigma$, and a function $\mathrm{Def}$ that sends partial function symbols $f \in \Sigma \backslash \Sigma_t $ to sets of equations consisting of equations in variables of sorts that are in the source of $f$, and total function symbols.

It seems pretty clear to me how to construct a limit sketch from an essentially algebraic theory: an object for each sort, an object for each source of a function symbol along with a product diagram for that object, and equalizers defined by $\mathrm{Def}$ for each partial function, and the source of the partial functions are those equalizers.

Going the other way is not so clear to me. For theories with at most "one level" of equalizers, like categories, it's pretty clear, but I don't see a way of turning a theory with an operation that has source the equalizer of two functions whose source is an equalizer into an essentially algebraic theory. Specifically, consider the limit sketch we can get from

$f, g : A \to B$,

$h, k : \mathrm{Eq}(f,g) \to C$,

$p : \mathrm{Eq}(h,k) \to D$.

The issue is that $\mathrm{Def}$ equations can only be defined in terms of total functions, and here I want $\mathrm{Def}(p) = \{x:A \vdash f(x) = g(x),x:A \vdash h(x) = k(x) \} $ , but $h$ and $k$ are partial.

Is there a more direct way of getting this rather than taking the category of models of the sketch and then constructing the essentially algebraic theory out of that locally presentable category using their theorem 3.36? This is both difficult, and produces something that looks more like a classifying category (ie. the deductive closure of a theory) than a more presentation-like theory.

A similar question would be, in 3.37 Remark of Adamek and Rosicky, they say that these partial/total essentially algebraic theories are equivalent to well-ordered essentially algebraic theories where there is a well-ordering on the operations and operations are partially defined only in terms of operations that are lower in the well-ordering, by giving an equivalence with locally presentable categories. What then is that well-ordered essentially algebraic theory that you get from a partial/total essentially algebraic theory through this?