Restriction maps for structure sheaf of Spec A

For the space $X = \operatorname{Spec} A$, we define the structure sheaf $\mathcal{O}_X$ as follows. For an open subset $U \subseteq X$, we let $\mathcal{O}_X(U)$ be the projective limit of the family $\{ A_f : f \in A, D(f) \subseteq U \}$ indexed with the partial order $f \le g \iff D(f) \subseteq D(g)$. (Here $A_f$ denotes the localization of $A$ at $f$.) I am having trouble understanding how to define the restriction maps $\rho^U_V : \mathcal{O}_X(U) \to \mathcal{O}_X(V)$, for $V \subseteq U$. I understand it should be induced from $\rho^{D(g)}_{D(f)} : A_g \to A_f$ somehow ($D(f) \subseteq D(g)$), but I can’t quite figure out what it should be.

($D(f)$ are the principal open sets.)

-

If $V \subset U$ inside of $\operatorname{Spec} A$ then the principal open subsets contained in $V$ form a subfamily of those contained in $U$. By the universal property of the inverse limit, one way to give a homomorphism $\mathscr O(U) \to \mathscr O(V)$ is to give a homomorphism $\mathscr O(U) \to A_f$ for each $f \in A$ such that $D(f) \subset V$, and in a compatible way. Since $D(f) \subset U$, the projection corresponding to $f$ that comes with the inverse limit defining $\mathscr O(U)$ will do this job nicely!