  We consider the following dichotomy for $\Sigma^0_2$ finitary relations $R$
on analytic subsets of the generalized Baire space for $\kappa$: either all
$R$-independent sets are of size at most $\kappa$, or there is a
$\kappa$-perfect $R$-independent set. This dichotomy is the uncountable version
of a result found in (W. Kubi\'s, Proc. Amer. Math. Soc. 131 (2003), no
2.:619--623) and in (S. Shelah, Fund. Math. 159 (1999), no. 1:1--50). We prove
that the above statement holds assuming $\Diamond_\kappa$ and the set
theoretical hypothesis $I^-(\kappa)$, which is the modification of the
hypothesis $I(\kappa)$ suitable for limit cardinals. When $\kappa$ is
inaccessible, or when $R$ is a closed binary relation, the assumption
$\Diamond_\kappa$ is not needed.
  We obtain as a corollary the uncountable version of a result by G. S\'agi and
the first author (Log. J. IGPL 20 (2012), no. 6:1064--1082) about the
$\kappa$-sized models of a $\Sigma^1_1(L_{\kappa^+\kappa})$-sentence when
considered up to isomorphism, or elementary embeddability, by elements of a
$K_\kappa$ subset of ${}^\kappa\kappa$. The role of elementary embeddings can
be replaced by a more general notion that also includes embeddings, as well as
the maps preserving $L_{\lambda\mu}$ for $\omega\leq\mu\leq\lambda\leq\kappa$
and the finite variable fragments of these logics.
